RFR: 8144993: Elide redundant memory barrier after AllocationNode

Axel Siebenborn axel.siebenborn at sap.com
Fri Dec 18 13:11:12 UTC 2015


Hi,
the concern raised in this mail thread is, that an object will be known 
known to the GC, though it could be seen, as not fully initialized. I 
share the opinion, that this might be the case.
However, I don't see, how it can be a problem with the concurrent 
threads of G1 or CMS.

The G1 collector uses its snapshot at the beginning and just scans 
objects, that where reachable at the initial marking. Newly allocated 
objects are considered as life.

The CMS collector doesn't scan young generation. For the exceptional 
cases, where an object is allocated directly in old gen, there is a 
store_store_membar after setting the class field to null allocating a 
chunk from the freelist. Concurrent threads can handle objects with null 
as class and won't scan them.

A function "gc_requires_initialized_new_obj_headers()" would return 
false, for all current GC implementations, but might be useful to make 
both compiler and GC developers aware of a potential problem.

Regards,
Axel




More information about the hotspot-compiler-dev mailing list