Merge

Tue, 29 Nov 2011 14:44:44 -0500

author
bobv
date
Tue, 29 Nov 2011 14:44:44 -0500
changeset 3367
da4dd142ea01
parent 3284
1d090cf33da6
parent 3366
75c0a73eee98
child 3368
52b5d32fbfaf

Merge

src/share/vm/code/dependencies.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java	Mon Nov 21 10:22:04 2011 -0500
     1.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java	Tue Nov 29 14:44:44 2011 -0500
     1.3 @@ -63,6 +63,8 @@
     1.4    private static int CLASS_STATE_FULLY_INITIALIZED;
     1.5    private static int CLASS_STATE_INITIALIZATION_ERROR;
     1.6  
     1.7 +  private static int IS_MARKED_DEPENDENT_MASK;
     1.8 +
     1.9    private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
    1.10      Type type            = db.lookupType("instanceKlass");
    1.11      arrayKlasses         = new OopField(type.getOopField("_array_klasses"), Oop.getHeaderSize());
    1.12 @@ -90,7 +92,7 @@
    1.13      staticFieldSize      = new CIntField(type.getCIntegerField("_static_field_size"), Oop.getHeaderSize());
    1.14      staticOopFieldCount   = new CIntField(type.getCIntegerField("_static_oop_field_count"), Oop.getHeaderSize());
    1.15      nonstaticOopMapSize  = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), Oop.getHeaderSize());
    1.16 -    isMarkedDependent    = new CIntField(type.getCIntegerField("_is_marked_dependent"), Oop.getHeaderSize());
    1.17 +    miscFlags            = new CIntField(type.getCIntegerField("_misc_flags"), Oop.getHeaderSize());
    1.18      initState            = new CIntField(type.getCIntegerField("_init_state"), Oop.getHeaderSize());
    1.19      vtableLen            = new CIntField(type.getCIntegerField("_vtable_len"), Oop.getHeaderSize());
    1.20      itableLen            = new CIntField(type.getCIntegerField("_itable_len"), Oop.getHeaderSize());
    1.21 @@ -118,6 +120,8 @@
    1.22      CLASS_STATE_FULLY_INITIALIZED = db.lookupIntConstant("instanceKlass::fully_initialized").intValue();
    1.23      CLASS_STATE_INITIALIZATION_ERROR = db.lookupIntConstant("instanceKlass::initialization_error").intValue();
    1.24  
    1.25 +    IS_MARKED_DEPENDENT_MASK = db.lookupIntConstant("instanceKlass::IS_MARKED_DEPENDENT").intValue();
    1.26 +
    1.27    }
    1.28  
    1.29    InstanceKlass(OopHandle handle, ObjectHeap heap) {
    1.30 @@ -151,7 +155,7 @@
    1.31    private static CIntField staticFieldSize;
    1.32    private static CIntField staticOopFieldCount;
    1.33    private static CIntField nonstaticOopMapSize;
    1.34 -  private static CIntField isMarkedDependent;
    1.35 +  private static CIntField miscFlags;
    1.36    private static CIntField initState;
    1.37    private static CIntField vtableLen;
    1.38    private static CIntField itableLen;
    1.39 @@ -333,7 +337,7 @@
    1.40    public long      getNonstaticFieldSize()  { return                nonstaticFieldSize.getValue(this); }
    1.41    public long      getStaticOopFieldCount() { return                staticOopFieldCount.getValue(this); }
    1.42    public long      getNonstaticOopMapSize() { return                nonstaticOopMapSize.getValue(this); }
    1.43 -  public boolean   getIsMarkedDependent()   { return                isMarkedDependent.getValue(this) != 0; }
    1.44 +  public boolean   getIsMarkedDependent()   { return                (miscFlags.getValue(this) & IS_MARKED_DEPENDENT_MASK) != 0; }
    1.45    public long      getVtableLen()           { return                vtableLen.getValue(this); }
    1.46    public long      getItableLen()           { return                itableLen.getValue(this); }
    1.47    public Symbol    getGenericSignature()    { return getSymbol(genericSignature); }
    1.48 @@ -524,7 +528,7 @@
    1.49        visitor.doCInt(staticFieldSize, true);
    1.50        visitor.doCInt(staticOopFieldCount, true);
    1.51        visitor.doCInt(nonstaticOopMapSize, true);
    1.52 -      visitor.doCInt(isMarkedDependent, true);
    1.53 +      visitor.doCInt(miscFlags, true);
    1.54        visitor.doCInt(initState, true);
    1.55        visitor.doCInt(vtableLen, true);
    1.56        visitor.doCInt(itableLen, true);
     2.1 --- a/src/share/vm/code/dependencies.cpp	Mon Nov 21 10:22:04 2011 -0500
     2.2 +++ b/src/share/vm/code/dependencies.cpp	Tue Nov 29 14:44:44 2011 -0500
     2.3 @@ -1631,7 +1631,7 @@
     2.4    for (ContextStream str(*this); str.next(); ) {
     2.5      klassOop d = str.klass();
     2.6      assert(!instanceKlass::cast(d)->is_marked_dependent(), "checking");
     2.7 -    instanceKlass::cast(d)->set_is_marked_dependent(true);
     2.8 +    instanceKlass::cast(d)->set_is_marked_dependent();
     2.9    }
    2.10  }
    2.11  
    2.12 @@ -1640,7 +1640,7 @@
    2.13    // Unmark transitive interfaces
    2.14    for (ContextStream str(*this); str.next(); ) {
    2.15      klassOop d = str.klass();
    2.16 -    instanceKlass::cast(d)->set_is_marked_dependent(false);
    2.17 +    instanceKlass::cast(d)->clear_is_marked_dependent();
    2.18    }
    2.19  }
    2.20  
     3.1 --- a/src/share/vm/oops/instanceKlass.hpp	Mon Nov 21 10:22:04 2011 -0500
     3.2 +++ b/src/share/vm/oops/instanceKlass.hpp	Tue Nov 29 14:44:44 2011 -0500
     3.3 @@ -230,10 +230,7 @@
     3.4    int             _static_oop_field_count;// number of static oop fields in this klass
     3.5    int             _nonstatic_oop_map_size;// size in words of nonstatic oop map blocks
     3.6    int             _java_fields_count;    // The number of declared Java fields
     3.7 -  bool            _is_marked_dependent;  // used for marking during flushing and deoptimization
     3.8 -  bool            _rewritten;            // methods rewritten.
     3.9 -  bool            _has_nonstatic_fields; // for sizing with UseCompressedOops
    3.10 -  bool            _should_verify_class;  // allow caching of preverification
    3.11 +
    3.12    u2              _minor_version;        // minor version number of class file
    3.13    u2              _major_version;        // major version number of class file
    3.14    ClassState      _init_state;           // state of class
    3.15 @@ -260,6 +257,19 @@
    3.16    JvmtiCachedClassFieldMap* _jvmti_cached_class_field_map;  // JVMTI: used during heap iteration
    3.17    volatile u2     _idnum_allocated_count;         // JNI/JVMTI: increments with the addition of methods, old ids don't change
    3.18  
    3.19 +  // Compact the following four boolean flags into 1-bit each.  These four flags
    3.20 +  // were defined as separate boolean fields and each was 1-byte before. Since
    3.21 +  // there are 2 bytes unused after the _idnum_allocated_count field, place the
    3.22 +  // _misc_flags field after _idnum_allocated_count to utilize the unused bits
    3.23 +  // and save total 4-bytes.
    3.24 +  enum {
    3.25 +    IS_MARKED_DEPENDENT  = 0x1, // used for marking during flushing and deoptimization
    3.26 +    REWRITTEN            = 0x2, // methods rewritten.
    3.27 +    HAS_NONSTATIC_FIELDS = 0x4, // for sizing with UseCompressedOops
    3.28 +    SHOULD_VERIFY_CLASS  = 0x8  // allow caching of preverification
    3.29 +  };
    3.30 +  u1              _misc_flags;
    3.31 +
    3.32    // embedded Java vtable follows here
    3.33    // embedded Java itables follows here
    3.34    // embedded static fields follows here
    3.35 @@ -269,8 +279,14 @@
    3.36    friend class SystemDictionary;
    3.37  
    3.38   public:
    3.39 -  bool has_nonstatic_fields() const        { return _has_nonstatic_fields; }
    3.40 -  void set_has_nonstatic_fields(bool b)    { _has_nonstatic_fields = b; }
    3.41 +  bool has_nonstatic_fields() const        { return (_misc_flags & HAS_NONSTATIC_FIELDS) != 0; }
    3.42 +  void set_has_nonstatic_fields(bool b) {
    3.43 +    if (b) {
    3.44 +      _misc_flags |= HAS_NONSTATIC_FIELDS;
    3.45 +    } else {
    3.46 +      _misc_flags &= ~HAS_NONSTATIC_FIELDS;
    3.47 +    }
    3.48 +  }
    3.49  
    3.50    // field sizes
    3.51    int nonstatic_field_size() const         { return _nonstatic_field_size; }
    3.52 @@ -378,15 +394,23 @@
    3.53    bool is_in_error_state() const           { return _init_state == initialization_error; }
    3.54    bool is_reentrant_initialization(Thread *thread)  { return thread == _init_thread; }
    3.55    int  get_init_state()                    { return _init_state; } // Useful for debugging
    3.56 -  bool is_rewritten() const                { return _rewritten; }
    3.57 +  bool is_rewritten() const                { return (_misc_flags & REWRITTEN) != 0; }
    3.58  
    3.59    // defineClass specified verification
    3.60 -  bool should_verify_class() const         { return _should_verify_class; }
    3.61 -  void set_should_verify_class(bool value) { _should_verify_class = value; }
    3.62 +  bool should_verify_class() const         { return (_misc_flags & SHOULD_VERIFY_CLASS) != 0; }
    3.63 +  void set_should_verify_class(bool value) {
    3.64 +    if (value) {
    3.65 +      _misc_flags |= SHOULD_VERIFY_CLASS;
    3.66 +    } else {
    3.67 +      _misc_flags &= ~SHOULD_VERIFY_CLASS;
    3.68 +    }
    3.69 +  }
    3.70 +
    3.71  
    3.72    // marking
    3.73 -  bool is_marked_dependent() const         { return _is_marked_dependent; }
    3.74 -  void set_is_marked_dependent(bool value) { _is_marked_dependent = value; }
    3.75 +  bool is_marked_dependent() const         { return (_misc_flags & IS_MARKED_DEPENDENT) != 0; }
    3.76 +  void set_is_marked_dependent()           { _misc_flags |= IS_MARKED_DEPENDENT; }
    3.77 +  void clear_is_marked_dependent()         { _misc_flags &= ~IS_MARKED_DEPENDENT; }
    3.78  
    3.79    // initialization (virtuals from Klass)
    3.80    bool should_be_initialized() const;  // means that initialize should be called
    3.81 @@ -756,7 +780,7 @@
    3.82  #else
    3.83    void set_init_state(ClassState state) { _init_state = state; }
    3.84  #endif
    3.85 -  void set_rewritten()                  { _rewritten = true; }
    3.86 +  void set_rewritten()                  { _misc_flags |= REWRITTEN; }
    3.87    void set_init_thread(Thread *thread)  { _init_thread = thread; }
    3.88  
    3.89    u2 idnum_allocated_count() const      { return _idnum_allocated_count; }
     4.1 --- a/src/share/vm/oops/instanceKlassKlass.cpp	Mon Nov 21 10:22:04 2011 -0500
     4.2 +++ b/src/share/vm/oops/instanceKlassKlass.cpp	Tue Nov 29 14:44:44 2011 -0500
     4.3 @@ -399,7 +399,7 @@
     4.4      ik->set_inner_classes(NULL);
     4.5      ik->set_static_oop_field_count(0);
     4.6      ik->set_nonstatic_field_size(0);
     4.7 -    ik->set_is_marked_dependent(false);
     4.8 +    ik->clear_is_marked_dependent();
     4.9      ik->set_init_state(instanceKlass::allocated);
    4.10      ik->set_init_thread(NULL);
    4.11      ik->set_reference_type(rt);
     5.1 --- a/src/share/vm/runtime/vmStructs.cpp	Mon Nov 21 10:22:04 2011 -0500
     5.2 +++ b/src/share/vm/runtime/vmStructs.cpp	Tue Nov 29 14:44:44 2011 -0500
     5.3 @@ -307,7 +307,7 @@
     5.4    nonstatic_field(instanceKlass,               _static_field_size,                            int)                                   \
     5.5    nonstatic_field(instanceKlass,               _static_oop_field_count,                       int)                                   \
     5.6    nonstatic_field(instanceKlass,               _nonstatic_oop_map_size,                       int)                                   \
     5.7 -  nonstatic_field(instanceKlass,               _is_marked_dependent,                          bool)                                  \
     5.8 +  nonstatic_field(instanceKlass,               _misc_flags,                                   u1)                                    \
     5.9    nonstatic_field(instanceKlass,               _minor_version,                                u2)                                    \
    5.10    nonstatic_field(instanceKlass,               _major_version,                                u2)                                    \
    5.11    nonstatic_field(instanceKlass,               _init_state,                                   instanceKlass::ClassState)             \
    5.12 @@ -1362,6 +1362,7 @@
    5.13    /* The compiler thinks this is a different type than */                 \
    5.14    /* unsigned short on Win32 */                                           \
    5.15    declare_unsigned_integer_type(u2)                                       \
    5.16 +  declare_unsigned_integer_type(u1)                                       \
    5.17    declare_unsigned_integer_type(unsigned)                                 \
    5.18                                                                            \
    5.19    /*****************************/                                         \
    5.20 @@ -2385,6 +2386,7 @@
    5.21    declare_constant(instanceKlass::being_initialized)                      \
    5.22    declare_constant(instanceKlass::fully_initialized)                      \
    5.23    declare_constant(instanceKlass::initialization_error)                   \
    5.24 +  declare_constant(instanceKlass::IS_MARKED_DEPENDENT)                    \
    5.25                                                                            \
    5.26    /*********************************/                                     \
    5.27    /* Symbol* - symbol max length */                                     \

mercurial