6879572: SA fails _is_marked_dependent not found
authoracorn
Wed, 16 Sep 2009 15:42:46 -0400
changeset 3822 388b0393a042
parent 3821 847fddcb639b
child 3823 f23dbaf46839
child 3824 86e9e4b25bdf
6879572: SA fails _is_marked_dependent not found Reviewed-by: kamg, dcubed
hotspot/src/share/vm/classfile/classFileParser.cpp
hotspot/src/share/vm/code/dependencies.cpp
hotspot/src/share/vm/oops/instanceKlass.hpp
hotspot/src/share/vm/oops/instanceKlassKlass.cpp
hotspot/src/share/vm/runtime/vmStructs.cpp
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Wed Sep 16 09:10:57 2009 -0400
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Wed Sep 16 15:42:46 2009 -0400
@@ -3211,9 +3211,7 @@
 
     // Fill in information already parsed
     this_klass->set_access_flags(access_flags);
-    if (verify) {
-      this_klass->set_should_verify_class();
-    }
+    this_klass->set_should_verify_class(verify);
     jint lh = Klass::instance_layout_helper(instance_size, false);
     this_klass->set_layout_helper(lh);
     assert(this_klass->oop_is_instance(), "layout is correct");
@@ -3222,9 +3220,7 @@
     //this_klass->set_super(super_klass());
     this_klass->set_class_loader(class_loader());
     this_klass->set_nonstatic_field_size(nonstatic_field_size);
-    if (has_nonstatic_fields) {
-       this_klass->set_has_nonstatic_fields();
-    }
+    this_klass->set_has_nonstatic_fields(has_nonstatic_fields);
     this_klass->set_static_oop_field_size(fac.static_oop_count);
     cp->set_pool_holder(this_klass());
     this_klass->set_constants(cp());
--- a/hotspot/src/share/vm/code/dependencies.cpp	Wed Sep 16 09:10:57 2009 -0400
+++ b/hotspot/src/share/vm/code/dependencies.cpp	Wed Sep 16 15:42:46 2009 -0400
@@ -1464,7 +1464,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);
   }
 }
 
@@ -1473,7 +1473,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);
   }
 }
 
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp	Wed Sep 16 09:10:57 2009 -0400
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp	Wed Sep 16 15:42:46 2009 -0400
@@ -136,15 +136,6 @@
     initialization_error                // error happened during initialization
   };
 
-  // smaller footprint for boolean flags
-  enum ClassFlags {
-    _noflags           = 0,             // initial value
-    _rewritten         = 0x00000001U,   // rewritten
-    _should_verify     = 0x00000002U,   // defineClass specified conditional verification
-    _has_nonstatic_fields = 0x00000004U, // for sizing with UseCompressedOops
-    _is_marked_dependent = 0x00000008U  // used for marking during flushing and deoptimization
-   };
-
  public:
   oop* oop_block_beg() const { return adr_array_klasses(); }
   oop* oop_block_end() const { return adr_methods_default_annotations() + 1; }
@@ -223,7 +214,10 @@
   int             _static_field_size;    // number words used by static fields (oop and non-oop) in this klass
   int             _static_oop_field_size;// number of static oop fields in this klass
   int             _nonstatic_oop_map_size;// size in words of nonstatic oop map blocks
-  int             _class_flags;          // internal class state flags
+  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
   ClassState      _init_state;           // state of class
@@ -259,8 +253,8 @@
   friend class SystemDictionary;
 
  public:
-  bool has_nonstatic_fields() const        { return (_class_flags & _has_nonstatic_fields) != 0; }
-  void set_has_nonstatic_fields()          { _class_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; }
@@ -367,16 +361,15 @@
   bool is_in_error_state() const           { return _init_state == initialization_error; }
   bool is_reentrant_initialization(Thread *thread)  { return thread == _init_thread; }
   int  get_init_state()                    { return _init_state; } // Useful for debugging
-  bool is_rewritten() const                { return (_class_flags & _rewritten) != 0; }
+  bool is_rewritten() const                { return _rewritten; }
 
   // defineClass specified verification
-  bool should_verify_class() const         { return (_class_flags & _should_verify) != 0; }
-  void set_should_verify_class()           { _class_flags |= _should_verify; }
+  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 (_class_flags & _is_marked_dependent) != 0; }
-  void set_is_marked_dependent()           { _class_flags |= _is_marked_dependent; }
-  void clear_is_marked_dependent()         { _class_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
@@ -757,8 +750,7 @@
 #else
   void set_init_state(ClassState state) { _init_state = state; }
 #endif
-  void clear_class_flags()              { _class_flags = _noflags; }
-  void set_rewritten()                  { _class_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; }
--- a/hotspot/src/share/vm/oops/instanceKlassKlass.cpp	Wed Sep 16 09:10:57 2009 -0400
+++ b/hotspot/src/share/vm/oops/instanceKlassKlass.cpp	Wed Sep 16 15:42:46 2009 -0400
@@ -455,9 +455,9 @@
     ik->set_inner_classes(NULL);
     ik->set_static_oop_field_size(0);
     ik->set_nonstatic_field_size(0);
+    ik->set_is_marked_dependent(false);
     ik->set_init_state(instanceKlass::allocated);
     ik->set_init_thread(NULL);
-    ik->clear_class_flags();
     ik->set_reference_type(rt);
     ik->set_oop_map_cache(NULL);
     ik->set_jni_ids(NULL);
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Sep 16 09:10:57 2009 -0400
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Sep 16 15:42:46 2009 -0400
@@ -108,7 +108,7 @@
   nonstatic_field(instanceKlass,               _static_field_size,                            int)                                   \
   nonstatic_field(instanceKlass,               _static_oop_field_size,                        int)                                   \
   nonstatic_field(instanceKlass,               _nonstatic_oop_map_size,                       int)                                   \
-  nonstatic_field(instanceKlass,               _class_flags,                                  int)                                   \
+  nonstatic_field(instanceKlass,               _is_marked_dependent,                          bool)                                  \
   nonstatic_field(instanceKlass,               _minor_version,                                u2)                                    \
   nonstatic_field(instanceKlass,               _major_version,                                u2)                                    \
   nonstatic_field(instanceKlass,               _init_state,                                   instanceKlass::ClassState)             \
@@ -1245,7 +1245,6 @@
    declare_integer_type(Bytecodes::Code)                                  \
    declare_integer_type(Generation::Name)                                 \
    declare_integer_type(instanceKlass::ClassState)                        \
-   declare_integer_type(instanceKlass::ClassFlags)                        \
    declare_integer_type(JavaThreadState)                                  \
    declare_integer_type(Location::Type)                                   \
    declare_integer_type(Location::Where)                                  \
@@ -1527,16 +1526,6 @@
   declare_constant(instanceKlass::initialization_error)                   \
                                                                           \
   /*********************************/                                     \
-  /* instanceKlass ClassFlags enum */                                     \
-  /*********************************/                                     \
-                                                                          \
-  declare_constant(instanceKlass::_noflags)                               \
-  declare_constant(instanceKlass::_rewritten)                             \
-  declare_constant(instanceKlass::_should_verify)                         \
-  declare_constant(instanceKlass::_has_nonstatic_fields)                  \
-  declare_constant(instanceKlass::_is_marked_dependent)                   \
-                                                                          \
-  /*********************************/                                     \
   /* symbolOop - symbol max length */                                     \
   /*********************************/                                     \
                                                                           \