< prev index next >

src/hotspot/share/oops/instanceKlassMiscStatus.hpp

Print this page

 28 class ClassLoaderData;
 29 
 30 class InstanceKlassMiscStatus {
 31   friend class VMStructs;
 32   friend class JVMCIVMStructs;
 33 
 34 #define IK_FLAGS_DO(flag)  \
 35     flag(rewritten                          , 1 << 0) /* methods rewritten. */ \
 36     flag(has_nonstatic_fields               , 1 << 1) /* for sizing with UseCompressedOops */ \
 37     flag(should_verify_class                , 1 << 2) /* allow caching of preverification */ \
 38     flag(unused                             , 1 << 3) /* not currently used */ \
 39     flag(is_contended                       , 1 << 4) /* marked with contended annotation */ \
 40     flag(has_nonstatic_concrete_methods     , 1 << 5) /* class/superclass/implemented interfaces has non-static, concrete methods */ \
 41     flag(declares_nonstatic_concrete_methods, 1 << 6) /* directly declares non-static, concrete methods */ \
 42     flag(has_been_redefined                 , 1 << 7) /* class has been redefined */ \
 43     flag(shared_loading_failed              , 1 << 8) /* class has been loaded from shared archive */ \
 44     flag(is_scratch_class                   , 1 << 9) /* class is the redefined scratch class */ \
 45     flag(is_shared_boot_class               , 1 << 10) /* defining class loader is boot class loader */ \
 46     flag(is_shared_platform_class           , 1 << 11) /* defining class loader is platform class loader */ \
 47     flag(is_shared_app_class                , 1 << 12) /* defining class loader is app class loader */ \
 48     flag(has_contended_annotations          , 1 << 13) /* has @Contended annotation */











 49 
 50 #define IK_FLAGS_ENUM_NAME(name, value)    _misc_##name = value,
 51   enum {
 52     IK_FLAGS_DO(IK_FLAGS_ENUM_NAME)
 53   };
 54 #undef IK_FLAGS_ENUM_NAME
 55 
 56   u2 shared_loader_type_bits() const {
 57     return _misc_is_shared_boot_class|_misc_is_shared_platform_class|_misc_is_shared_app_class;
 58   }
 59 
 60   // These flags are write-once before the class is published and then read-only so don't require atomic updates.
 61   u2 _flags;
 62 
 63  public:
 64 
 65   InstanceKlassMiscStatus() : _flags(0) {}
 66 
 67   // Create getters and setters for the flag values.
 68 #define IK_FLAGS_GET(name, ignore)          \
 69   bool name() const { return (_flags & _misc_##name) != 0; }
 70   IK_FLAGS_DO(IK_FLAGS_GET)
 71 #undef IK_FLAGS_GET
 72 
 73 #define IK_FLAGS_SET(name, ignore)   \
 74   void set_##name(bool b) {         \
 75     assert(!name(), "set once");    \
 76     if (b) _flags |= _misc_##name; \
 77   }
 78   IK_FLAGS_DO(IK_FLAGS_SET)
 79 #undef IK_FLAGS_SET
 80 
 81   bool is_shared_unregistered_class() const {
 82     return (_flags & shared_loader_type_bits()) == 0;
 83   }
 84 
 85   void set_shared_class_loader_type(s2 loader_type);
 86 
 87   void assign_class_loader_type(const ClassLoaderData* cld);






 88 };
 89 
 90 #endif // SHARE_OOPS_INSTANCEKLASSMISCSTATUS_HPP

 28 class ClassLoaderData;
 29 
 30 class InstanceKlassMiscStatus {
 31   friend class VMStructs;
 32   friend class JVMCIVMStructs;
 33 
 34 #define IK_FLAGS_DO(flag)  \
 35     flag(rewritten                          , 1 << 0) /* methods rewritten. */ \
 36     flag(has_nonstatic_fields               , 1 << 1) /* for sizing with UseCompressedOops */ \
 37     flag(should_verify_class                , 1 << 2) /* allow caching of preverification */ \
 38     flag(unused                             , 1 << 3) /* not currently used */ \
 39     flag(is_contended                       , 1 << 4) /* marked with contended annotation */ \
 40     flag(has_nonstatic_concrete_methods     , 1 << 5) /* class/superclass/implemented interfaces has non-static, concrete methods */ \
 41     flag(declares_nonstatic_concrete_methods, 1 << 6) /* directly declares non-static, concrete methods */ \
 42     flag(has_been_redefined                 , 1 << 7) /* class has been redefined */ \
 43     flag(shared_loading_failed              , 1 << 8) /* class has been loaded from shared archive */ \
 44     flag(is_scratch_class                   , 1 << 9) /* class is the redefined scratch class */ \
 45     flag(is_shared_boot_class               , 1 << 10) /* defining class loader is boot class loader */ \
 46     flag(is_shared_platform_class           , 1 << 11) /* defining class loader is platform class loader */ \
 47     flag(is_shared_app_class                , 1 << 12) /* defining class loader is app class loader */ \
 48     flag(has_contended_annotations          , 1 << 13) /* has @Contended annotation */ \
 49     flag(has_inline_type_fields             , 1 << 14) /* has inline fields and related embedded section is not empty */ \
 50     flag(is_empty_inline_type               , 1 << 15) /* empty inline type (*) */ \
 51     flag(is_naturally_atomic                , 1 << 16) /* loaded/stored in one instruction */ \
 52     flag(is_declared_atomic                 , 1 << 17) /* Listed -XX:ForceNonTearable=clist option */ \
 53     flag(carries_value_modifier             , 1 << 18) /* the class or one of its super types has the ACC_VALUE modifier */ \
 54     flag(carries_identity_modifier          , 1 << 19) /* the class or one of its super types has the ACC_IDENTITY modifier */
 55 
 56   /* (*) An inline type is considered empty if it contains no non-static fields or
 57      if it contains only empty inline fields. Note that JITs have a slightly different
 58      definition: empty inline fields must be flattened otherwise the container won't
 59      be considered empty */
 60 
 61 #define IK_FLAGS_ENUM_NAME(name, value)    _misc_##name = value,
 62   enum {
 63     IK_FLAGS_DO(IK_FLAGS_ENUM_NAME)
 64   };
 65 #undef IK_FLAGS_ENUM_NAME
 66 
 67   u2 shared_loader_type_bits() const {
 68     return _misc_is_shared_boot_class|_misc_is_shared_platform_class|_misc_is_shared_app_class;
 69   }
 70 
 71   // These flags are write-once before the class is published and then read-only so don't require atomic updates.
 72   u4 _flags;
 73 
 74  public:
 75 
 76   InstanceKlassMiscStatus() : _flags(0) {}
 77 
 78   // Create getters and setters for the flag values.
 79 #define IK_FLAGS_GET(name, ignore)          \
 80   bool name() const { return (_flags & _misc_##name) != 0; }
 81   IK_FLAGS_DO(IK_FLAGS_GET)
 82 #undef IK_FLAGS_GET
 83 
 84 #define IK_FLAGS_SET(name, ignore)   \
 85   void set_##name(bool b) {         \
 86     assert(!name(), "set once");    \
 87     if (b) _flags |= _misc_##name; \
 88   }
 89   IK_FLAGS_DO(IK_FLAGS_SET)
 90 #undef IK_FLAGS_SET
 91 
 92   bool is_shared_unregistered_class() const {
 93     return (_flags & shared_loader_type_bits()) == 0;
 94   }
 95 
 96   void set_shared_class_loader_type(s2 loader_type);
 97 
 98   void assign_class_loader_type(const ClassLoaderData* cld);
 99 
100   u4 flags() const { return _flags; }
101 
102   static u4 is_empty_inline_type_value() {
103     return _misc_is_empty_inline_type;
104   }
105 };
106 
107 #endif // SHARE_OOPS_INSTANCEKLASSMISCSTATUS_HPP
< prev index next >