RFR(S): 8165489: Missing G1 barrier in Unsafe_GetObjectVolatile

Doerr, Martin martin.doerr at sap.com
Mon Sep 12 17:09:23 UTC 2016

Hi Mikael,

thanks for reviewing.

I have created a new webrev according to your recommendations.
"is_java_lang_ref_Reference_write" would be confusing because it is a read access.

Webrev is here:

Best regards,

-----Original Message-----
From: Mikael Gerdin [mailto:mikael.gerdin at oracle.com] 
Sent: Montag, 12. September 2016 15:06
To: Doerr, Martin <martin.doerr at sap.com>; Kim Barrett <kim.barrett at oracle.com>; hotspot-runtime-dev at openjdk.java.net; hotspot-gc-dev at openjdk.java.net
Subject: Re: RFR(S): 8165489: Missing G1 barrier in Unsafe_GetObjectVolatile

Hi Martin,

On 2016-09-06 13:11, Doerr, Martin wrote:
> Hi Kim,
> as discussed in the thread for JDK-8165018, I created a bug and a webrev:
> http://cr.openjdk.java.net/~mdoerr/8165489_G1_Unsafe/webrev.00/

inline void G1SATB_registerReference(oop o, jlong offset, oop v)

* Since this is local to unsafe.cpp you should make it "static"
* I think "inline" is not really needed, especially since there is an 
intrinsic for Unsafe::getObjectVolatile.
* Since the function does not unconditionally register the reference a 
more complete name for the function would become very long, perhaps it 
should be split into two separate ones:

static bool is_java_lang_ref_Reference_write(oop o, jlong offset) {

static void ensure_referent_alive(oop v) {
   if (v != NULL) {
static void ensure_referent_alive(oop v) {}

so the code in Unsafe_GetObject would be something like:

if (is_java_lang_ref_Reference_write(p, offset)) {


> Please review.
> Thanks for the discussion and for sponsoring.
> Best regards,
> Martin

More information about the hotspot-gc-dev mailing list