RFR: Uses keep_alive_barrier to keep deduped char array alive

Zhengyu Gu zgu at redhat.com
Wed Oct 11 19:50:00 UTC 2017


>>>
>> Ok, let me clear my thoughts here.
>>
>> If we do SATB barrier, that will ensure existing_value alive.
> In G1, and Shenandoah (but only during conc-mark, not during conc-partial).
>> However, if we do keep_alive_barrier, the existing_value could be 
>> evacuated, but we still hold old oop here, right? then we can end up 
>> dead oop after recycle?
> No, because there cannot be a safepoint between keep_alive_barrier() and 
> subsequent uses. We may hold a pointer to a from-space object, but that 
> should be ok if all subsequent uses do their barriers right. There is 
> only one subsequent use before the oop goes out of scope, and that is
> 
> java_lang_String::set_value(java_string, typeArrayOop(existing_value));
> 
> which does the correct barrier (i.e. storeval-barrier). Everything 
> should be fine.
Okay, I see. Thanks for the explanation.

Updated webrev: 
http://cr.openjdk.java.net/~zgu/shenandoah/strdedup_keep_alive/webrev.01/

Reran the test on x64.

Thanks,

-Zhengyu

> 
> Roman


More information about the shenandoah-dev mailing list