src/share/vm/utilities/accessFlags.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8073191-work Sdiff src/share/vm/utilities

src/share/vm/utilities/accessFlags.hpp

Print this page




  63   JVM_ACC_HAS_VANILLA_CONSTRUCTOR = 0x20000000,     // True if klass has a vanilla default constructor
  64   JVM_ACC_HAS_FINALIZER           = 0x40000000,     // True if klass has a non-empty finalize() method
  65   JVM_ACC_IS_CLONEABLE_FAST       = (int)0x80000000,// True if klass implements the Cloneable interface and can be optimized in generated code
  66   JVM_ACC_HAS_FINAL_METHOD        = 0x01000000,     // True if klass has final method
  67 
  68   // Klass* and Method* flags
  69   JVM_ACC_HAS_LOCAL_VARIABLE_TABLE= 0x00200000,
  70 
  71   JVM_ACC_PROMOTED_FLAGS          = 0x00200000,     // flags promoted from methods to the holding klass
  72 
  73   // field flags
  74   // Note: these flags must be defined in the low order 16 bits because
  75   // InstanceKlass only stores a ushort worth of information from the
  76   // AccessFlags value.
  77   // These bits must not conflict with any other field-related access flags
  78   // (e.g., ACC_ENUM).
  79   // Note that the class-related ACC_ANNOTATION bit conflicts with these flags.
  80   JVM_ACC_FIELD_ACCESS_WATCHED       = 0x00002000,  // field access is watched by JVMTI
  81   JVM_ACC_FIELD_MODIFICATION_WATCHED = 0x00008000,  // field modification is watched by JVMTI
  82   JVM_ACC_FIELD_INTERNAL             = 0x00000400,  // internal field, same as JVM_ACC_ABSTRACT
  83   JVM_ACC_FIELD_STABLE               = 0x00000020,  // @Stable field, same as JVM_ACC_SYNCHRONIZED

  84   JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE = 0x00000800, // field has generic signature
  85 
  86   JVM_ACC_FIELD_INTERNAL_FLAGS       = JVM_ACC_FIELD_ACCESS_WATCHED |
  87                                        JVM_ACC_FIELD_MODIFICATION_WATCHED |
  88                                        JVM_ACC_FIELD_INTERNAL |
  89                                        JVM_ACC_FIELD_STABLE |
  90                                        JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE,
  91 
  92                                                     // flags accepted by set_field_flags()
  93   JVM_ACC_FIELD_FLAGS                = JVM_RECOGNIZED_FIELD_MODIFIERS | JVM_ACC_FIELD_INTERNAL_FLAGS
  94 
  95 };
  96 
  97 
  98 class AccessFlags VALUE_OBJ_CLASS_SPEC {
  99   friend class VMStructs;
 100  private:
 101   jint _flags;
 102 
 103  public:


 137   bool is_old                  () const { return (_flags & JVM_ACC_IS_OLD                 ) != 0; }
 138   bool is_obsolete             () const { return (_flags & JVM_ACC_IS_OBSOLETE            ) != 0; }
 139   bool is_deleted              () const { return (_flags & JVM_ACC_IS_DELETED             ) != 0; }
 140   bool is_prefixed_native      () const { return (_flags & JVM_ACC_IS_PREFIXED_NATIVE     ) != 0; }
 141 
 142   // Klass* flags
 143   bool has_miranda_methods     () const { return (_flags & JVM_ACC_HAS_MIRANDA_METHODS    ) != 0; }
 144   bool has_vanilla_constructor () const { return (_flags & JVM_ACC_HAS_VANILLA_CONSTRUCTOR) != 0; }
 145   bool has_finalizer           () const { return (_flags & JVM_ACC_HAS_FINALIZER          ) != 0; }
 146   bool has_final_method        () const { return (_flags & JVM_ACC_HAS_FINAL_METHOD       ) != 0; }
 147   bool is_cloneable_fast       () const { return (_flags & JVM_ACC_IS_CLONEABLE_FAST      ) != 0; }
 148   // Klass* and Method* flags
 149   bool has_localvariable_table () const { return (_flags & JVM_ACC_HAS_LOCAL_VARIABLE_TABLE) != 0; }
 150   void set_has_localvariable_table()    { atomic_set_bits(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE); }
 151   void clear_has_localvariable_table()  { atomic_clear_bits(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE); }
 152 
 153   // field flags
 154   bool is_field_access_watched() const  { return (_flags & JVM_ACC_FIELD_ACCESS_WATCHED) != 0; }
 155   bool is_field_modification_watched() const
 156                                         { return (_flags & JVM_ACC_FIELD_MODIFICATION_WATCHED) != 0; }


 157   bool on_stack() const                 { return (_flags & JVM_ACC_ON_STACK) != 0; }
 158   bool is_internal() const              { return (_flags & JVM_ACC_FIELD_INTERNAL) != 0; }
 159   bool is_stable() const                { return (_flags & JVM_ACC_FIELD_STABLE) != 0; }
 160   bool field_has_generic_signature() const
 161                                         { return (_flags & JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE) != 0; }
 162 
 163   // get .class file flags
 164   jint get_flags               () const { return (_flags & JVM_ACC_WRITTEN_FLAGS); }
 165 
 166   // Initialization
 167   void add_promoted_flags(jint flags)   { _flags |= (flags & JVM_ACC_PROMOTED_FLAGS); }
 168   void set_field_flags(jint flags)      {
 169     assert((flags & JVM_ACC_FIELD_FLAGS) == flags, "only recognized flags");
 170     _flags = (flags & JVM_ACC_FIELD_FLAGS);
 171   }
 172   void set_flags(jint flags)            { _flags = (flags & JVM_ACC_WRITTEN_FLAGS); }
 173 
 174   void set_queued_for_compilation()    { atomic_set_bits(JVM_ACC_QUEUED); }
 175   void clear_queued_for_compilation()  { atomic_clear_bits(JVM_ACC_QUEUED); }
 176 


 215   void set_has_miranda_methods()       { atomic_set_bits(JVM_ACC_HAS_MIRANDA_METHODS);     }
 216 
 217  public:
 218   // field flags
 219   void set_is_field_access_watched(const bool value)
 220                                        {
 221                                          if (value) {
 222                                            atomic_set_bits(JVM_ACC_FIELD_ACCESS_WATCHED);
 223                                          } else {
 224                                            atomic_clear_bits(JVM_ACC_FIELD_ACCESS_WATCHED);
 225                                          }
 226                                        }
 227   void set_is_field_modification_watched(const bool value)
 228                                        {
 229                                          if (value) {
 230                                            atomic_set_bits(JVM_ACC_FIELD_MODIFICATION_WATCHED);
 231                                          } else {
 232                                            atomic_clear_bits(JVM_ACC_FIELD_MODIFICATION_WATCHED);
 233                                          }
 234                                        }









 235   void set_field_has_generic_signature()
 236                                        {
 237                                          atomic_set_bits(JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE);
 238                                        }
 239 
 240   void set_on_stack(const bool value)
 241                                        {
 242                                          if (value) {
 243                                            atomic_set_bits(JVM_ACC_ON_STACK);
 244                                          } else {
 245                                            atomic_clear_bits(JVM_ACC_ON_STACK);
 246                                          }
 247                                        }
 248   // Conversion
 249   jshort as_short() const              { return (jshort)_flags; }
 250   jint   as_int() const                { return _flags; }
 251 
 252   inline friend AccessFlags accessFlags_from(jint flags);
 253 
 254   // Printing/debugging


  63   JVM_ACC_HAS_VANILLA_CONSTRUCTOR = 0x20000000,     // True if klass has a vanilla default constructor
  64   JVM_ACC_HAS_FINALIZER           = 0x40000000,     // True if klass has a non-empty finalize() method
  65   JVM_ACC_IS_CLONEABLE_FAST       = (int)0x80000000,// True if klass implements the Cloneable interface and can be optimized in generated code
  66   JVM_ACC_HAS_FINAL_METHOD        = 0x01000000,     // True if klass has final method
  67 
  68   // Klass* and Method* flags
  69   JVM_ACC_HAS_LOCAL_VARIABLE_TABLE= 0x00200000,
  70 
  71   JVM_ACC_PROMOTED_FLAGS          = 0x00200000,     // flags promoted from methods to the holding klass
  72 
  73   // field flags
  74   // Note: these flags must be defined in the low order 16 bits because
  75   // InstanceKlass only stores a ushort worth of information from the
  76   // AccessFlags value.
  77   // These bits must not conflict with any other field-related access flags
  78   // (e.g., ACC_ENUM).
  79   // Note that the class-related ACC_ANNOTATION bit conflicts with these flags.
  80   JVM_ACC_FIELD_ACCESS_WATCHED            = 0x00002000, // field access is watched by JVMTI
  81   JVM_ACC_FIELD_MODIFICATION_WATCHED      = 0x00008000, // field modification is watched by JVMTI
  82   JVM_ACC_FIELD_INTERNAL                  = 0x00000400, // internal field, same as JVM_ACC_ABSTRACT
  83   JVM_ACC_FIELD_STABLE                    = 0x00000020, // @Stable field, same as JVM_ACC_SYNCHRONIZED and JVM_ACC_SUPER
  84   JVM_ACC_FIELD_INITIALIZED_FINAL_UPDATE  = 0x00000100, // (static) final field updated outside (class) initializer, same as JVM_ACC_NATIVE
  85   JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE     = 0x00000800, // field has generic signature
  86 
  87   JVM_ACC_FIELD_INTERNAL_FLAGS       = JVM_ACC_FIELD_ACCESS_WATCHED |
  88                                        JVM_ACC_FIELD_MODIFICATION_WATCHED |
  89                                        JVM_ACC_FIELD_INTERNAL |
  90                                        JVM_ACC_FIELD_STABLE |
  91                                        JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE,
  92 
  93                                                     // flags accepted by set_field_flags()
  94   JVM_ACC_FIELD_FLAGS                = JVM_RECOGNIZED_FIELD_MODIFIERS | JVM_ACC_FIELD_INTERNAL_FLAGS
  95 
  96 };
  97 
  98 
  99 class AccessFlags VALUE_OBJ_CLASS_SPEC {
 100   friend class VMStructs;
 101  private:
 102   jint _flags;
 103 
 104  public:


 138   bool is_old                  () const { return (_flags & JVM_ACC_IS_OLD                 ) != 0; }
 139   bool is_obsolete             () const { return (_flags & JVM_ACC_IS_OBSOLETE            ) != 0; }
 140   bool is_deleted              () const { return (_flags & JVM_ACC_IS_DELETED             ) != 0; }
 141   bool is_prefixed_native      () const { return (_flags & JVM_ACC_IS_PREFIXED_NATIVE     ) != 0; }
 142 
 143   // Klass* flags
 144   bool has_miranda_methods     () const { return (_flags & JVM_ACC_HAS_MIRANDA_METHODS    ) != 0; }
 145   bool has_vanilla_constructor () const { return (_flags & JVM_ACC_HAS_VANILLA_CONSTRUCTOR) != 0; }
 146   bool has_finalizer           () const { return (_flags & JVM_ACC_HAS_FINALIZER          ) != 0; }
 147   bool has_final_method        () const { return (_flags & JVM_ACC_HAS_FINAL_METHOD       ) != 0; }
 148   bool is_cloneable_fast       () const { return (_flags & JVM_ACC_IS_CLONEABLE_FAST      ) != 0; }
 149   // Klass* and Method* flags
 150   bool has_localvariable_table () const { return (_flags & JVM_ACC_HAS_LOCAL_VARIABLE_TABLE) != 0; }
 151   void set_has_localvariable_table()    { atomic_set_bits(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE); }
 152   void clear_has_localvariable_table()  { atomic_clear_bits(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE); }
 153 
 154   // field flags
 155   bool is_field_access_watched() const  { return (_flags & JVM_ACC_FIELD_ACCESS_WATCHED) != 0; }
 156   bool is_field_modification_watched() const
 157                                         { return (_flags & JVM_ACC_FIELD_MODIFICATION_WATCHED) != 0; }
 158   bool has_field_initialized_final_update() const
 159                                         { return (_flags & JVM_ACC_FIELD_INITIALIZED_FINAL_UPDATE) != 0; }
 160   bool on_stack() const                 { return (_flags & JVM_ACC_ON_STACK) != 0; }
 161   bool is_internal() const              { return (_flags & JVM_ACC_FIELD_INTERNAL) != 0; }
 162   bool is_stable() const                { return (_flags & JVM_ACC_FIELD_STABLE) != 0; }
 163   bool field_has_generic_signature() const
 164                                         { return (_flags & JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE) != 0; }
 165 
 166   // get .class file flags
 167   jint get_flags               () const { return (_flags & JVM_ACC_WRITTEN_FLAGS); }
 168 
 169   // Initialization
 170   void add_promoted_flags(jint flags)   { _flags |= (flags & JVM_ACC_PROMOTED_FLAGS); }
 171   void set_field_flags(jint flags)      {
 172     assert((flags & JVM_ACC_FIELD_FLAGS) == flags, "only recognized flags");
 173     _flags = (flags & JVM_ACC_FIELD_FLAGS);
 174   }
 175   void set_flags(jint flags)            { _flags = (flags & JVM_ACC_WRITTEN_FLAGS); }
 176 
 177   void set_queued_for_compilation()    { atomic_set_bits(JVM_ACC_QUEUED); }
 178   void clear_queued_for_compilation()  { atomic_clear_bits(JVM_ACC_QUEUED); }
 179 


 218   void set_has_miranda_methods()       { atomic_set_bits(JVM_ACC_HAS_MIRANDA_METHODS);     }
 219 
 220  public:
 221   // field flags
 222   void set_is_field_access_watched(const bool value)
 223                                        {
 224                                          if (value) {
 225                                            atomic_set_bits(JVM_ACC_FIELD_ACCESS_WATCHED);
 226                                          } else {
 227                                            atomic_clear_bits(JVM_ACC_FIELD_ACCESS_WATCHED);
 228                                          }
 229                                        }
 230   void set_is_field_modification_watched(const bool value)
 231                                        {
 232                                          if (value) {
 233                                            atomic_set_bits(JVM_ACC_FIELD_MODIFICATION_WATCHED);
 234                                          } else {
 235                                            atomic_clear_bits(JVM_ACC_FIELD_MODIFICATION_WATCHED);
 236                                          }
 237                                        }
 238 
 239   void set_has_field_initialized_final_update(const bool value) {
 240     if (value) {
 241       atomic_set_bits(JVM_ACC_FIELD_INITIALIZED_FINAL_UPDATE);
 242     } else {
 243       atomic_clear_bits(JVM_ACC_FIELD_INITIALIZED_FINAL_UPDATE);
 244     }
 245   }
 246 
 247   void set_field_has_generic_signature()
 248                                        {
 249                                          atomic_set_bits(JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE);
 250                                        }
 251 
 252   void set_on_stack(const bool value)
 253                                        {
 254                                          if (value) {
 255                                            atomic_set_bits(JVM_ACC_ON_STACK);
 256                                          } else {
 257                                            atomic_clear_bits(JVM_ACC_ON_STACK);
 258                                          }
 259                                        }
 260   // Conversion
 261   jshort as_short() const              { return (jshort)_flags; }
 262   jint   as_int() const                { return _flags; }
 263 
 264   inline friend AccessFlags accessFlags_from(jint flags);
 265 
 266   // Printing/debugging
src/share/vm/utilities/accessFlags.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File