8205923: ZGC: Verification applies load barrier before verification
Reviewed-by: pliden, eosterlund
This commit is contained in:
parent
45c5c6fda4
commit
03d213bcda
@ -77,7 +77,8 @@ class OopIterateClosure : public OopClosure {
|
|||||||
enum ReferenceIterationMode {
|
enum ReferenceIterationMode {
|
||||||
DO_DISCOVERY, // Apply closure and discover references
|
DO_DISCOVERY, // Apply closure and discover references
|
||||||
DO_DISCOVERED_AND_DISCOVERY, // Apply closure to discovered field and do discovery
|
DO_DISCOVERED_AND_DISCOVERY, // Apply closure to discovered field and do discovery
|
||||||
DO_FIELDS // Apply closure to all fields
|
DO_FIELDS, // Apply closure to all fields
|
||||||
|
DO_FIELDS_EXCEPT_REFERENT // Apply closure to all fields except the referent field
|
||||||
};
|
};
|
||||||
|
|
||||||
// The default iteration mode is to do discovery.
|
// The default iteration mode is to do discovery.
|
||||||
|
@ -131,6 +131,10 @@ class InstanceRefKlass: public InstanceKlass {
|
|||||||
template <typename T, class OopClosureType, class Contains>
|
template <typename T, class OopClosureType, class Contains>
|
||||||
static void oop_oop_iterate_fields(oop obj, OopClosureType* closure, Contains& contains);
|
static void oop_oop_iterate_fields(oop obj, OopClosureType* closure, Contains& contains);
|
||||||
|
|
||||||
|
// Apply the closure to all fields, except the referent field. No reference discovery is done.
|
||||||
|
template <typename T, class OopClosureType, class Contains>
|
||||||
|
static void oop_oop_iterate_fields_except_referent(oop obj, OopClosureType* closure, Contains& contains);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static void trace_reference_gc(const char *s, oop obj) NOT_DEBUG_RETURN;
|
static void trace_reference_gc(const char *s, oop obj) NOT_DEBUG_RETURN;
|
||||||
|
|
||||||
|
@ -88,6 +88,14 @@ void InstanceRefKlass::oop_oop_iterate_discovery(oop obj, ReferenceType type, Oo
|
|||||||
do_discovered<T>(obj, closure, contains);
|
do_discovered<T>(obj, closure, contains);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T, class OopClosureType, class Contains>
|
||||||
|
void InstanceRefKlass::oop_oop_iterate_discovered_and_discovery(oop obj, ReferenceType type, OopClosureType* closure, Contains& contains) {
|
||||||
|
// Explicitly apply closure to the discovered field.
|
||||||
|
do_discovered<T>(obj, closure, contains);
|
||||||
|
// Then do normal reference processing with discovery.
|
||||||
|
oop_oop_iterate_discovery<T>(obj, type, closure, contains);
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T, class OopClosureType, class Contains>
|
template <typename T, class OopClosureType, class Contains>
|
||||||
void InstanceRefKlass::oop_oop_iterate_fields(oop obj, OopClosureType* closure, Contains& contains) {
|
void InstanceRefKlass::oop_oop_iterate_fields(oop obj, OopClosureType* closure, Contains& contains) {
|
||||||
do_referent<T>(obj, closure, contains);
|
do_referent<T>(obj, closure, contains);
|
||||||
@ -95,11 +103,8 @@ void InstanceRefKlass::oop_oop_iterate_fields(oop obj, OopClosureType* closure,
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, class OopClosureType, class Contains>
|
template <typename T, class OopClosureType, class Contains>
|
||||||
void InstanceRefKlass::oop_oop_iterate_discovered_and_discovery(oop obj, ReferenceType type, OopClosureType* closure, Contains& contains) {
|
void InstanceRefKlass::oop_oop_iterate_fields_except_referent(oop obj, OopClosureType* closure, Contains& contains) {
|
||||||
// Explicitly apply closure to the discovered field.
|
|
||||||
do_discovered<T>(obj, closure, contains);
|
do_discovered<T>(obj, closure, contains);
|
||||||
// Then do normal reference processing with discovery.
|
|
||||||
oop_oop_iterate_discovery<T>(obj, type, closure, contains);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, class OopClosureType, class Contains>
|
template <typename T, class OopClosureType, class Contains>
|
||||||
@ -117,6 +122,10 @@ void InstanceRefKlass::oop_oop_iterate_ref_processing(oop obj, OopClosureType* c
|
|||||||
trace_reference_gc<T>("do_fields", obj);
|
trace_reference_gc<T>("do_fields", obj);
|
||||||
oop_oop_iterate_fields<T>(obj, closure, contains);
|
oop_oop_iterate_fields<T>(obj, closure, contains);
|
||||||
break;
|
break;
|
||||||
|
case OopIterateClosure::DO_FIELDS_EXCEPT_REFERENT:
|
||||||
|
trace_reference_gc<T>("do_fields_except_referent", obj);
|
||||||
|
oop_oop_iterate_fields_except_referent<T>(obj, closure, contains);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user