RFR: Check for NULL in is-alive-closures
Roman Kennke
rkennke at redhat.com
Fri Feb 2 14:19:46 UTC 2018
Am 02.02.2018 um 15:03 schrieb Aleksey Shipilev:
> On 02/02/2018 01:55 PM, Roman Kennke wrote:
>>> http://cr.openjdk.java.net/~rkennke/fixisalivecl/webrev.00/
>>
>> The situation might arise only with traversal GC, because it can mark through the Reference object
>> right after it is created, but fields not yet initialized. In this case, referent is still NULL, but
>> it can already be visible to the GC. A subsequent putfield to store the referent will do the right
>> thing (i.e. put the referent in the traversal work queue, and mark it live). Returning 'is-alive'
>> for the NULL is still the best we can do I think.
>
> I guess it is then safer to add to do this:
>
> if (_heap->concurrent_traversal_in_progress() && oopDesc::is_null(obj)) {
> // (add the comment from above here)
> return true;
> }
>
> -Aleksey
>
HmmmHmm. Ok:
http://cr.openjdk.java.net/~rkennke/fixisalivecl/webrev.01/
Good?
Roman
More information about the shenandoah-dev
mailing list