RFR(S): 8173013: JVMTI tagged object access needs G1 pre-barrier

sangheon sangheon.kim at oracle.com
Thu Feb 2 19:11:43 UTC 2017

Hi all,

Could I have some reviews for this change that adds G1 pre-barrier?

JvmtiTagHashmapEntry has a bare oop member and this is a weak reference. 
So any place that allows this oop to 'escape' needs the G1 pre-barrier.
JvmtiEnv::GetObjectsWithTags() provides such an escape path.

For G1, in order to maintain the SATB invariants, reading the referent 
of a weak reference must ensure the referent is marked alive.

So this proposal includes adding the pre-barrier at 
TagObjectCollector::do_entry(JvmtiTagHashmapEntry* entry) which I see 
the only place interacts(except 'peek' operations) with the bare oop member.

As writing stable test could take some more time, Stefan Karlsson and I 
did some tests to provoke this problem.
( Stefan Karlsson kindly provided the test, 
<http://cr.openjdk.java.net/%7Estefank/8173013/reproducer/> )
With this proposed patch, the problem goes away.

CR: https://bugs.openjdk.java.net/browse/JDK-8173013
Webrev: http://cr.openjdk.java.net/~sangheki/8173013/webrev.0
Testing: JPRT, some closed tests which use JVMTI and JDI.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20170202/581c7051/attachment.htm>

More information about the hotspot-gc-dev mailing list