RFR: Check for NULL in is-alive-closures
Aleksey Shipilev
shade at redhat.com
Fri Feb 2 14:03:54 UTC 2018
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
More information about the shenandoah-dev
mailing list