-
Enhancement
-
Resolution: Fixed
-
P4
-
16
-
b11
JDK-6320749 discusses a problem with the assertion originally added to ObjectSynchronizer::FastHashcode,
assert(!SafepointSynchronize::is_at_safepoint(), "invariant");
the reasoning for which was stated as:
"hashCode() can be a heap mutator. Given that, it seems unwise to call hashCode while at a safepoint. Can parallelscavange tolerate the markwords changing at this point? (Are the markwords known intact in this situation?)"
but a "verify_in_progress" relaxation check was added to address the problem in 6320749, and we have since further added a relaxation for DumpSharedSpaces:
assert(Universe::verify_in_progress() || DumpSharedSpaces ||
!SafepointSynchronize::is_at_safepoint(), "invariant");
The same initial !is-at-safepoint assertion was also added to ObjectSynchronizer::inflate - with the same basic mutation-of-markword rationale. But monitor deflation, which also mutates the markword, has until recently always been performed at a safepoint and ergo markWord mutation at a safepoint must be safe, and thus both assertions can be removed.
These assertions can be tripped if inflation happens to occur when querying the identity_hash of an object, during a CDS dump safepoint.
assert(!SafepointSynchronize::is_at_safepoint(), "invariant");
the reasoning for which was stated as:
"hashCode() can be a heap mutator. Given that, it seems unwise to call hashCode while at a safepoint. Can parallelscavange tolerate the markwords changing at this point? (Are the markwords known intact in this situation?)"
but a "verify_in_progress" relaxation check was added to address the problem in 6320749, and we have since further added a relaxation for DumpSharedSpaces:
assert(Universe::verify_in_progress() || DumpSharedSpaces ||
!SafepointSynchronize::is_at_safepoint(), "invariant");
The same initial !is-at-safepoint assertion was also added to ObjectSynchronizer::inflate - with the same basic mutation-of-markword rationale. But monitor deflation, which also mutates the markword, has until recently always been performed at a safepoint and ergo markWord mutation at a safepoint must be safe, and thus both assertions can be removed.
These assertions can be tripped if inflation happens to occur when querying the identity_hash of an object, during a CDS dump safepoint.
- relates to
-
JDK-8251460 Fix the biased-locking code in ObjectSynchronizer::FastHashCode
-
- Resolved
-