8306310: Move is_shared Klass flag

Reviewed-by: iklam, fparain
This commit is contained in:
Coleen Phillimore 2023-04-19 14:04:19 +00:00
parent c738c8ea3e
commit 1a41e12c22
2 changed files with 10 additions and 5 deletions

View File

@ -176,6 +176,7 @@ private:
// Various attributes for shared classes. Should be zero for a non-shared class.
u2 _shared_class_flags;
enum CDSSharedClassFlags {
_is_shared_class = 1 << 0, // shadows MetaspaceObj::is_shared
_archived_lambda_proxy_is_available = 1 << 1,
_has_value_based_class_annotation = 1 << 2,
_verified_at_dump_time = 1 << 3,
@ -363,6 +364,15 @@ protected:
NOT_CDS(return false;)
}
bool is_shared() const { // shadows MetaspaceObj::is_shared)()
CDS_ONLY(return (_shared_class_flags & _is_shared_class) != 0;)
NOT_CDS(return false;)
}
void set_is_shared() {
CDS_ONLY(_shared_class_flags |= _is_shared_class;)
}
// Obtain the module or package for this class
virtual ModuleEntry* module() const = 0;
virtual PackageEntry* package() const = 0;
@ -656,8 +666,6 @@ protected:
void set_has_vanilla_constructor() { _access_flags.set_has_vanilla_constructor(); }
bool has_miranda_methods () const { return access_flags().has_miranda_methods(); }
void set_has_miranda_methods() { _access_flags.set_has_miranda_methods(); }
bool is_shared() const { return access_flags().is_shared_class(); } // shadows MetaspaceObj::is_shared)()
void set_is_shared() { _access_flags.set_is_shared_class(); }
bool is_hidden() const { return access_flags().is_hidden_class(); }
void set_is_hidden() { _access_flags.set_is_hidden_class(); }
bool is_value_based() { return _access_flags.is_value_based_class(); }

View File

@ -66,7 +66,6 @@ enum {
JVM_ACC_HAS_FINALIZER = 0x40000000, // True if klass has a non-empty finalize() method
JVM_ACC_IS_CLONEABLE_FAST = (int)0x80000000,// True if klass implements the Cloneable interface and can be optimized in generated code
JVM_ACC_HAS_FINAL_METHOD = 0x01000000, // True if klass has final method
JVM_ACC_IS_SHARED_CLASS = 0x02000000, // True if klass is shared
JVM_ACC_IS_HIDDEN_CLASS = 0x04000000, // True if klass is hidden
JVM_ACC_IS_VALUE_BASED_CLASS = 0x08000000, // True if klass is marked as a ValueBased class
JVM_ACC_IS_BEING_REDEFINED = 0x00100000, // True if the klass is being redefined.
@ -126,7 +125,6 @@ class AccessFlags {
bool has_finalizer () const { return (_flags & JVM_ACC_HAS_FINALIZER ) != 0; }
bool has_final_method () const { return (_flags & JVM_ACC_HAS_FINAL_METHOD ) != 0; }
bool is_cloneable_fast () const { return (_flags & JVM_ACC_IS_CLONEABLE_FAST ) != 0; }
bool is_shared_class () const { return (_flags & JVM_ACC_IS_SHARED_CLASS ) != 0; }
bool is_hidden_class () const { return (_flags & JVM_ACC_IS_HIDDEN_CLASS ) != 0; }
bool is_value_based_class () const { return (_flags & JVM_ACC_IS_VALUE_BASED_CLASS ) != 0; }
@ -196,7 +194,6 @@ class AccessFlags {
void set_has_final_method() { atomic_set_bits(JVM_ACC_HAS_FINAL_METHOD); }
void set_is_cloneable_fast() { atomic_set_bits(JVM_ACC_IS_CLONEABLE_FAST); }
void set_has_miranda_methods() { atomic_set_bits(JVM_ACC_HAS_MIRANDA_METHODS); }
void set_is_shared_class() { atomic_set_bits(JVM_ACC_IS_SHARED_CLASS); }
void set_is_hidden_class() { atomic_set_bits(JVM_ACC_IS_HIDDEN_CLASS); }
void set_is_value_based_class() { atomic_set_bits(JVM_ACC_IS_VALUE_BASED_CLASS); }