RFR: 8172157: Tighten up contract between concurrent GCs and runtime regarding object allocation and header initialization
Derek.White at cavium.com
Fri Dec 30 23:25:47 UTC 2016
There are three issues that came up in the review comments for 8171449 that I tried to handle:
1) Inline allocation by jitted code and the interpreter only allocate out of the young gen (either TLABS or eden), and the concurrent GC threads will never scan object in the young gen, so inline-alloctors don't need to ensure memory ordering for the concurrent GC's use. Added comments and assertions.
2) Non-inline allocation in the old gen by a concurrent GC should first set an object's klass field to NULL before setting it to a correct value. Added comments and assertions.
3) There should be no race condition between the steps in 2 that allows a concurrent GC thread to see an incorrect value. This is harder to prove, and is not handled in this fix.
I'm trying to pull some of the constraints out from the depths of the collectors to something closer to the GC/runtime interface, so the non-GC code (writers) can reason about it.
Bug: https://bugs.openjdk.java.net/browse/JDK-8172157 "Tighten up contract between concurrent GCs and runtime regarding object allocation and header initialization"
More information about the hotspot-runtime-dev