RFR: 8144993: Elide redundant memory barrier after AllocationNode
Andrew Haley
aph at redhat.com
Mon Dec 21 09:22:23 UTC 2015
On 21/12/15 09:10, Axel Siebenborn wrote:
>
> On 18.12.2015 21:23, Andrew Haley wrote:
>>
>> On 18/12/15 13:11, Axel Siebenborn wrote:
>>
>>> 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.
>>
>> Right, so say the safepoint in question is the SATB. Then the newly-
>> created objects get scanned, and we have the problem as described.
>> Right? Or perhaps I'm missing something.
>
> Only objects, that where live at the SATB safepoint get scanned.
> Newly-created objects will not be scanned.
So why are these newly-created objects not prematurely collected?
How does the GC know? Is it that the immediately reachable objects
get scanned and their references pushed immediately but SATB does not
follow those references?
If there is a mechanism to prevent the problem as described, can you
tell us how that mechanism works?
Andrew.
More information about the hotspot-compiler-dev
mailing list