src/share/vm/oops/instanceKlass.hpp

changeset 4037
da91efe96a93
parent 3906
04ade88d9712
child 4245
4735d2c84362
     1.1 --- a/src/share/vm/oops/instanceKlass.hpp	Fri Aug 31 16:39:35 2012 -0700
     1.2 +++ b/src/share/vm/oops/instanceKlass.hpp	Sat Sep 01 13:25:18 2012 -0400
     1.3 @@ -25,24 +25,21 @@
     1.4  #ifndef SHARE_VM_OOPS_INSTANCEKLASS_HPP
     1.5  #define SHARE_VM_OOPS_INSTANCEKLASS_HPP
     1.6  
     1.7 -#include "oops/constMethodOop.hpp"
     1.8 -#include "oops/constantPoolOop.hpp"
     1.9 +#include "classfile/classLoaderData.hpp"
    1.10 +#include "oops/annotations.hpp"
    1.11 +#include "oops/constMethod.hpp"
    1.12  #include "oops/fieldInfo.hpp"
    1.13  #include "oops/instanceOop.hpp"
    1.14 -#include "oops/klassOop.hpp"
    1.15  #include "oops/klassVtable.hpp"
    1.16 -#include "oops/objArrayOop.hpp"
    1.17  #include "runtime/handles.hpp"
    1.18  #include "runtime/os.hpp"
    1.19  #include "utilities/accessFlags.hpp"
    1.20  #include "utilities/bitMap.inline.hpp"
    1.21  
    1.22 -// An instanceKlass is the VM level representation of a Java class.
    1.23 +// An InstanceKlass is the VM level representation of a Java class.
    1.24  // It contains all information needed for at class at execution runtime.
    1.25  
    1.26 -//  instanceKlass layout:
    1.27 -//    [header                     ] klassOop
    1.28 -//    [klass pointer              ] klassOop
    1.29 +//  InstanceKlass layout:
    1.30  //    [C++ vtbl pointer           ] Klass
    1.31  //    [subtype cache              ] Klass
    1.32  //    [instance size              ] Klass
    1.33 @@ -133,13 +130,37 @@
    1.34    uint _count;
    1.35  };
    1.36  
    1.37 -class instanceKlass: public Klass {
    1.38 +class InstanceKlass: public Klass {
    1.39    friend class VMStructs;
    1.40 +  friend class ClassFileParser;
    1.41 +
    1.42 + protected:
    1.43 +  // Constructor
    1.44 +  InstanceKlass(int vtable_len,
    1.45 +                int itable_len,
    1.46 +                int static_field_size,
    1.47 +                int nonstatic_oop_map_size,
    1.48 +                ReferenceType rt,
    1.49 +                AccessFlags access_flags,
    1.50 +                bool is_anonymous);
    1.51   public:
    1.52 +  static Klass* allocate_instance_klass(ClassLoaderData* loader_data,
    1.53 +                                          int vtable_len,
    1.54 +                                          int itable_len,
    1.55 +                                          int static_field_size,
    1.56 +                                          int nonstatic_oop_map_size,
    1.57 +                                          ReferenceType rt,
    1.58 +                                          AccessFlags access_flags,
    1.59 +                                          Symbol* name,
    1.60 +                                        Klass* super_klass,
    1.61 +                                          KlassHandle host_klass,
    1.62 +                                          TRAPS);
    1.63 +
    1.64 +  InstanceKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
    1.65 +
    1.66    // See "The Java Virtual Machine Specification" section 2.16.2-5 for a detailed description
    1.67    // of the class loading & initialization procedure, and the use of the states.
    1.68    enum ClassState {
    1.69 -    unparsable_by_gc = 0,               // object is not yet parsable by gc. Value of _init_state at object allocation.
    1.70      allocated,                          // allocated (but not yet linked)
    1.71      loaded,                             // loaded and inserted in class hierarchy (but not linked yet)
    1.72      linked,                             // successfully linked/verified (but not initialized yet)
    1.73 @@ -148,48 +169,22 @@
    1.74      initialization_error                // error happened during initialization
    1.75    };
    1.76  
    1.77 - public:
    1.78 -  oop* oop_block_beg() const { return adr_array_klasses(); }
    1.79 -  oop* oop_block_end() const { return adr_methods_default_annotations() + 1; }
    1.80 -
    1.81   protected:
    1.82 -  //
    1.83 -  // The oop block.  See comment in klass.hpp before making changes.
    1.84 -  //
    1.85 -
    1.86 -  // Array classes holding elements of this class.
    1.87 -  klassOop        _array_klasses;
    1.88 -  // Method array.
    1.89 -  objArrayOop     _methods;
    1.90 -  // Int array containing the original order of method in the class file (for
    1.91 -  // JVMTI).
    1.92 -  typeArrayOop    _method_ordering;
    1.93 -  // Interface (klassOops) this class declares locally to implement.
    1.94 -  objArrayOop     _local_interfaces;
    1.95 -  // Interface (klassOops) this class implements transitively.
    1.96 -  objArrayOop     _transitive_interfaces;
    1.97 -  // Instance and static variable information, starts with 6-tuples of shorts
    1.98 -  // [access, name index, sig index, initval index, low_offset, high_offset]
    1.99 -  // for all fields, followed by the generic signature data at the end of
   1.100 -  // the array. Only fields with generic signature attributes have the generic
   1.101 -  // signature data set in the array. The fields array looks like following:
   1.102 -  //
   1.103 -  // f1: [access, name index, sig index, initial value index, low_offset, high_offset]
   1.104 -  // f2: [access, name index, sig index, initial value index, low_offset, high_offset]
   1.105 -  //      ...
   1.106 -  // fn: [access, name index, sig index, initial value index, low_offset, high_offset]
   1.107 -  //     [generic signature index]
   1.108 -  //     [generic signature index]
   1.109 -  //     ...
   1.110 -  typeArrayOop    _fields;
   1.111 -  // Constant pool for this class.
   1.112 -  constantPoolOop _constants;
   1.113 -  // Class loader used to load this class, NULL if VM loader used.
   1.114 -  oop             _class_loader;
   1.115    // Protection domain.
   1.116    oop             _protection_domain;
   1.117    // Class signers.
   1.118    objArrayOop     _signers;
   1.119 +  // Initialization lock.  Must be one per class and it has to be a VM internal
   1.120 +  // object so java code cannot lock it (like the mirror)
   1.121 +  // It has to be an object not a Mutex because it's held through java calls.
   1.122 +  volatile oop    _init_lock;
   1.123 +
   1.124 +  // Annotations for this class
   1.125 +  Annotations*    _annotations;
   1.126 +  // Array classes holding elements of this class.
   1.127 +  Klass*          _array_klasses;
   1.128 +  // Constant pool for this class.
   1.129 +  ConstantPool* _constants;
   1.130    // The InnerClasses attribute and EnclosingMethod attribute. The
   1.131    // _inner_classes is an array of shorts. If the class has InnerClasses
   1.132    // attribute, then the _inner_classes array begins with 4-tuples of shorts
   1.133 @@ -201,27 +196,7 @@
   1.134    // number_of_inner_classes * 4. If the class has both InnerClasses
   1.135    // and EnclosingMethod attributes the _inner_classes array length is
   1.136    // number_of_inner_classes * 4 + enclosing_method_attribute_size.
   1.137 -  typeArrayOop    _inner_classes;
   1.138 -  // Annotations for this class, or null if none.
   1.139 -  typeArrayOop    _class_annotations;
   1.140 -  // Annotation objects (byte arrays) for fields, or null if no annotations.
   1.141 -  // Indices correspond to entries (not indices) in fields array.
   1.142 -  objArrayOop     _fields_annotations;
   1.143 -  // Annotation objects (byte arrays) for methods, or null if no annotations.
   1.144 -  // Index is the idnum, which is initially the same as the methods array index.
   1.145 -  objArrayOop     _methods_annotations;
   1.146 -  // Annotation objects (byte arrays) for methods' parameters, or null if no
   1.147 -  // such annotations.
   1.148 -  // Index is the idnum, which is initially the same as the methods array index.
   1.149 -  objArrayOop     _methods_parameter_annotations;
   1.150 -  // Annotation objects (byte arrays) for methods' default values, or null if no
   1.151 -  // such annotations.
   1.152 -  // Index is the idnum, which is initially the same as the methods array index.
   1.153 -  objArrayOop     _methods_default_annotations;
   1.154 -
   1.155 -  //
   1.156 -  // End of the oop block.
   1.157 -  //
   1.158 +  Array<jushort>* _inner_classes;
   1.159  
   1.160    // Name of source file containing this klass, NULL if not specified.
   1.161    Symbol*         _source_file_name;
   1.162 @@ -262,15 +237,37 @@
   1.163    int*            _methods_cached_itable_indices;  // itable_index cache for JNI invoke corresponding to methods idnum, or NULL
   1.164    nmethodBucket*  _dependencies;         // list of dependent nmethods
   1.165    nmethod*        _osr_nmethods_head;    // Head of list of on-stack replacement nmethods for this class
   1.166 -  BreakpointInfo* _breakpoints;          // bpt lists, managed by methodOop
   1.167 +  BreakpointInfo* _breakpoints;          // bpt lists, managed by Method*
   1.168    // Array of interesting part(s) of the previous version(s) of this
   1.169 -  // instanceKlass. See PreviousVersionWalker below.
   1.170 +  // InstanceKlass. See PreviousVersionWalker below.
   1.171    GrowableArray<PreviousVersionNode *>* _previous_versions;
   1.172    // JVMTI fields can be moved to their own structure - see 6315920
   1.173    unsigned char * _cached_class_file_bytes;       // JVMTI: cached class file, before retransformable agent modified it in CFLH
   1.174    jint            _cached_class_file_len;         // JVMTI: length of above
   1.175    JvmtiCachedClassFieldMap* _jvmti_cached_class_field_map;  // JVMTI: used during heap iteration
   1.176    volatile u2     _idnum_allocated_count;         // JNI/JVMTI: increments with the addition of methods, old ids don't change
   1.177 +  // Method array.
   1.178 +  Array<Method*>* _methods;
   1.179 +  // Interface (Klass*s) this class declares locally to implement.
   1.180 +  Array<Klass*>* _local_interfaces;
   1.181 +  // Interface (Klass*s) this class implements transitively.
   1.182 +  Array<Klass*>* _transitive_interfaces;
   1.183 +  // Int array containing the original order of method in the class file (for JVMTI).
   1.184 +  Array<int>*     _method_ordering;
   1.185 +  // Instance and static variable information, starts with 6-tuples of shorts
   1.186 +  // [access, name index, sig index, initval index, low_offset, high_offset]
   1.187 +  // for all fields, followed by the generic signature data at the end of
   1.188 +  // the array. Only fields with generic signature attributes have the generic
   1.189 +  // signature data set in the array. The fields array looks like following:
   1.190 +  //
   1.191 +  // f1: [access, name index, sig index, initial value index, low_offset, high_offset]
   1.192 +  // f2: [access, name index, sig index, initial value index, low_offset, high_offset]
   1.193 +  //      ...
   1.194 +  // fn: [access, name index, sig index, initial value index, low_offset, high_offset]
   1.195 +  //     [generic signature index]
   1.196 +  //     [generic signature index]
   1.197 +  //     ...
   1.198 +  Array<u2>*      _fields;
   1.199  
   1.200    // Class states are defined as ClassState (see above).
   1.201    // Place the _init_state here to utilize the unused 2-byte after
   1.202 @@ -288,7 +285,7 @@
   1.203    //   iterface. The possible values of the implementor fall into following
   1.204    //   three cases:
   1.205    //     NULL: no implementor.
   1.206 -  //     A klassOop that's not itself: one implementor.
   1.207 +  //     A Klass* that's not itself: one implementor.
   1.208    //     Itsef: more than one implementors.
   1.209    // embedded host klass follows here
   1.210    //   The embedded host klass only exists in an anonymous class for
   1.211 @@ -299,7 +296,6 @@
   1.212    //   have this embedded field.
   1.213    //
   1.214  
   1.215 -  friend class instanceKlassKlass;
   1.216    friend class SystemDictionary;
   1.217  
   1.218   public:
   1.219 @@ -333,23 +329,27 @@
   1.220    void set_itable_length(int len)          { _itable_len = len; }
   1.221  
   1.222    // array klasses
   1.223 -  klassOop array_klasses() const           { return _array_klasses; }
   1.224 -  void set_array_klasses(klassOop k)       { oop_store_without_check((oop*) &_array_klasses, (oop) k); }
   1.225 +  Klass* array_klasses() const             { return _array_klasses; }
   1.226 +  void set_array_klasses(Klass* k)         { _array_klasses = k; }
   1.227  
   1.228    // methods
   1.229 -  objArrayOop methods() const              { return _methods; }
   1.230 -  void set_methods(objArrayOop a)          { oop_store_without_check((oop*) &_methods, (oop) a); }
   1.231 -  methodOop method_with_idnum(int idnum);
   1.232 +  Array<Method*>* methods() const          { return _methods; }
   1.233 +  void set_methods(Array<Method*>* a)      { _methods = a; }
   1.234 +  Method* method_with_idnum(int idnum);
   1.235  
   1.236    // method ordering
   1.237 -  typeArrayOop method_ordering() const     { return _method_ordering; }
   1.238 -  void set_method_ordering(typeArrayOop m) { oop_store_without_check((oop*) &_method_ordering, (oop) m); }
   1.239 +  Array<int>* method_ordering() const     { return _method_ordering; }
   1.240 +  void set_method_ordering(Array<int>* m) { _method_ordering = m; }
   1.241  
   1.242    // interfaces
   1.243 -  objArrayOop local_interfaces() const          { return _local_interfaces; }
   1.244 -  void set_local_interfaces(objArrayOop a)      { oop_store_without_check((oop*) &_local_interfaces, (oop) a); }
   1.245 -  objArrayOop transitive_interfaces() const     { return _transitive_interfaces; }
   1.246 -  void set_transitive_interfaces(objArrayOop a) { oop_store_without_check((oop*) &_transitive_interfaces, (oop) a); }
   1.247 +  Array<Klass*>* local_interfaces() const          { return _local_interfaces; }
   1.248 +  void set_local_interfaces(Array<Klass*>* a)      {
   1.249 +    guarantee(_local_interfaces == NULL || a == NULL, "Just checking");
   1.250 +    _local_interfaces = a; }
   1.251 +  Array<Klass*>* transitive_interfaces() const     { return _transitive_interfaces; }
   1.252 +  void set_transitive_interfaces(Array<Klass*>* a) {
   1.253 +    guarantee(_transitive_interfaces == NULL || a == NULL, "Just checking");
   1.254 +    _transitive_interfaces = a; }
   1.255  
   1.256   private:
   1.257    friend class fieldDescriptor;
   1.258 @@ -364,16 +364,17 @@
   1.259    // Number of Java declared fields
   1.260    int java_fields_count() const           { return (int)_java_fields_count; }
   1.261  
   1.262 -  typeArrayOop fields() const              { return _fields; }
   1.263 +  Array<u2>* fields() const            { return _fields; }
   1.264  
   1.265 -  void set_fields(typeArrayOop f, u2 java_fields_count) {
   1.266 -    oop_store_without_check((oop*) &_fields, (oop) f);
   1.267 +  void set_fields(Array<u2>* f, u2 java_fields_count) {
   1.268 +    guarantee(_fields == NULL || f == NULL, "Just checking");
   1.269 +    _fields =  f;
   1.270      _java_fields_count = java_fields_count;
   1.271    }
   1.272  
   1.273    // inner classes
   1.274 -  typeArrayOop inner_classes() const       { return _inner_classes; }
   1.275 -  void set_inner_classes(typeArrayOop f)   { oop_store_without_check((oop*) &_inner_classes, (oop) f); }
   1.276 +  Array<u2>* inner_classes() const       { return _inner_classes; }
   1.277 +  void set_inner_classes(Array<u2>* f)   { _inner_classes = f; }
   1.278  
   1.279    enum InnerClassAttributeOffset {
   1.280      // From http://mirror.eng/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc10.html#18814
   1.281 @@ -394,25 +395,25 @@
   1.282    bool is_override(methodHandle super_method, Handle targetclassloader, Symbol* targetclassname, TRAPS);
   1.283  
   1.284    // package
   1.285 -  bool is_same_class_package(klassOop class2);
   1.286 +  bool is_same_class_package(Klass* class2);
   1.287    bool is_same_class_package(oop classloader2, Symbol* classname2);
   1.288    static bool is_same_class_package(oop class_loader1, Symbol* class_name1, oop class_loader2, Symbol* class_name2);
   1.289  
   1.290    // find an enclosing class (defined where original code was, in jvm.cpp!)
   1.291 -  klassOop compute_enclosing_class(bool* inner_is_member, TRAPS) {
   1.292 -    instanceKlassHandle self(THREAD, this->as_klassOop());
   1.293 +  Klass* compute_enclosing_class(bool* inner_is_member, TRAPS) {
   1.294 +    instanceKlassHandle self(THREAD, this);
   1.295      return compute_enclosing_class_impl(self, inner_is_member, THREAD);
   1.296    }
   1.297 -  static klassOop compute_enclosing_class_impl(instanceKlassHandle self,
   1.298 +  static Klass* compute_enclosing_class_impl(instanceKlassHandle self,
   1.299                                                 bool* inner_is_member, TRAPS);
   1.300  
   1.301    // tell if two classes have the same enclosing class (at package level)
   1.302 -  bool is_same_package_member(klassOop class2, TRAPS) {
   1.303 -    instanceKlassHandle self(THREAD, this->as_klassOop());
   1.304 +  bool is_same_package_member(Klass* class2, TRAPS) {
   1.305 +    instanceKlassHandle self(THREAD, this);
   1.306      return is_same_package_member_impl(self, class2, THREAD);
   1.307    }
   1.308    static bool is_same_package_member_impl(instanceKlassHandle self,
   1.309 -                                          klassOop class2, TRAPS);
   1.310 +                                          Klass* class2, TRAPS);
   1.311  
   1.312    // initialization state
   1.313    bool is_loaded() const                   { return _init_state >= loaded; }
   1.314 @@ -449,7 +450,7 @@
   1.315    void unlink_class();
   1.316    void rewrite_class(TRAPS);
   1.317    void relocate_and_link_methods(TRAPS);
   1.318 -  methodOop class_initializer();
   1.319 +  Method* class_initializer();
   1.320  
   1.321    // set the class to initialized if no static initializer is present
   1.322    void eager_initialize(Thread *thread);
   1.323 @@ -461,16 +462,16 @@
   1.324      _reference_type = (u1)t;
   1.325    }
   1.326  
   1.327 -  static ByteSize reference_type_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(instanceKlass, _reference_type)); }
   1.328 +  static ByteSize reference_type_offset() { return in_ByteSize(offset_of(InstanceKlass, _reference_type)); }
   1.329  
   1.330    // find local field, returns true if found
   1.331    bool find_local_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const;
   1.332    // find field in direct superinterfaces, returns the interface in which the field is defined
   1.333 -  klassOop find_interface_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const;
   1.334 +  Klass* find_interface_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const;
   1.335    // find field according to JVM spec 5.4.3.2, returns the klass in which the field is defined
   1.336 -  klassOop find_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const;
   1.337 +  Klass* find_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const;
   1.338    // find instance or static fields according to JVM spec 5.4.3.2, returns the klass in which the field is defined
   1.339 -  klassOop find_field(Symbol* name, Symbol* sig, bool is_static, fieldDescriptor* fd) const;
   1.340 +  Klass* find_field(Symbol* name, Symbol* sig, bool is_static, fieldDescriptor* fd) const;
   1.341  
   1.342    // find a non-static or static field given its offset within the class.
   1.343    bool contains_field_offset(int offset) {
   1.344 @@ -481,42 +482,38 @@
   1.345    bool find_field_from_offset(int offset, bool is_static, fieldDescriptor* fd) const;
   1.346  
   1.347    // find a local method (returns NULL if not found)
   1.348 -  methodOop find_method(Symbol* name, Symbol* signature) const;
   1.349 -  static methodOop find_method(objArrayOop methods, Symbol* name, Symbol* signature);
   1.350 +  Method* find_method(Symbol* name, Symbol* signature) const;
   1.351 +  static Method* find_method(Array<Method*>* methods, Symbol* name, Symbol* signature);
   1.352  
   1.353    // lookup operation (returns NULL if not found)
   1.354 -  methodOop uncached_lookup_method(Symbol* name, Symbol* signature) const;
   1.355 +  Method* uncached_lookup_method(Symbol* name, Symbol* signature) const;
   1.356  
   1.357    // lookup a method in all the interfaces that this class implements
   1.358    // (returns NULL if not found)
   1.359 -  methodOop lookup_method_in_all_interfaces(Symbol* name, Symbol* signature) const;
   1.360 +  Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature) const;
   1.361  
   1.362    // constant pool
   1.363 -  constantPoolOop constants() const        { return _constants; }
   1.364 -  void set_constants(constantPoolOop c)    { oop_store_without_check((oop*) &_constants, (oop) c); }
   1.365 -
   1.366 -  // class loader
   1.367 -  oop class_loader() const                 { return _class_loader; }
   1.368 -  void set_class_loader(oop l)             { oop_store((oop*) &_class_loader, l); }
   1.369 +  ConstantPool* constants() const        { return _constants; }
   1.370 +  void set_constants(ConstantPool* c)    { _constants = c; }
   1.371  
   1.372    // protection domain
   1.373    oop protection_domain()                  { return _protection_domain; }
   1.374 -  void set_protection_domain(oop pd)       { oop_store((oop*) &_protection_domain, pd); }
   1.375 +  void set_protection_domain(oop pd)       { klass_oop_store(&_protection_domain, pd); }
   1.376  
   1.377    // host class
   1.378 -  oop host_klass() const                   {
   1.379 -    oop* hk = adr_host_klass();
   1.380 +  Klass* host_klass() const              {
   1.381 +    Klass** hk = (Klass**)adr_host_klass();
   1.382      if (hk == NULL) {
   1.383        return NULL;
   1.384      } else {
   1.385        return *hk;
   1.386      }
   1.387    }
   1.388 -  void set_host_klass(oop host)            {
   1.389 +  void set_host_klass(Klass* host)            {
   1.390      assert(is_anonymous(), "not anonymous");
   1.391 -    oop* addr = adr_host_klass();
   1.392 +    Klass** addr = (Klass**)adr_host_klass();
   1.393      assert(addr != NULL, "no reversed space");
   1.394 -    oop_store(addr, host);
   1.395 +    *addr = host;
   1.396    }
   1.397    bool is_anonymous() const                {
   1.398      return (_misc_flags & _misc_is_anonymous) != 0;
   1.399 @@ -531,7 +528,7 @@
   1.400  
   1.401    // signers
   1.402    objArrayOop signers() const              { return _signers; }
   1.403 -  void set_signers(objArrayOop s)          { oop_store((oop*) &_signers, oop(s)); }
   1.404 +  void set_signers(objArrayOop s)          { klass_oop_store((oop*)&_signers, s); }
   1.405  
   1.406    // source file name
   1.407    Symbol* source_file_name() const         { return _source_file_name; }
   1.408 @@ -578,6 +575,8 @@
   1.409      return _previous_versions;
   1.410    }
   1.411  
   1.412 +  static void purge_previous_versions(InstanceKlass* ik);
   1.413 +
   1.414    // JVMTI: Support for caching a class file before it is modified by an agent that can do retransformation
   1.415    void set_cached_class_file(unsigned char *class_file_bytes,
   1.416                               jint class_file_len)     { _cached_class_file_len = class_file_len;
   1.417 @@ -593,7 +592,7 @@
   1.418      return _jvmti_cached_class_field_map;
   1.419    }
   1.420  
   1.421 -  // for adding methods, constMethodOopDesc::UNSET_IDNUM means no more ids available
   1.422 +  // for adding methods, ConstMethod::UNSET_IDNUM means no more ids available
   1.423    inline u2 next_method_idnum();
   1.424    void set_initial_method_idnum(u2 value)             { _idnum_allocated_count = value; }
   1.425  
   1.426 @@ -620,40 +619,26 @@
   1.427                       jmethodID** to_dealloc_jmeths_p);
   1.428    static void get_jmethod_id_length_value(jmethodID* cache, size_t idnum,
   1.429                  size_t *length_p, jmethodID* id_p);
   1.430 -  jmethodID jmethod_id_or_null(methodOop method);
   1.431 +  jmethodID jmethod_id_or_null(Method* method);
   1.432  
   1.433    // cached itable index support
   1.434    void set_cached_itable_index(size_t idnum, int index);
   1.435    int cached_itable_index(size_t idnum);
   1.436  
   1.437    // annotations support
   1.438 -  typeArrayOop class_annotations() const              { return _class_annotations; }
   1.439 -  objArrayOop fields_annotations() const              { return _fields_annotations; }
   1.440 -  objArrayOop methods_annotations() const             { return _methods_annotations; }
   1.441 -  objArrayOop methods_parameter_annotations() const   { return _methods_parameter_annotations; }
   1.442 -  objArrayOop methods_default_annotations() const     { return _methods_default_annotations; }
   1.443 -  void set_class_annotations(typeArrayOop md)            { oop_store_without_check((oop*)&_class_annotations, (oop)md); }
   1.444 -  void set_fields_annotations(objArrayOop md)            { set_annotations(md, &_fields_annotations); }
   1.445 -  void set_methods_annotations(objArrayOop md)           { set_annotations(md, &_methods_annotations); }
   1.446 -  void set_methods_parameter_annotations(objArrayOop md) { set_annotations(md, &_methods_parameter_annotations); }
   1.447 -  void set_methods_default_annotations(objArrayOop md)   { set_annotations(md, &_methods_default_annotations); }
   1.448 -  typeArrayOop get_method_annotations_of(int idnum)
   1.449 -                                                { return get_method_annotations_from(idnum, _methods_annotations); }
   1.450 -  typeArrayOop get_method_parameter_annotations_of(int idnum)
   1.451 -                                                { return get_method_annotations_from(idnum, _methods_parameter_annotations); }
   1.452 -  typeArrayOop get_method_default_annotations_of(int idnum)
   1.453 -                                                { return get_method_annotations_from(idnum, _methods_default_annotations); }
   1.454 -  void set_method_annotations_of(int idnum, typeArrayOop anno)
   1.455 -                                                { set_methods_annotations_of(idnum, anno, &_methods_annotations); }
   1.456 -  void set_method_parameter_annotations_of(int idnum, typeArrayOop anno)
   1.457 -                                                { set_methods_annotations_of(idnum, anno, &_methods_parameter_annotations); }
   1.458 -  void set_method_default_annotations_of(int idnum, typeArrayOop anno)
   1.459 -                                                { set_methods_annotations_of(idnum, anno, &_methods_default_annotations); }
   1.460 +  Annotations* annotations() const          { return _annotations; }
   1.461 +  void set_annotations(Annotations* anno)   { _annotations = anno; }
   1.462 +  AnnotationArray* class_annotations() const {
   1.463 +    if (annotations() == NULL) return NULL;
   1.464 +    return annotations()->class_annotations();
   1.465 +  }
   1.466 +  Array<AnnotationArray*>* fields_annotations() const {
   1.467 +    if (annotations() == NULL) return NULL;
   1.468 +    return annotations()->fields_annotations();
   1.469 +  }
   1.470  
   1.471    // allocation
   1.472 -  DEFINE_ALLOCATE_PERMANENT(instanceKlass);
   1.473    instanceOop allocate_instance(TRAPS);
   1.474 -  instanceOop allocate_permanent_instance(TRAPS);
   1.475  
   1.476    // additional member function to return a handle
   1.477    instanceHandle allocate_instance_handle(TRAPS)      { return instanceHandle(THREAD, allocate_instance(THREAD)); }
   1.478 @@ -690,24 +675,24 @@
   1.479    void set_osr_nmethods_head(nmethod* h)     { _osr_nmethods_head = h; };
   1.480    void add_osr_nmethod(nmethod* n);
   1.481    void remove_osr_nmethod(nmethod* n);
   1.482 -  nmethod* lookup_osr_nmethod(const methodOop m, int bci, int level, bool match_level) const;
   1.483 +  nmethod* lookup_osr_nmethod(Method* const m, int bci, int level, bool match_level) const;
   1.484  
   1.485 -  // Breakpoint support (see methods on methodOop for details)
   1.486 +  // Breakpoint support (see methods on Method* for details)
   1.487    BreakpointInfo* breakpoints() const       { return _breakpoints; };
   1.488    void set_breakpoints(BreakpointInfo* bps) { _breakpoints = bps; };
   1.489  
   1.490    // support for stub routines
   1.491 -  static ByteSize init_state_offset()  { return in_ByteSize(sizeof(klassOopDesc) + offset_of(instanceKlass, _init_state)); }
   1.492 +  static ByteSize init_state_offset()  { return in_ByteSize(offset_of(InstanceKlass, _init_state)); }
   1.493    TRACE_DEFINE_OFFSET;
   1.494 -  static ByteSize init_thread_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(instanceKlass, _init_thread)); }
   1.495 +  static ByteSize init_thread_offset() { return in_ByteSize(offset_of(InstanceKlass, _init_thread)); }
   1.496  
   1.497    // subclass/subinterface checks
   1.498 -  bool implements_interface(klassOop k) const;
   1.499 +  bool implements_interface(Klass* k) const;
   1.500  
   1.501    // Access to the implementor of an interface.
   1.502 -  klassOop implementor() const
   1.503 +  Klass* implementor() const
   1.504    {
   1.505 -    klassOop* k = (klassOop*)adr_implementor();
   1.506 +    Klass** k = adr_implementor();
   1.507      if (k == NULL) {
   1.508        return NULL;
   1.509      } else {
   1.510 @@ -715,24 +700,24 @@
   1.511      }
   1.512    }
   1.513  
   1.514 -  void set_implementor(klassOop k) {
   1.515 +  void set_implementor(Klass* k) {
   1.516      assert(is_interface(), "not interface");
   1.517 -    oop* addr = adr_implementor();
   1.518 -    oop_store_without_check(addr, k);
   1.519 +    Klass** addr = adr_implementor();
   1.520 +    *addr = k;
   1.521    }
   1.522  
   1.523    int  nof_implementors() const       {
   1.524 -    klassOop k = implementor();
   1.525 +    Klass* k = implementor();
   1.526      if (k == NULL) {
   1.527        return 0;
   1.528 -    } else if (k != this->as_klassOop()) {
   1.529 +    } else if (k != this) {
   1.530        return 1;
   1.531      } else {
   1.532        return 2;
   1.533      }
   1.534    }
   1.535  
   1.536 -  void add_implementor(klassOop k);  // k is a new class that implements this interface
   1.537 +  void add_implementor(Klass* k);  // k is a new class that implements this interface
   1.538    void init_implementor();           // initialize
   1.539  
   1.540    // link this class into the implementors list of every interface it implements
   1.541 @@ -740,12 +725,11 @@
   1.542  
   1.543    // virtual operations from Klass
   1.544    bool is_leaf_class() const               { return _subklass == NULL; }
   1.545 -  objArrayOop compute_secondary_supers(int num_extra_slots, TRAPS);
   1.546 -  bool compute_is_subtype_of(klassOop k);
   1.547 +  GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots);
   1.548 +  bool compute_is_subtype_of(Klass* k);
   1.549    bool can_be_primary_super_slow() const;
   1.550 -  klassOop java_super() const              { return super(); }
   1.551 +  Klass* java_super() const              { return super(); }
   1.552    int oop_size(oop obj)  const             { return size_helper(); }
   1.553 -  int klass_oop_size() const               { return object_size(); }
   1.554    bool oop_is_instance_slow() const        { return true; }
   1.555  
   1.556    // Iterators
   1.557 @@ -753,39 +737,46 @@
   1.558    void do_nonstatic_fields(FieldClosure* cl); // including inherited fields
   1.559    void do_local_static_fields(void f(fieldDescriptor*, TRAPS), TRAPS);
   1.560  
   1.561 -  void methods_do(void f(methodOop method));
   1.562 -  void array_klasses_do(void f(klassOop k));
   1.563 -  void with_array_klasses_do(void f(klassOop k));
   1.564 +  void methods_do(void f(Method* method));
   1.565 +  void array_klasses_do(void f(Klass* k));
   1.566 +  void array_klasses_do(void f(Klass* k, TRAPS), TRAPS);
   1.567 +  void with_array_klasses_do(void f(Klass* k));
   1.568    bool super_types_do(SuperTypeClosure* blk);
   1.569  
   1.570 -  // Casting from klassOop
   1.571 -  static instanceKlass* cast(klassOop k) {
   1.572 +  // Casting from Klass*
   1.573 +  static InstanceKlass* cast(Klass* k) {
   1.574      assert(k->is_klass(), "must be");
   1.575 -    Klass* kp = k->klass_part();
   1.576 -    assert(kp->null_vtbl() || kp->oop_is_instance_slow(), "cast to instanceKlass");
   1.577 -    return (instanceKlass*) kp;
   1.578 +    assert(k->oop_is_instance(), "cast to InstanceKlass");
   1.579 +    return (InstanceKlass*) k;
   1.580    }
   1.581  
   1.582    // Sizing (in words)
   1.583 -  static int header_size()            { return align_object_offset(oopDesc::header_size() + sizeof(instanceKlass)/HeapWordSize); }
   1.584 +  static int header_size()            { return align_object_offset(sizeof(InstanceKlass)/HeapWordSize); }
   1.585 +  static int size(int vtable_length, int itable_length,
   1.586 +                  int nonstatic_oop_map_size,
   1.587 +                  bool is_interface, bool is_anonymous) {
   1.588 +    return align_object_size(header_size() +
   1.589 +           align_object_offset(vtable_length) +
   1.590 +           align_object_offset(itable_length) +
   1.591 +           ((is_interface || is_anonymous) ?
   1.592 +             align_object_offset(nonstatic_oop_map_size) :
   1.593 +             nonstatic_oop_map_size) +
   1.594 +           (is_interface ? (int)sizeof(Klass*)/HeapWordSize : 0) +
   1.595 +           (is_anonymous ? (int)sizeof(Klass*)/HeapWordSize : 0));
   1.596 +  }
   1.597 +  int size() const                    { return size(vtable_length(),
   1.598 +                                               itable_length(),
   1.599 +                                               nonstatic_oop_map_size(),
   1.600 +                                               is_interface(),
   1.601 +                                               is_anonymous());
   1.602 +  }
   1.603  
   1.604 -  int object_size() const
   1.605 -  {
   1.606 -    return object_size(align_object_offset(vtable_length()) +
   1.607 -                       align_object_offset(itable_length()) +
   1.608 -                       ((is_interface() || is_anonymous()) ?
   1.609 -                         align_object_offset(nonstatic_oop_map_size()) :
   1.610 -                         nonstatic_oop_map_size()) +
   1.611 -                       (is_interface() ? (int)sizeof(klassOop)/HeapWordSize : 0) +
   1.612 -                       (is_anonymous() ? (int)sizeof(klassOop)/HeapWordSize : 0));
   1.613 -  }
   1.614    static int vtable_start_offset()    { return header_size(); }
   1.615 -  static int vtable_length_offset()   { return oopDesc::header_size() + offset_of(instanceKlass, _vtable_len) / HeapWordSize; }
   1.616 -  static int object_size(int extra)   { return align_object_size(header_size() + extra); }
   1.617 +  static int vtable_length_offset()   { return offset_of(InstanceKlass, _vtable_len) / HeapWordSize; }
   1.618  
   1.619 -  intptr_t* start_of_vtable() const        { return ((intptr_t*)as_klassOop()) + vtable_start_offset(); }
   1.620 +  intptr_t* start_of_vtable() const        { return ((intptr_t*)this) + vtable_start_offset(); }
   1.621    intptr_t* start_of_itable() const        { return start_of_vtable() + align_object_offset(vtable_length()); }
   1.622 -  int  itable_offset_in_words() const { return start_of_itable() - (intptr_t*)as_klassOop(); }
   1.623 +  int  itable_offset_in_words() const { return start_of_itable() - (intptr_t*)this; }
   1.624  
   1.625    intptr_t* end_of_itable() const          { return start_of_itable() + itable_length(); }
   1.626  
   1.627 @@ -795,22 +786,22 @@
   1.628      return (OopMapBlock*)(start_of_itable() + align_object_offset(itable_length()));
   1.629    }
   1.630  
   1.631 -  oop* adr_implementor() const {
   1.632 +  Klass** adr_implementor() const {
   1.633      if (is_interface()) {
   1.634 -      return (oop*)(start_of_nonstatic_oop_maps() +
   1.635 +      return (Klass**)(start_of_nonstatic_oop_maps() +
   1.636                      nonstatic_oop_map_count());
   1.637      } else {
   1.638        return NULL;
   1.639      }
   1.640    };
   1.641  
   1.642 -  oop* adr_host_klass() const {
   1.643 +  Klass** adr_host_klass() const {
   1.644      if (is_anonymous()) {
   1.645 -      oop* adr_impl = adr_implementor();
   1.646 +      Klass** adr_impl = adr_implementor();
   1.647        if (adr_impl != NULL) {
   1.648          return adr_impl + 1;
   1.649        } else {
   1.650 -        return (oop*)(start_of_nonstatic_oop_maps() +
   1.651 +        return (Klass**)(start_of_nonstatic_oop_maps() +
   1.652                        nonstatic_oop_map_count());
   1.653        }
   1.654      } else {
   1.655 @@ -839,18 +830,27 @@
   1.656  
   1.657    // Java vtable/itable
   1.658    klassVtable* vtable() const;        // return new klassVtable wrapper
   1.659 -  inline methodOop method_at_vtable(int index);
   1.660 +  inline Method* method_at_vtable(int index);
   1.661    klassItable* itable() const;        // return new klassItable wrapper
   1.662 -  methodOop method_at_itable(klassOop holder, int index, TRAPS);
   1.663 +  Method* method_at_itable(Klass* holder, int index, TRAPS);
   1.664  
   1.665    // Garbage collection
   1.666 +  virtual void oops_do(OopClosure* cl);
   1.667 +
   1.668    void oop_follow_contents(oop obj);
   1.669    int  oop_adjust_pointers(oop obj);
   1.670 -  bool object_is_parsable() const { return _init_state != unparsable_by_gc; }
   1.671 -       // Value of _init_state must be zero (unparsable_by_gc) when klass field is set.
   1.672  
   1.673 -  void follow_weak_klass_links(
   1.674 -    BoolObjectClosure* is_alive, OopClosure* keep_alive);
   1.675 +  void clean_implementors_list(BoolObjectClosure* is_alive);
   1.676 +  void clean_method_data(BoolObjectClosure* is_alive);
   1.677 +
   1.678 +  // Explicit metaspace deallocation of fields
   1.679 +  // For RedefineClasses, we need to deallocate instanceKlasses
   1.680 +  void deallocate_contents(ClassLoaderData* loader_data);
   1.681 +
   1.682 +  // The constant pool is on stack if any of the methods are executing or
   1.683 +  // referenced by handles.
   1.684 +  bool on_stack() const { return _constants->on_stack(); }
   1.685 +
   1.686    void release_C_heap_structures();
   1.687  
   1.688    // Parallel Scavenge and Parallel Old
   1.689 @@ -860,11 +860,11 @@
   1.690    const char* signature_name() const;
   1.691  
   1.692    // Iterators
   1.693 -  int oop_oop_iterate(oop obj, OopClosure* blk) {
   1.694 +  int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) {
   1.695      return oop_oop_iterate_v(obj, blk);
   1.696    }
   1.697  
   1.698 -  int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
   1.699 +  int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) {
   1.700      return oop_oop_iterate_v_m(obj, blk, mr);
   1.701    }
   1.702  
   1.703 @@ -884,6 +884,7 @@
   1.704    ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
   1.705  #endif // !SERIALGC
   1.706  
   1.707 +  u2 idnum_allocated_count() const      { return _idnum_allocated_count; }
   1.708  private:
   1.709    // initialization state
   1.710  #ifdef ASSERT
   1.711 @@ -894,7 +895,6 @@
   1.712    void set_rewritten()                  { _misc_flags |= _misc_rewritten; }
   1.713    void set_init_thread(Thread *thread)  { _init_thread = thread; }
   1.714  
   1.715 -  u2 idnum_allocated_count() const      { return _idnum_allocated_count; }
   1.716    // The RedefineClasses() API can cause new method idnums to be needed
   1.717    // which will cause the caches to grow. Safety requires different
   1.718    // cache management logic if the caches can grow instead of just
   1.719 @@ -910,29 +910,15 @@
   1.720    void release_set_methods_cached_itable_indices(int* indices)
   1.721           { OrderAccess::release_store_ptr(&_methods_cached_itable_indices, indices); }
   1.722  
   1.723 -  inline typeArrayOop get_method_annotations_from(int idnum, objArrayOop annos);
   1.724 -  void set_annotations(objArrayOop md, objArrayOop* md_p)  { oop_store_without_check((oop*)md_p, (oop)md); }
   1.725 -  void set_methods_annotations_of(int idnum, typeArrayOop anno, objArrayOop* md_p);
   1.726 +  // Lock during initialization
   1.727 +  volatile oop init_lock() const;
   1.728 +  void set_init_lock(oop value)      { klass_oop_store(&_init_lock, value); }
   1.729 +  void fence_and_clear_init_lock();  // after fully_initialized
   1.730  
   1.731    // Offsets for memory management
   1.732 -  oop* adr_array_klasses() const     { return (oop*)&this->_array_klasses;}
   1.733 -  oop* adr_methods() const           { return (oop*)&this->_methods;}
   1.734 -  oop* adr_method_ordering() const   { return (oop*)&this->_method_ordering;}
   1.735 -  oop* adr_local_interfaces() const  { return (oop*)&this->_local_interfaces;}
   1.736 -  oop* adr_transitive_interfaces() const  { return (oop*)&this->_transitive_interfaces;}
   1.737 -  oop* adr_fields() const            { return (oop*)&this->_fields;}
   1.738 -  oop* adr_constants() const         { return (oop*)&this->_constants;}
   1.739 -  oop* adr_class_loader() const      { return (oop*)&this->_class_loader;}
   1.740    oop* adr_protection_domain() const { return (oop*)&this->_protection_domain;}
   1.741    oop* adr_signers() const           { return (oop*)&this->_signers;}
   1.742 -  oop* adr_inner_classes() const     { return (oop*)&this->_inner_classes;}
   1.743 -  oop* adr_methods_jmethod_ids() const             { return (oop*)&this->_methods_jmethod_ids;}
   1.744 -  oop* adr_methods_cached_itable_indices() const   { return (oop*)&this->_methods_cached_itable_indices;}
   1.745 -  oop* adr_class_annotations() const   { return (oop*)&this->_class_annotations;}
   1.746 -  oop* adr_fields_annotations() const  { return (oop*)&this->_fields_annotations;}
   1.747 -  oop* adr_methods_annotations() const { return (oop*)&this->_methods_annotations;}
   1.748 -  oop* adr_methods_parameter_annotations() const { return (oop*)&this->_methods_parameter_annotations;}
   1.749 -  oop* adr_methods_default_annotations() const { return (oop*)&this->_methods_default_annotations;}
   1.750 +  oop* adr_init_lock() const         { return (oop*)&this->_init_lock;}
   1.751  
   1.752    // Static methods that are used to implement member methods where an exposed this pointer
   1.753    // is needed due to possible GCs
   1.754 @@ -942,21 +928,21 @@
   1.755    static void eager_initialize_impl                     (instanceKlassHandle this_oop);
   1.756    static void set_initialization_state_and_notify_impl  (instanceKlassHandle this_oop, ClassState state, TRAPS);
   1.757    static void call_class_initializer_impl               (instanceKlassHandle this_oop, TRAPS);
   1.758 -  static klassOop array_klass_impl                      (instanceKlassHandle this_oop, bool or_null, int n, TRAPS);
   1.759 +  static Klass* array_klass_impl                      (instanceKlassHandle this_oop, bool or_null, int n, TRAPS);
   1.760    static void do_local_static_fields_impl               (instanceKlassHandle this_oop, void f(fieldDescriptor* fd, TRAPS), TRAPS);
   1.761    /* jni_id_for_impl for jfieldID only */
   1.762    static JNIid* jni_id_for_impl                         (instanceKlassHandle this_oop, int offset);
   1.763  
   1.764    // Returns the array class for the n'th dimension
   1.765 -  klassOop array_klass_impl(bool or_null, int n, TRAPS);
   1.766 +  Klass* array_klass_impl(bool or_null, int n, TRAPS);
   1.767  
   1.768    // Returns the array class with this class as element type
   1.769 -  klassOop array_klass_impl(bool or_null, TRAPS);
   1.770 +  Klass* array_klass_impl(bool or_null, TRAPS);
   1.771  
   1.772  public:
   1.773 -  // sharing support
   1.774 +  // CDS support - remove and restore oops from metadata. Oops are not shared.
   1.775    virtual void remove_unshareable_info();
   1.776 -  virtual void shared_symbols_iterate(SymbolClosure* closure);
   1.777 +  virtual void restore_unshareable_info(TRAPS);
   1.778  
   1.779    // jvm support
   1.780    jint compute_modifier_flags(TRAPS) const;
   1.781 @@ -967,7 +953,13 @@
   1.782  
   1.783   public:
   1.784    // Printing
   1.785 +#ifndef PRODUCT
   1.786 +  void print_on(outputStream* st) const;
   1.787 +#endif
   1.788 +  void print_value_on(outputStream* st) const;
   1.789 +
   1.790    void oop_print_value_on(oop obj, outputStream* st);
   1.791 +
   1.792  #ifndef PRODUCT
   1.793    void oop_print_on      (oop obj, outputStream* st);
   1.794  
   1.795 @@ -975,12 +967,15 @@
   1.796    bool is_dependent_nmethod(nmethod* nm);
   1.797  #endif
   1.798  
   1.799 +  const char* internal_name() const;
   1.800 +
   1.801    // Verification
   1.802 -  const char* internal_name() const;
   1.803 +  void verify_on(outputStream* st);
   1.804 +
   1.805    void oop_verify_on(oop obj, outputStream* st);
   1.806  };
   1.807  
   1.808 -inline methodOop instanceKlass::method_at_vtable(int index)  {
   1.809 +inline Method* InstanceKlass::method_at_vtable(int index)  {
   1.810  #ifndef PRODUCT
   1.811    assert(index >= 0, "valid vtable index");
   1.812    if (DebugVtables) {
   1.813 @@ -991,18 +986,11 @@
   1.814    return ve[index].method();
   1.815  }
   1.816  
   1.817 -inline typeArrayOop instanceKlass::get_method_annotations_from(int idnum, objArrayOop annos) {
   1.818 -  if (annos == NULL || annos->length() <= idnum) {
   1.819 -    return NULL;
   1.820 -  }
   1.821 -  return typeArrayOop(annos->obj_at(idnum));
   1.822 -}
   1.823 -
   1.824  // for adding methods
   1.825  // UNSET_IDNUM return means no more ids available
   1.826 -inline u2 instanceKlass::next_method_idnum() {
   1.827 -  if (_idnum_allocated_count == constMethodOopDesc::MAX_IDNUM) {
   1.828 -    return constMethodOopDesc::UNSET_IDNUM; // no more ids available
   1.829 +inline u2 InstanceKlass::next_method_idnum() {
   1.830 +  if (_idnum_allocated_count == ConstMethod::MAX_IDNUM) {
   1.831 +    return ConstMethod::UNSET_IDNUM; // no more ids available
   1.832    } else {
   1.833      return _idnum_allocated_count++;
   1.834    }
   1.835 @@ -1013,7 +1001,7 @@
   1.836  class JNIid: public CHeapObj<mtClass> {
   1.837    friend class VMStructs;
   1.838   private:
   1.839 -  klassOop           _holder;
   1.840 +  Klass*             _holder;
   1.841    JNIid*             _next;
   1.842    int                _offset;
   1.843  #ifdef ASSERT
   1.844 @@ -1022,45 +1010,42 @@
   1.845  
   1.846   public:
   1.847    // Accessors
   1.848 -  klassOop holder() const         { return _holder; }
   1.849 +  Klass* holder() const           { return _holder; }
   1.850    int offset() const              { return _offset; }
   1.851    JNIid* next()                   { return _next; }
   1.852    // Constructor
   1.853 -  JNIid(klassOop holder, int offset, JNIid* next);
   1.854 +  JNIid(Klass* holder, int offset, JNIid* next);
   1.855    // Identifier lookup
   1.856    JNIid* find(int offset);
   1.857  
   1.858    bool find_local_field(fieldDescriptor* fd) {
   1.859 -    return instanceKlass::cast(holder())->find_local_field_from_offset(offset(), true, fd);
   1.860 +    return InstanceKlass::cast(holder())->find_local_field_from_offset(offset(), true, fd);
   1.861    }
   1.862  
   1.863 -  // Garbage collection support
   1.864 -  oop* holder_addr() { return (oop*)&_holder; }
   1.865 -  void oops_do(OopClosure* f);
   1.866    static void deallocate(JNIid* id);
   1.867    // Debugging
   1.868  #ifdef ASSERT
   1.869    bool is_static_field_id() const { return _is_static_field_id; }
   1.870    void set_is_static_field_id()   { _is_static_field_id = true; }
   1.871  #endif
   1.872 -  void verify(klassOop holder);
   1.873 +  void verify(Klass* holder);
   1.874  };
   1.875  
   1.876  
   1.877  // If breakpoints are more numerous than just JVMTI breakpoints,
   1.878  // consider compressing this data structure.
   1.879 -// It is currently a simple linked list defined in methodOop.hpp.
   1.880 +// It is currently a simple linked list defined in method.hpp.
   1.881  
   1.882  class BreakpointInfo;
   1.883  
   1.884  
   1.885  // A collection point for interesting information about the previous
   1.886 -// version(s) of an instanceKlass. This class uses weak references to
   1.887 +// version(s) of an InstanceKlass. This class uses weak references to
   1.888  // the information so that the information may be collected as needed
   1.889  // by the system. If the information is shared, then a regular
   1.890  // reference must be used because a weak reference would be seen as
   1.891  // collectible. A GrowableArray of PreviousVersionNodes is attached
   1.892 -// to the instanceKlass as needed. See PreviousVersionWalker below.
   1.893 +// to the InstanceKlass as needed. See PreviousVersionWalker below.
   1.894  class PreviousVersionNode : public CHeapObj<mtClass> {
   1.895   private:
   1.896    // A shared ConstantPool is never collected so we'll always have
   1.897 @@ -1068,23 +1053,23 @@
   1.898    // have a weak reference to a non-shared ConstantPool until all
   1.899    // of the methods (EMCP or obsolete) have been collected; the
   1.900    // non-shared ConstantPool becomes collectible at that point.
   1.901 -  jobject _prev_constant_pool;  // regular or weak reference
   1.902 +  ConstantPool*    _prev_constant_pool;  // regular or weak reference
   1.903    bool    _prev_cp_is_weak;     // true if not a shared ConstantPool
   1.904  
   1.905 -  // If the previous version of the instanceKlass doesn't have any
   1.906 +  // If the previous version of the InstanceKlass doesn't have any
   1.907    // EMCP methods, then _prev_EMCP_methods will be NULL. If all the
   1.908    // EMCP methods have been collected, then _prev_EMCP_methods can
   1.909    // have a length of zero.
   1.910 -  GrowableArray<jweak>* _prev_EMCP_methods;
   1.911 +  GrowableArray<Method*>* _prev_EMCP_methods;
   1.912  
   1.913  public:
   1.914 -  PreviousVersionNode(jobject prev_constant_pool, bool prev_cp_is_weak,
   1.915 -    GrowableArray<jweak>* prev_EMCP_methods);
   1.916 +  PreviousVersionNode(ConstantPool* prev_constant_pool, bool prev_cp_is_weak,
   1.917 +    GrowableArray<Method*>* prev_EMCP_methods);
   1.918    ~PreviousVersionNode();
   1.919 -  jobject prev_constant_pool() const {
   1.920 +  ConstantPool* prev_constant_pool() const {
   1.921      return _prev_constant_pool;
   1.922    }
   1.923 -  GrowableArray<jweak>* prev_EMCP_methods() const {
   1.924 +  GrowableArray<Method*>* prev_EMCP_methods() const {
   1.925      return _prev_EMCP_methods;
   1.926    }
   1.927  };
   1.928 @@ -1094,7 +1079,7 @@
   1.929  class PreviousVersionInfo : public ResourceObj {
   1.930   private:
   1.931    constantPoolHandle   _prev_constant_pool_handle;
   1.932 -  // If the previous version of the instanceKlass doesn't have any
   1.933 +  // If the previous version of the InstanceKlass doesn't have any
   1.934    // EMCP methods, then _prev_EMCP_methods will be NULL. Since the
   1.935    // methods cannot be collected while we hold a handle,
   1.936    // _prev_EMCP_methods should never have a length of zero.
   1.937 @@ -1137,7 +1122,7 @@
   1.938    PreviousVersionInfo *                 _current_p;
   1.939  
   1.940   public:
   1.941 -  PreviousVersionWalker(instanceKlass *ik);
   1.942 +  PreviousVersionWalker(InstanceKlass *ik);
   1.943    ~PreviousVersionWalker();
   1.944  
   1.945    // Return the interesting information for the next previous version
   1.946 @@ -1178,10 +1163,10 @@
   1.947  };
   1.948  
   1.949  // An iterator that's used to access the inner classes indices in the
   1.950 -// instanceKlass::_inner_classes array.
   1.951 +// InstanceKlass::_inner_classes array.
   1.952  class InnerClassesIterator : public StackObj {
   1.953   private:
   1.954 -  typeArrayHandle _inner_classes;
   1.955 +  Array<jushort>* _inner_classes;
   1.956    int _length;
   1.957    int _idx;
   1.958   public:
   1.959 @@ -1195,12 +1180,12 @@
   1.960        // attribute data, or it should be
   1.961        // n*inner_class_next_offset+enclosing_method_attribute_size
   1.962        // if it also contains the EnclosingMethod data.
   1.963 -      assert((_length % instanceKlass::inner_class_next_offset == 0 ||
   1.964 -              _length % instanceKlass::inner_class_next_offset == instanceKlass::enclosing_method_attribute_size),
   1.965 +      assert((_length % InstanceKlass::inner_class_next_offset == 0 ||
   1.966 +              _length % InstanceKlass::inner_class_next_offset == InstanceKlass::enclosing_method_attribute_size),
   1.967               "just checking");
   1.968        // Remove the enclosing_method portion if exists.
   1.969 -      if (_length % instanceKlass::inner_class_next_offset == instanceKlass::enclosing_method_attribute_size) {
   1.970 -        _length -= instanceKlass::enclosing_method_attribute_size;
   1.971 +      if (_length % InstanceKlass::inner_class_next_offset == InstanceKlass::enclosing_method_attribute_size) {
   1.972 +        _length -= InstanceKlass::enclosing_method_attribute_size;
   1.973        }
   1.974      } else {
   1.975        _length = 0;
   1.976 @@ -1213,7 +1198,7 @@
   1.977    }
   1.978  
   1.979    void next() {
   1.980 -    _idx += instanceKlass::inner_class_next_offset;
   1.981 +    _idx += InstanceKlass::inner_class_next_offset;
   1.982    }
   1.983  
   1.984    bool done() const {
   1.985 @@ -1221,38 +1206,38 @@
   1.986    }
   1.987  
   1.988    u2 inner_class_info_index() const {
   1.989 -    return _inner_classes->ushort_at(
   1.990 -               _idx + instanceKlass::inner_class_inner_class_info_offset);
   1.991 +    return _inner_classes->at(
   1.992 +               _idx + InstanceKlass::inner_class_inner_class_info_offset);
   1.993    }
   1.994  
   1.995    void set_inner_class_info_index(u2 index) {
   1.996 -    _inner_classes->ushort_at_put(
   1.997 -               _idx + instanceKlass::inner_class_inner_class_info_offset, index);
   1.998 +    _inner_classes->at_put(
   1.999 +               _idx + InstanceKlass::inner_class_inner_class_info_offset, index);
  1.1000    }
  1.1001  
  1.1002    u2 outer_class_info_index() const {
  1.1003 -    return _inner_classes->ushort_at(
  1.1004 -               _idx + instanceKlass::inner_class_outer_class_info_offset);
  1.1005 +    return _inner_classes->at(
  1.1006 +               _idx + InstanceKlass::inner_class_outer_class_info_offset);
  1.1007    }
  1.1008  
  1.1009    void set_outer_class_info_index(u2 index) {
  1.1010 -    _inner_classes->ushort_at_put(
  1.1011 -               _idx + instanceKlass::inner_class_outer_class_info_offset, index);
  1.1012 +    _inner_classes->at_put(
  1.1013 +               _idx + InstanceKlass::inner_class_outer_class_info_offset, index);
  1.1014    }
  1.1015  
  1.1016    u2 inner_name_index() const {
  1.1017 -    return _inner_classes->ushort_at(
  1.1018 -               _idx + instanceKlass::inner_class_inner_name_offset);
  1.1019 +    return _inner_classes->at(
  1.1020 +               _idx + InstanceKlass::inner_class_inner_name_offset);
  1.1021    }
  1.1022  
  1.1023    void set_inner_name_index(u2 index) {
  1.1024 -    _inner_classes->ushort_at_put(
  1.1025 -               _idx + instanceKlass::inner_class_inner_name_offset, index);
  1.1026 +    _inner_classes->at_put(
  1.1027 +               _idx + InstanceKlass::inner_class_inner_name_offset, index);
  1.1028    }
  1.1029  
  1.1030    u2 inner_access_flags() const {
  1.1031 -    return _inner_classes->ushort_at(
  1.1032 -               _idx + instanceKlass::inner_class_access_flags_offset);
  1.1033 +    return _inner_classes->at(
  1.1034 +               _idx + InstanceKlass::inner_class_access_flags_offset);
  1.1035    }
  1.1036  };
  1.1037  

mercurial