src/share/vm/utilities/accessFlags.hpp

changeset 4037
da91efe96a93
parent 3969
1d7922586cf6
child 4111
9191895df19d
     1.1 --- a/src/share/vm/utilities/accessFlags.hpp	Fri Aug 31 16:39:35 2012 -0700
     1.2 +++ b/src/share/vm/utilities/accessFlags.hpp	Sat Sep 01 13:25:18 2012 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -39,7 +39,7 @@
    1.11    // flags actually put in .class file
    1.12    JVM_ACC_WRITTEN_FLAGS           = 0x00007FFF,
    1.13  
    1.14 -  // methodOop flags
    1.15 +  // Method* flags
    1.16    JVM_ACC_MONITOR_MATCH           = 0x10000000,     // True if we know that monitorenter/monitorexit bytecodes match
    1.17    JVM_ACC_HAS_MONITOR_BYTECODES   = 0x20000000,     // Method contains monitorenter/monitorexit bytecodes
    1.18    JVM_ACC_HAS_LOOPS               = 0x40000000,     // Method has loops
    1.19 @@ -54,22 +54,23 @@
    1.20    JVM_ACC_IS_OLD                  = 0x00010000,     // RedefineClasses() has replaced this method
    1.21    JVM_ACC_IS_OBSOLETE             = 0x00020000,     // RedefineClasses() has made method obsolete
    1.22    JVM_ACC_IS_PREFIXED_NATIVE      = 0x00040000,     // JVMTI has prefixed this native method
    1.23 +  JVM_ACC_ON_STACK                = 0x00080000,     // RedefinedClasses() is used on the stack
    1.24  
    1.25 -  // klassOop flags
    1.26 +  // Klass* flags
    1.27    JVM_ACC_HAS_MIRANDA_METHODS     = 0x10000000,     // True if this class has miranda methods in it's vtable
    1.28    JVM_ACC_HAS_VANILLA_CONSTRUCTOR = 0x20000000,     // True if klass has a vanilla default constructor
    1.29    JVM_ACC_HAS_FINALIZER           = 0x40000000,     // True if klass has a non-empty finalize() method
    1.30    JVM_ACC_IS_CLONEABLE            = (int)0x80000000,// True if klass supports the Clonable interface
    1.31    JVM_ACC_HAS_FINAL_METHOD        = 0x01000000,     // True if klass has final method
    1.32  
    1.33 -  // klassOop and methodOop flags
    1.34 +  // Klass* and Method* flags
    1.35    JVM_ACC_HAS_LOCAL_VARIABLE_TABLE= 0x00200000,
    1.36  
    1.37    JVM_ACC_PROMOTED_FLAGS          = 0x00200000,     // flags promoted from methods to the holding klass
    1.38  
    1.39    // field flags
    1.40    // Note: these flags must be defined in the low order 16 bits because
    1.41 -  // instanceKlass only stores a ushort worth of information from the
    1.42 +  // InstanceKlass only stores a ushort worth of information from the
    1.43    // AccessFlags value.
    1.44    // These bits must not conflict with any other field-related access flags
    1.45    // (e.g., ACC_ENUM).
    1.46 @@ -114,7 +115,7 @@
    1.47    // Attribute flags
    1.48    bool is_synthetic   () const         { return (_flags & JVM_ACC_SYNTHETIC   ) != 0; }
    1.49  
    1.50 -  // methodOop flags
    1.51 +  // Method* flags
    1.52    bool is_monitor_matching     () const { return (_flags & JVM_ACC_MONITOR_MATCH          ) != 0; }
    1.53    bool has_monitor_bytecodes   () const { return (_flags & JVM_ACC_HAS_MONITOR_BYTECODES  ) != 0; }
    1.54    bool has_loops               () const { return (_flags & JVM_ACC_HAS_LOOPS              ) != 0; }
    1.55 @@ -130,13 +131,13 @@
    1.56    bool is_obsolete             () const { return (_flags & JVM_ACC_IS_OBSOLETE            ) != 0; }
    1.57    bool is_prefixed_native      () const { return (_flags & JVM_ACC_IS_PREFIXED_NATIVE     ) != 0; }
    1.58  
    1.59 -  // klassOop flags
    1.60 +  // Klass* flags
    1.61    bool has_miranda_methods     () const { return (_flags & JVM_ACC_HAS_MIRANDA_METHODS    ) != 0; }
    1.62    bool has_vanilla_constructor () const { return (_flags & JVM_ACC_HAS_VANILLA_CONSTRUCTOR) != 0; }
    1.63    bool has_finalizer           () const { return (_flags & JVM_ACC_HAS_FINALIZER          ) != 0; }
    1.64    bool has_final_method        () const { return (_flags & JVM_ACC_HAS_FINAL_METHOD       ) != 0; }
    1.65    bool is_cloneable            () const { return (_flags & JVM_ACC_IS_CLONEABLE           ) != 0; }
    1.66 -  // klassOop and methodOop flags
    1.67 +  // Klass* and Method* flags
    1.68    bool has_localvariable_table () const { return (_flags & JVM_ACC_HAS_LOCAL_VARIABLE_TABLE) != 0; }
    1.69    void set_has_localvariable_table()    { atomic_set_bits(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE); }
    1.70    void clear_has_localvariable_table()  { atomic_clear_bits(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE); }
    1.71 @@ -145,6 +146,7 @@
    1.72    bool is_field_access_watched() const  { return (_flags & JVM_ACC_FIELD_ACCESS_WATCHED) != 0; }
    1.73    bool is_field_modification_watched() const
    1.74                                          { return (_flags & JVM_ACC_FIELD_MODIFICATION_WATCHED) != 0; }
    1.75 +  bool on_stack() const                 { return (_flags & JVM_ACC_ON_STACK) != 0; }
    1.76    bool is_internal() const              { return (_flags & JVM_ACC_FIELD_INTERNAL) != 0; }
    1.77    bool field_has_generic_signature() const
    1.78                                          { return (_flags & JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE) != 0; }
    1.79 @@ -168,7 +170,7 @@
    1.80    void atomic_clear_bits(jint bits);
    1.81  
    1.82   private:
    1.83 -  friend class methodOopDesc;
    1.84 +  friend class Method;
    1.85    friend class Klass;
    1.86    friend class ClassFileParser;
    1.87    // the functions below should only be called on the _access_flags inst var directly,
    1.88 @@ -177,7 +179,7 @@
    1.89    // attribute flags
    1.90    void set_is_synthetic()              { atomic_set_bits(JVM_ACC_SYNTHETIC);               }
    1.91  
    1.92 -  // methodOop flags
    1.93 +  // Method* flags
    1.94    void set_monitor_matching()          { atomic_set_bits(JVM_ACC_MONITOR_MATCH);           }
    1.95    void set_has_monitor_bytecodes()     { atomic_set_bits(JVM_ACC_HAS_MONITOR_BYTECODES);   }
    1.96    void set_has_loops()                 { atomic_set_bits(JVM_ACC_HAS_LOOPS);               }
    1.97 @@ -192,7 +194,7 @@
    1.98    void set_is_obsolete()               { atomic_set_bits(JVM_ACC_IS_OBSOLETE);             }
    1.99    void set_is_prefixed_native()        { atomic_set_bits(JVM_ACC_IS_PREFIXED_NATIVE);      }
   1.100  
   1.101 -  // klassOop flags
   1.102 +  // Klass* flags
   1.103    void set_has_vanilla_constructor()   { atomic_set_bits(JVM_ACC_HAS_VANILLA_CONSTRUCTOR); }
   1.104    void set_has_finalizer()             { atomic_set_bits(JVM_ACC_HAS_FINALIZER);           }
   1.105    void set_has_final_method()          { atomic_set_bits(JVM_ACC_HAS_FINAL_METHOD);        }
   1.106 @@ -222,6 +224,14 @@
   1.107                                           atomic_set_bits(JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE);
   1.108                                         }
   1.109  
   1.110 +  void set_on_stack(const bool value)
   1.111 +                                       {
   1.112 +                                         if (value) {
   1.113 +                                           atomic_set_bits(JVM_ACC_ON_STACK);
   1.114 +                                         } else {
   1.115 +                                           atomic_clear_bits(JVM_ACC_ON_STACK);
   1.116 +                                         }
   1.117 +                                       }
   1.118    // Conversion
   1.119    jshort as_short() const              { return (jshort)_flags; }
   1.120    jint   as_int() const                { return _flags; }

mercurial