8276177: nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption failed with "assert(def_ik->is_being_redefined()) failed: should be being redefined to get here"

Reviewed-by: hseigel, sspitsyn
This commit is contained in:
Coleen Phillimore 2021-11-17 19:53:55 +00:00
parent b6876649a8
commit a907b2b144
3 changed files with 11 additions and 6 deletions

View file

@ -254,8 +254,7 @@ class InstanceKlass: public Klass {
_misc_is_shared_platform_class = 1 << 11, // defining class loader is platform class loader
_misc_is_shared_app_class = 1 << 12, // defining class loader is app class loader
_misc_has_resolved_methods = 1 << 13, // resolved methods table entries added for this class
_misc_is_being_redefined = 1 << 14, // used for locking redefinition
_misc_has_contended_annotations = 1 << 15 // has @Contended annotation
_misc_has_contended_annotations = 1 << 14 // has @Contended annotation
};
u2 shared_loader_type_bits() const {
return _misc_is_shared_boot_class|_misc_is_shared_platform_class|_misc_is_shared_app_class;
@ -733,14 +732,16 @@ public:
#if INCLUDE_JVMTI
// Redefinition locking. Class can only be redefined by one thread at a time.
// The flag is in access_flags so that it can be set and reset using atomic
// operations, and not be reset by other misc_flag settings.
bool is_being_redefined() const {
return ((_misc_flags & _misc_is_being_redefined) != 0);
return _access_flags.is_being_redefined();
}
void set_is_being_redefined(bool value) {
if (value) {
_misc_flags |= _misc_is_being_redefined;
_access_flags.set_is_being_redefined();
} else {
_misc_flags &= ~_misc_is_being_redefined;
_access_flags.clear_is_being_redefined();
}
}