< prev index next >

src/hotspot/share/oops/instanceKlass.hpp

Print this page




 126 
 127   static int compare_offset(const OopMapBlock* a, const OopMapBlock* b) {
 128     return a->offset() - b->offset();
 129   }
 130 
 131  private:
 132   int  _offset;
 133   uint _count;
 134 };
 135 
 136 struct JvmtiCachedClassFileData;
 137 
 138 class SigEntry;
 139 
 140 class ValueKlassFixedBlock {
 141   Array<SigEntry>** _extended_sig;
 142   Array<VMRegPair>** _return_regs;
 143   address* _pack_handler;
 144   address* _unpack_handler;
 145   int* _default_value_offset;

 146 
 147   friend class ValueKlass;
 148 };
 149 
 150 class ValueTypes {
 151 public:
 152   u2 _class_info_index;
 153   Symbol* _class_name;
 154 };
 155 
 156 class InstanceKlass: public Klass {
 157   friend class VMStructs;
 158   friend class JVMCIVMStructs;
 159   friend class ClassFileParser;
 160   friend class CompileReplay;
 161 
 162  public:
 163   static const KlassID ID = InstanceKlassID;
 164 
 165  protected:


1079 
1080   // link this class into the implementors list of every interface it implements
1081   void process_interfaces(Thread *thread);
1082 
1083   // virtual operations from Klass
1084   bool is_leaf_class() const               { return _subklass == NULL; }
1085   GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots,
1086                                                   Array<InstanceKlass*>* transitive_interfaces);
1087   bool can_be_primary_super_slow() const;
1088   int oop_size(oop obj)  const             { return size_helper(); }
1089   // slow because it's a virtual call and used for verifying the layout_helper.
1090   // Using the layout_helper bits, we can call is_instance_klass without a virtual call.
1091   DEBUG_ONLY(bool is_instance_klass_slow() const      { return true; })
1092 
1093   // Iterators
1094   void do_local_static_fields(FieldClosure* cl);
1095   void do_nonstatic_fields(FieldClosure* cl); // including inherited fields
1096   void do_local_static_fields(void f(fieldDescriptor*, Handle, TRAPS), Handle, TRAPS);
1097 
1098   void methods_do(void f(Method* method));
1099   void array_klasses_do(void f(Klass* k));
1100   void array_klasses_do(void f(Klass* k, TRAPS), TRAPS);
1101   bool super_types_do(SuperTypeClosure* blk);
1102 
1103   static InstanceKlass* cast(Klass* k) {
1104     return const_cast<InstanceKlass*>(cast(const_cast<const Klass*>(k)));
1105   }
1106 
1107   static const InstanceKlass* cast(const Klass* k) {
1108     assert(k != NULL, "k should not be null");
1109     assert(k->is_instance_klass(), "cast to InstanceKlass");
1110     return static_cast<const InstanceKlass*>(k);
1111   }
1112 
1113   virtual InstanceKlass* java_super() const {
1114     return (super() == NULL) ? NULL : cast(super());
1115   }
1116 
1117   // Sizing (in words)
1118   static int header_size()            { return sizeof(InstanceKlass)/wordSize; }
1119 
1120   static int size(int vtable_length, int itable_length,


1375 
1376   // Lock during initialization
1377 public:
1378   // Lock for (1) initialization; (2) access to the ConstantPool of this class.
1379   // Must be one per class and it has to be a VM internal object so java code
1380   // cannot lock it (like the mirror).
1381   // It has to be an object not a Mutex because it's held through java calls.
1382   oop init_lock() const;
1383 private:
1384   void fence_and_clear_init_lock();
1385 
1386   bool link_class_impl                           (TRAPS);
1387   bool verify_code                               (TRAPS);
1388   void initialize_impl                           (TRAPS);
1389   void initialize_super_interfaces               (TRAPS);
1390   void eager_initialize_impl                     ();
1391   /* jni_id_for_impl for jfieldID only */
1392   JNIid* jni_id_for_impl                         (int offset);
1393 protected:
1394   // Returns the array class for the n'th dimension
1395   virtual Klass* array_klass_impl(bool or_null, int n, TRAPS);
1396 
1397   // Returns the array class with this class as element type
1398   virtual Klass* array_klass_impl(bool or_null, TRAPS);
1399 
1400 private:
1401 
1402   // find a local method (returns NULL if not found)
1403   Method* find_method_impl(const Symbol* name,
1404                            const Symbol* signature,
1405                            OverpassLookupMode overpass_mode,
1406                            StaticLookupMode static_mode,
1407                            PrivateLookupMode private_mode) const;
1408 
1409   static Method* find_method_impl(const Array<Method*>* methods,
1410                                   const Symbol* name,
1411                                   const Symbol* signature,
1412                                   OverpassLookupMode overpass_mode,
1413                                   StaticLookupMode static_mode,
1414                                   PrivateLookupMode private_mode);
1415 
1416   // Free CHeap allocated fields.
1417   void release_C_heap_structures();
1418 




 126 
 127   static int compare_offset(const OopMapBlock* a, const OopMapBlock* b) {
 128     return a->offset() - b->offset();
 129   }
 130 
 131  private:
 132   int  _offset;
 133   uint _count;
 134 };
 135 
 136 struct JvmtiCachedClassFileData;
 137 
 138 class SigEntry;
 139 
 140 class ValueKlassFixedBlock {
 141   Array<SigEntry>** _extended_sig;
 142   Array<VMRegPair>** _return_regs;
 143   address* _pack_handler;
 144   address* _unpack_handler;
 145   int* _default_value_offset;
 146   Klass** _value_array_klass;
 147 
 148   friend class ValueKlass;
 149 };
 150 
 151 class ValueTypes {
 152 public:
 153   u2 _class_info_index;
 154   Symbol* _class_name;
 155 };
 156 
 157 class InstanceKlass: public Klass {
 158   friend class VMStructs;
 159   friend class JVMCIVMStructs;
 160   friend class ClassFileParser;
 161   friend class CompileReplay;
 162 
 163  public:
 164   static const KlassID ID = InstanceKlassID;
 165 
 166  protected:


1080 
1081   // link this class into the implementors list of every interface it implements
1082   void process_interfaces(Thread *thread);
1083 
1084   // virtual operations from Klass
1085   bool is_leaf_class() const               { return _subklass == NULL; }
1086   GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots,
1087                                                   Array<InstanceKlass*>* transitive_interfaces);
1088   bool can_be_primary_super_slow() const;
1089   int oop_size(oop obj)  const             { return size_helper(); }
1090   // slow because it's a virtual call and used for verifying the layout_helper.
1091   // Using the layout_helper bits, we can call is_instance_klass without a virtual call.
1092   DEBUG_ONLY(bool is_instance_klass_slow() const      { return true; })
1093 
1094   // Iterators
1095   void do_local_static_fields(FieldClosure* cl);
1096   void do_nonstatic_fields(FieldClosure* cl); // including inherited fields
1097   void do_local_static_fields(void f(fieldDescriptor*, Handle, TRAPS), Handle, TRAPS);
1098 
1099   void methods_do(void f(Method* method));
1100   virtual void array_klasses_do(void f(Klass* k));

1101   bool super_types_do(SuperTypeClosure* blk);
1102 
1103   static InstanceKlass* cast(Klass* k) {
1104     return const_cast<InstanceKlass*>(cast(const_cast<const Klass*>(k)));
1105   }
1106 
1107   static const InstanceKlass* cast(const Klass* k) {
1108     assert(k != NULL, "k should not be null");
1109     assert(k->is_instance_klass(), "cast to InstanceKlass");
1110     return static_cast<const InstanceKlass*>(k);
1111   }
1112 
1113   virtual InstanceKlass* java_super() const {
1114     return (super() == NULL) ? NULL : cast(super());
1115   }
1116 
1117   // Sizing (in words)
1118   static int header_size()            { return sizeof(InstanceKlass)/wordSize; }
1119 
1120   static int size(int vtable_length, int itable_length,


1375 
1376   // Lock during initialization
1377 public:
1378   // Lock for (1) initialization; (2) access to the ConstantPool of this class.
1379   // Must be one per class and it has to be a VM internal object so java code
1380   // cannot lock it (like the mirror).
1381   // It has to be an object not a Mutex because it's held through java calls.
1382   oop init_lock() const;
1383 private:
1384   void fence_and_clear_init_lock();
1385 
1386   bool link_class_impl                           (TRAPS);
1387   bool verify_code                               (TRAPS);
1388   void initialize_impl                           (TRAPS);
1389   void initialize_super_interfaces               (TRAPS);
1390   void eager_initialize_impl                     ();
1391   /* jni_id_for_impl for jfieldID only */
1392   JNIid* jni_id_for_impl                         (int offset);
1393 protected:
1394   // Returns the array class for the n'th dimension
1395   virtual Klass* array_klass_impl(ArrayStorageProperties storage_props, bool or_null, int n, TRAPS);
1396 
1397   // Returns the array class with this class as element type
1398   virtual Klass* array_klass_impl(ArrayStorageProperties storage_props, bool or_null, TRAPS);
1399 
1400 private:
1401 
1402   // find a local method (returns NULL if not found)
1403   Method* find_method_impl(const Symbol* name,
1404                            const Symbol* signature,
1405                            OverpassLookupMode overpass_mode,
1406                            StaticLookupMode static_mode,
1407                            PrivateLookupMode private_mode) const;
1408 
1409   static Method* find_method_impl(const Array<Method*>* methods,
1410                                   const Symbol* name,
1411                                   const Symbol* signature,
1412                                   OverpassLookupMode overpass_mode,
1413                                   StaticLookupMode static_mode,
1414                                   PrivateLookupMode private_mode);
1415 
1416   // Free CHeap allocated fields.
1417   void release_C_heap_structures();
1418 


< prev index next >