< prev index next >

src/share/vm/ci/ciInstanceKlass.hpp

Print this page




  36 // whose Klass part is an InstanceKlass.  It may or may not
  37 // be loaded.
  38 class ciInstanceKlass : public ciKlass {
  39   CI_PACKAGE_ACCESS
  40   friend class ciBytecodeStream;
  41   friend class ciEnv;
  42   friend class ciExceptionHandler;
  43   friend class ciMethod;
  44   friend class ciField;
  45 
  46 private:
  47   jobject                _loader;
  48   jobject                _protection_domain;
  49 
  50   InstanceKlass::ClassState _init_state;           // state of class
  51   bool                   _is_shared;
  52   bool                   _has_finalizer;
  53   bool                   _has_subklass;
  54   bool                   _has_nonstatic_fields;
  55   bool                   _has_default_methods;

  56 
  57   ciFlags                _flags;
  58   jint                   _nonstatic_field_size;
  59   jint                   _nonstatic_oop_map_size;
  60 
  61   // Lazy fields get filled in only upon request.
  62   ciInstanceKlass*       _super;
  63   ciInstance*            _java_mirror;
  64 
  65   ciConstantPoolCache*   _field_cache;  // cached map index->field
  66   GrowableArray<ciField*>* _nonstatic_fields;
  67   int                    _has_injected_fields; // any non static injected fields? lazily initialized.
  68 
  69   // The possible values of the _implementor fall into following three cases:
  70   //   NULL: no implementor.
  71   //   A ciInstanceKlass that's not itself: one implementor.
  72   //   Itsef: more than one implementors.
  73   ciInstanceKlass*       _implementor;
  74 
  75   void compute_injected_fields();


 162     return _nonstatic_oop_map_size; }
 163   ciInstanceKlass*       super();
 164   jint                   nof_implementors() {
 165     ciInstanceKlass* impl;
 166     assert(is_loaded(), "must be loaded");
 167     impl = implementor();
 168     if (impl == NULL) {
 169       return 0;
 170     } else if (impl != this) {
 171       return 1;
 172     } else {
 173       return 2;
 174     }
 175   }
 176 
 177   bool has_default_methods()  {
 178     assert(is_loaded(), "must be loaded");
 179     return _has_default_methods;
 180   }
 181 




 182   ciInstanceKlass* get_canonical_holder(int offset);
 183   ciField* get_field_by_offset(int field_offset, bool is_static);
 184   ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
 185 
 186   // total number of nonstatic fields (including inherited):
 187   int nof_nonstatic_fields() {
 188     if (_nonstatic_fields == NULL)
 189       return compute_nonstatic_fields();
 190     else
 191       return _nonstatic_fields->length();
 192   }
 193 
 194   bool has_injected_fields() {
 195     if (_has_injected_fields == -1) {
 196       compute_injected_fields();
 197     }
 198     return _has_injected_fields > 0 ? true : false;
 199   }
 200 
 201   // nth nonstatic field (presented by ascending address)




  36 // whose Klass part is an InstanceKlass.  It may or may not
  37 // be loaded.
  38 class ciInstanceKlass : public ciKlass {
  39   CI_PACKAGE_ACCESS
  40   friend class ciBytecodeStream;
  41   friend class ciEnv;
  42   friend class ciExceptionHandler;
  43   friend class ciMethod;
  44   friend class ciField;
  45 
  46 private:
  47   jobject                _loader;
  48   jobject                _protection_domain;
  49 
  50   InstanceKlass::ClassState _init_state;           // state of class
  51   bool                   _is_shared;
  52   bool                   _has_finalizer;
  53   bool                   _has_subklass;
  54   bool                   _has_nonstatic_fields;
  55   bool                   _has_default_methods;
  56   bool                   _is_anonymous;
  57 
  58   ciFlags                _flags;
  59   jint                   _nonstatic_field_size;
  60   jint                   _nonstatic_oop_map_size;
  61 
  62   // Lazy fields get filled in only upon request.
  63   ciInstanceKlass*       _super;
  64   ciInstance*            _java_mirror;
  65 
  66   ciConstantPoolCache*   _field_cache;  // cached map index->field
  67   GrowableArray<ciField*>* _nonstatic_fields;
  68   int                    _has_injected_fields; // any non static injected fields? lazily initialized.
  69 
  70   // The possible values of the _implementor fall into following three cases:
  71   //   NULL: no implementor.
  72   //   A ciInstanceKlass that's not itself: one implementor.
  73   //   Itsef: more than one implementors.
  74   ciInstanceKlass*       _implementor;
  75 
  76   void compute_injected_fields();


 163     return _nonstatic_oop_map_size; }
 164   ciInstanceKlass*       super();
 165   jint                   nof_implementors() {
 166     ciInstanceKlass* impl;
 167     assert(is_loaded(), "must be loaded");
 168     impl = implementor();
 169     if (impl == NULL) {
 170       return 0;
 171     } else if (impl != this) {
 172       return 1;
 173     } else {
 174       return 2;
 175     }
 176   }
 177 
 178   bool has_default_methods()  {
 179     assert(is_loaded(), "must be loaded");
 180     return _has_default_methods;
 181   }
 182 
 183   bool is_anonymous() {
 184     return _is_anonymous;
 185   }
 186 
 187   ciInstanceKlass* get_canonical_holder(int offset);
 188   ciField* get_field_by_offset(int field_offset, bool is_static);
 189   ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
 190 
 191   // total number of nonstatic fields (including inherited):
 192   int nof_nonstatic_fields() {
 193     if (_nonstatic_fields == NULL)
 194       return compute_nonstatic_fields();
 195     else
 196       return _nonstatic_fields->length();
 197   }
 198 
 199   bool has_injected_fields() {
 200     if (_has_injected_fields == -1) {
 201       compute_injected_fields();
 202     }
 203     return _has_injected_fields > 0 ? true : false;
 204   }
 205 
 206   // nth nonstatic field (presented by ascending address)


< prev index next >