RFR: 8172157: Tighten up contract between concurrent GCs and runtime regarding object allocation and header initialization
White, Derek
Derek.White at cavium.com
Wed Jan 4 23:03:20 UTC 2017
[resending to hotspot-dev]
There are three issues that came up in the review comments for 8171449<tel: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”
Webrev: http://cr.openjdk.java.net/~drwhite/8172157/webrev.02/
Thanks,
* Derek
More information about the hotspot-dev
mailing list