Wed, 11 Jan 2012 19:54:34 -0800
7129240: backout fix for 7102776 until 7128770 is resolved
Reviewed-by: phh, bobv, coleenp, dcubed
Contributed-by: Jiangli Zhou <jiangli.zhou@oracle.com>
1.1 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java Fri Jan 06 20:09:20 2012 -0800 1.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java Wed Jan 11 19:54:34 2012 -0800 1.3 @@ -63,8 +63,6 @@ 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 @@ -92,7 +90,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 - miscFlags = new CIntField(type.getCIntegerField("_misc_flags"), Oop.getHeaderSize()); 1.17 + isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), 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 @@ -120,8 +118,6 @@ 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 @@ -155,7 +151,7 @@ 1.31 private static CIntField staticFieldSize; 1.32 private static CIntField staticOopFieldCount; 1.33 private static CIntField nonstaticOopMapSize; 1.34 - private static CIntField miscFlags; 1.35 + private static CIntField isMarkedDependent; 1.36 private static CIntField initState; 1.37 private static CIntField vtableLen; 1.38 private static CIntField itableLen; 1.39 @@ -337,7 +333,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 (miscFlags.getValue(this) & IS_MARKED_DEPENDENT_MASK) != 0; } 1.44 + public boolean getIsMarkedDependent() { return isMarkedDependent.getValue(this) != 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 @@ -528,7 +524,7 @@ 1.49 visitor.doCInt(staticFieldSize, true); 1.50 visitor.doCInt(staticOopFieldCount, true); 1.51 visitor.doCInt(nonstaticOopMapSize, true); 1.52 - visitor.doCInt(miscFlags, true); 1.53 + visitor.doCInt(isMarkedDependent, 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 Fri Jan 06 20:09:20 2012 -0800 2.2 +++ b/src/share/vm/code/dependencies.cpp Wed Jan 11 19:54:34 2012 -0800 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(); 2.8 + instanceKlass::cast(d)->set_is_marked_dependent(true); 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)->clear_is_marked_dependent(); 2.17 + instanceKlass::cast(d)->set_is_marked_dependent(false); 2.18 } 2.19 } 2.20
3.1 --- a/src/share/vm/oops/instanceKlass.hpp Fri Jan 06 20:09:20 2012 -0800 3.2 +++ b/src/share/vm/oops/instanceKlass.hpp Wed Jan 11 19:54:34 2012 -0800 3.3 @@ -231,6 +231,10 @@ 3.4 u2 _java_fields_count; // The number of declared Java fields 3.5 int _nonstatic_oop_map_size;// size in words of nonstatic oop map blocks 3.6 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 u2 _minor_version; // minor version number of class file 3.12 u2 _major_version; // major version number of class file 3.13 Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization) 3.14 @@ -261,19 +265,6 @@ 3.15 // _idnum_allocated_count. 3.16 u1 _init_state; // state of class 3.17 3.18 - // Compact the following four boolean flags into 1-bit each. These four flags 3.19 - // were defined as separate boolean fields and each was 1-byte before. Since 3.20 - // there are 2 bytes unused after the _idnum_allocated_count field, place the 3.21 - // _misc_flags field after _idnum_allocated_count to utilize the unused bits 3.22 - // and save total 4-bytes. 3.23 - enum { 3.24 - IS_MARKED_DEPENDENT = 0x1, // used for marking during flushing and deoptimization 3.25 - REWRITTEN = 0x2, // methods rewritten. 3.26 - HAS_NONSTATIC_FIELDS = 0x4, // for sizing with UseCompressedOops 3.27 - SHOULD_VERIFY_CLASS = 0x8 // allow caching of preverification 3.28 - }; 3.29 - u1 _misc_flags; 3.30 - 3.31 // embedded Java vtable follows here 3.32 // embedded Java itables follows here 3.33 // embedded static fields follows here 3.34 @@ -283,14 +274,8 @@ 3.35 friend class SystemDictionary; 3.36 3.37 public: 3.38 - bool has_nonstatic_fields() const { return (_misc_flags & HAS_NONSTATIC_FIELDS) != 0; } 3.39 - void set_has_nonstatic_fields(bool b) { 3.40 - if (b) { 3.41 - _misc_flags |= HAS_NONSTATIC_FIELDS; 3.42 - } else { 3.43 - _misc_flags &= ~HAS_NONSTATIC_FIELDS; 3.44 - } 3.45 - } 3.46 + bool has_nonstatic_fields() const { return _has_nonstatic_fields; } 3.47 + void set_has_nonstatic_fields(bool b) { _has_nonstatic_fields = b; } 3.48 3.49 // field sizes 3.50 int nonstatic_field_size() const { return _nonstatic_field_size; } 3.51 @@ -398,23 +383,15 @@ 3.52 bool is_in_error_state() const { return _init_state == initialization_error; } 3.53 bool is_reentrant_initialization(Thread *thread) { return thread == _init_thread; } 3.54 ClassState init_state() { return (ClassState)_init_state; } 3.55 - bool is_rewritten() const { return (_misc_flags & REWRITTEN) != 0; } 3.56 + bool is_rewritten() const { return _rewritten; } 3.57 3.58 // defineClass specified verification 3.59 - bool should_verify_class() const { return (_misc_flags & SHOULD_VERIFY_CLASS) != 0; } 3.60 - void set_should_verify_class(bool value) { 3.61 - if (value) { 3.62 - _misc_flags |= SHOULD_VERIFY_CLASS; 3.63 - } else { 3.64 - _misc_flags &= ~SHOULD_VERIFY_CLASS; 3.65 - } 3.66 - } 3.67 - 3.68 + bool should_verify_class() const { return _should_verify_class; } 3.69 + void set_should_verify_class(bool value) { _should_verify_class = value; } 3.70 3.71 // marking 3.72 - bool is_marked_dependent() const { return (_misc_flags & IS_MARKED_DEPENDENT) != 0; } 3.73 - void set_is_marked_dependent() { _misc_flags |= IS_MARKED_DEPENDENT; } 3.74 - void clear_is_marked_dependent() { _misc_flags &= ~IS_MARKED_DEPENDENT; } 3.75 + bool is_marked_dependent() const { return _is_marked_dependent; } 3.76 + void set_is_marked_dependent(bool value) { _is_marked_dependent = value; } 3.77 3.78 // initialization (virtuals from Klass) 3.79 bool should_be_initialized() const; // means that initialize should be called 3.80 @@ -784,7 +761,7 @@ 3.81 #else 3.82 void set_init_state(ClassState state) { _init_state = (u1)state; } 3.83 #endif 3.84 - void set_rewritten() { _misc_flags |= REWRITTEN; } 3.85 + void set_rewritten() { _rewritten = true; } 3.86 void set_init_thread(Thread *thread) { _init_thread = thread; } 3.87 3.88 u2 idnum_allocated_count() const { return _idnum_allocated_count; }
4.1 --- a/src/share/vm/oops/instanceKlassKlass.cpp Fri Jan 06 20:09:20 2012 -0800 4.2 +++ b/src/share/vm/oops/instanceKlassKlass.cpp Wed Jan 11 19:54:34 2012 -0800 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->clear_is_marked_dependent(); 4.8 + ik->set_is_marked_dependent(false); 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 Fri Jan 06 20:09:20 2012 -0800 5.2 +++ b/src/share/vm/runtime/vmStructs.cpp Wed Jan 11 19:54:34 2012 -0800 5.3 @@ -307,7 +307,7 @@ 5.4 nonstatic_field(instanceKlass, _static_field_size, int) \ 5.5 nonstatic_field(instanceKlass, _static_oop_field_count, u2) \ 5.6 nonstatic_field(instanceKlass, _nonstatic_oop_map_size, int) \ 5.7 - nonstatic_field(instanceKlass, _misc_flags, u1) \ 5.8 + nonstatic_field(instanceKlass, _is_marked_dependent, bool) \ 5.9 nonstatic_field(instanceKlass, _minor_version, u2) \ 5.10 nonstatic_field(instanceKlass, _major_version, u2) \ 5.11 nonstatic_field(instanceKlass, _init_state, u1) \ 5.12 @@ -2386,7 +2386,6 @@ 5.13 declare_constant(instanceKlass::being_initialized) \ 5.14 declare_constant(instanceKlass::fully_initialized) \ 5.15 declare_constant(instanceKlass::initialization_error) \ 5.16 - declare_constant(instanceKlass::IS_MARKED_DEPENDENT) \ 5.17 \ 5.18 /*********************************/ \ 5.19 /* Symbol* - symbol max length */ \