# HG changeset patch # User dcubed # Date 1326340474 28800 # Node ID 8f8b94305aff781769ace0325edba2b4e790ad31 # Parent 22cee0ee8927f86322bcfd76e1642b6f0d576e0d 7129240: backout fix for 7102776 until 7128770 is resolved Reviewed-by: phh, bobv, coleenp, dcubed Contributed-by: Jiangli Zhou diff -r 22cee0ee8927 -r 8f8b94305aff agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java --- a/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java Fri Jan 06 20:09:20 2012 -0800 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java Wed Jan 11 19:54:34 2012 -0800 @@ -63,8 +63,6 @@ private static int CLASS_STATE_FULLY_INITIALIZED; private static int CLASS_STATE_INITIALIZATION_ERROR; - private static int IS_MARKED_DEPENDENT_MASK; - private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { Type type = db.lookupType("instanceKlass"); arrayKlasses = new OopField(type.getOopField("_array_klasses"), Oop.getHeaderSize()); @@ -92,7 +90,7 @@ staticFieldSize = new CIntField(type.getCIntegerField("_static_field_size"), Oop.getHeaderSize()); staticOopFieldCount = new CIntField(type.getCIntegerField("_static_oop_field_count"), Oop.getHeaderSize()); nonstaticOopMapSize = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), Oop.getHeaderSize()); - miscFlags = new CIntField(type.getCIntegerField("_misc_flags"), Oop.getHeaderSize()); + isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), Oop.getHeaderSize()); initState = new CIntField(type.getCIntegerField("_init_state"), Oop.getHeaderSize()); vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), Oop.getHeaderSize()); itableLen = new CIntField(type.getCIntegerField("_itable_len"), Oop.getHeaderSize()); @@ -120,8 +118,6 @@ CLASS_STATE_FULLY_INITIALIZED = db.lookupIntConstant("instanceKlass::fully_initialized").intValue(); CLASS_STATE_INITIALIZATION_ERROR = db.lookupIntConstant("instanceKlass::initialization_error").intValue(); - IS_MARKED_DEPENDENT_MASK = db.lookupIntConstant("instanceKlass::IS_MARKED_DEPENDENT").intValue(); - } InstanceKlass(OopHandle handle, ObjectHeap heap) { @@ -155,7 +151,7 @@ private static CIntField staticFieldSize; private static CIntField staticOopFieldCount; private static CIntField nonstaticOopMapSize; - private static CIntField miscFlags; + private static CIntField isMarkedDependent; private static CIntField initState; private static CIntField vtableLen; private static CIntField itableLen; @@ -337,7 +333,7 @@ public long getNonstaticFieldSize() { return nonstaticFieldSize.getValue(this); } public long getStaticOopFieldCount() { return staticOopFieldCount.getValue(this); } public long getNonstaticOopMapSize() { return nonstaticOopMapSize.getValue(this); } - public boolean getIsMarkedDependent() { return (miscFlags.getValue(this) & IS_MARKED_DEPENDENT_MASK) != 0; } + public boolean getIsMarkedDependent() { return isMarkedDependent.getValue(this) != 0; } public long getVtableLen() { return vtableLen.getValue(this); } public long getItableLen() { return itableLen.getValue(this); } public Symbol getGenericSignature() { return getSymbol(genericSignature); } @@ -528,7 +524,7 @@ visitor.doCInt(staticFieldSize, true); visitor.doCInt(staticOopFieldCount, true); visitor.doCInt(nonstaticOopMapSize, true); - visitor.doCInt(miscFlags, true); + visitor.doCInt(isMarkedDependent, true); visitor.doCInt(initState, true); visitor.doCInt(vtableLen, true); visitor.doCInt(itableLen, true); diff -r 22cee0ee8927 -r 8f8b94305aff src/share/vm/code/dependencies.cpp --- a/src/share/vm/code/dependencies.cpp Fri Jan 06 20:09:20 2012 -0800 +++ b/src/share/vm/code/dependencies.cpp Wed Jan 11 19:54:34 2012 -0800 @@ -1631,7 +1631,7 @@ for (ContextStream str(*this); str.next(); ) { klassOop d = str.klass(); assert(!instanceKlass::cast(d)->is_marked_dependent(), "checking"); - instanceKlass::cast(d)->set_is_marked_dependent(); + instanceKlass::cast(d)->set_is_marked_dependent(true); } } @@ -1640,7 +1640,7 @@ // Unmark transitive interfaces for (ContextStream str(*this); str.next(); ) { klassOop d = str.klass(); - instanceKlass::cast(d)->clear_is_marked_dependent(); + instanceKlass::cast(d)->set_is_marked_dependent(false); } } diff -r 22cee0ee8927 -r 8f8b94305aff src/share/vm/oops/instanceKlass.hpp --- a/src/share/vm/oops/instanceKlass.hpp Fri Jan 06 20:09:20 2012 -0800 +++ b/src/share/vm/oops/instanceKlass.hpp Wed Jan 11 19:54:34 2012 -0800 @@ -231,6 +231,10 @@ u2 _java_fields_count; // The number of declared Java fields int _nonstatic_oop_map_size;// size in words of nonstatic oop map blocks + bool _is_marked_dependent; // used for marking during flushing and deoptimization + bool _rewritten; // methods rewritten. + bool _has_nonstatic_fields; // for sizing with UseCompressedOops + bool _should_verify_class; // allow caching of preverification u2 _minor_version; // minor version number of class file u2 _major_version; // major version number of class file Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization) @@ -261,19 +265,6 @@ // _idnum_allocated_count. u1 _init_state; // state of class - // Compact the following four boolean flags into 1-bit each. These four flags - // were defined as separate boolean fields and each was 1-byte before. Since - // there are 2 bytes unused after the _idnum_allocated_count field, place the - // _misc_flags field after _idnum_allocated_count to utilize the unused bits - // and save total 4-bytes. - enum { - IS_MARKED_DEPENDENT = 0x1, // used for marking during flushing and deoptimization - REWRITTEN = 0x2, // methods rewritten. - HAS_NONSTATIC_FIELDS = 0x4, // for sizing with UseCompressedOops - SHOULD_VERIFY_CLASS = 0x8 // allow caching of preverification - }; - u1 _misc_flags; - // embedded Java vtable follows here // embedded Java itables follows here // embedded static fields follows here @@ -283,14 +274,8 @@ friend class SystemDictionary; public: - bool has_nonstatic_fields() const { return (_misc_flags & HAS_NONSTATIC_FIELDS) != 0; } - void set_has_nonstatic_fields(bool b) { - if (b) { - _misc_flags |= HAS_NONSTATIC_FIELDS; - } else { - _misc_flags &= ~HAS_NONSTATIC_FIELDS; - } - } + bool has_nonstatic_fields() const { return _has_nonstatic_fields; } + void set_has_nonstatic_fields(bool b) { _has_nonstatic_fields = b; } // field sizes int nonstatic_field_size() const { return _nonstatic_field_size; } @@ -398,23 +383,15 @@ bool is_in_error_state() const { return _init_state == initialization_error; } bool is_reentrant_initialization(Thread *thread) { return thread == _init_thread; } ClassState init_state() { return (ClassState)_init_state; } - bool is_rewritten() const { return (_misc_flags & REWRITTEN) != 0; } + bool is_rewritten() const { return _rewritten; } // defineClass specified verification - bool should_verify_class() const { return (_misc_flags & SHOULD_VERIFY_CLASS) != 0; } - void set_should_verify_class(bool value) { - if (value) { - _misc_flags |= SHOULD_VERIFY_CLASS; - } else { - _misc_flags &= ~SHOULD_VERIFY_CLASS; - } - } - + bool should_verify_class() const { return _should_verify_class; } + void set_should_verify_class(bool value) { _should_verify_class = value; } // marking - bool is_marked_dependent() const { return (_misc_flags & IS_MARKED_DEPENDENT) != 0; } - void set_is_marked_dependent() { _misc_flags |= IS_MARKED_DEPENDENT; } - void clear_is_marked_dependent() { _misc_flags &= ~IS_MARKED_DEPENDENT; } + bool is_marked_dependent() const { return _is_marked_dependent; } + void set_is_marked_dependent(bool value) { _is_marked_dependent = value; } // initialization (virtuals from Klass) bool should_be_initialized() const; // means that initialize should be called @@ -784,7 +761,7 @@ #else void set_init_state(ClassState state) { _init_state = (u1)state; } #endif - void set_rewritten() { _misc_flags |= REWRITTEN; } + void set_rewritten() { _rewritten = true; } void set_init_thread(Thread *thread) { _init_thread = thread; } u2 idnum_allocated_count() const { return _idnum_allocated_count; } diff -r 22cee0ee8927 -r 8f8b94305aff src/share/vm/oops/instanceKlassKlass.cpp --- a/src/share/vm/oops/instanceKlassKlass.cpp Fri Jan 06 20:09:20 2012 -0800 +++ b/src/share/vm/oops/instanceKlassKlass.cpp Wed Jan 11 19:54:34 2012 -0800 @@ -399,7 +399,7 @@ ik->set_inner_classes(NULL); ik->set_static_oop_field_count(0); ik->set_nonstatic_field_size(0); - ik->clear_is_marked_dependent(); + ik->set_is_marked_dependent(false); ik->set_init_state(instanceKlass::allocated); ik->set_init_thread(NULL); ik->set_reference_type(rt); diff -r 22cee0ee8927 -r 8f8b94305aff src/share/vm/runtime/vmStructs.cpp --- a/src/share/vm/runtime/vmStructs.cpp Fri Jan 06 20:09:20 2012 -0800 +++ b/src/share/vm/runtime/vmStructs.cpp Wed Jan 11 19:54:34 2012 -0800 @@ -307,7 +307,7 @@ nonstatic_field(instanceKlass, _static_field_size, int) \ nonstatic_field(instanceKlass, _static_oop_field_count, u2) \ nonstatic_field(instanceKlass, _nonstatic_oop_map_size, int) \ - nonstatic_field(instanceKlass, _misc_flags, u1) \ + nonstatic_field(instanceKlass, _is_marked_dependent, bool) \ nonstatic_field(instanceKlass, _minor_version, u2) \ nonstatic_field(instanceKlass, _major_version, u2) \ nonstatic_field(instanceKlass, _init_state, u1) \ @@ -2386,7 +2386,6 @@ declare_constant(instanceKlass::being_initialized) \ declare_constant(instanceKlass::fully_initialized) \ declare_constant(instanceKlass::initialization_error) \ - declare_constant(instanceKlass::IS_MARKED_DEPENDENT) \ \ /*********************************/ \ /* Symbol* - symbol max length */ \