< prev index next >

src/hotspot/share/ci/ciInstanceKlass.hpp

Print this page




  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   enum SubklassValue { subklass_unknown, subklass_false, subklass_true };
  48 
  49   jobject                _loader;
  50   jobject                _protection_domain;
  51 
  52   InstanceKlass::ClassState _init_state;           // state of class
  53   bool                   _is_shared;
  54   bool                   _has_finalizer;
  55   SubklassValue          _has_subklass;
  56   bool                   _has_nonstatic_fields;
  57   bool                   _has_nonstatic_concrete_methods;
  58   bool                   _is_unsafe_anonymous;

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


 167   ciInstanceKlass*       super();
 168   jint                   nof_implementors() {
 169     ciInstanceKlass* impl;
 170     assert(is_loaded(), "must be loaded");
 171     impl = implementor();
 172     if (impl == NULL) {
 173       return 0;
 174     } else if (impl != this) {
 175       return 1;
 176     } else {
 177       return 2;
 178     }
 179   }
 180   bool has_nonstatic_concrete_methods()  {
 181     assert(is_loaded(), "must be loaded");
 182     return _has_nonstatic_concrete_methods;
 183   }
 184 
 185   bool is_unsafe_anonymous() {
 186     return _is_unsafe_anonymous;




 187   }
 188 
 189   ciInstanceKlass* get_canonical_holder(int offset);
 190   ciField* get_field_by_offset(int field_offset, bool is_static);
 191   ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
 192 
 193   // total number of nonstatic fields (including inherited):
 194   int nof_nonstatic_fields() {
 195     if (_nonstatic_fields == NULL)
 196       return compute_nonstatic_fields();
 197     else
 198       return _nonstatic_fields->length();
 199   }
 200 
 201   bool has_injected_fields() {
 202     if (_has_injected_fields == -1) {
 203       compute_injected_fields();
 204     }
 205     return _has_injected_fields > 0 ? true : false;
 206   }




  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   enum SubklassValue { subklass_unknown, subklass_false, subklass_true };
  48 
  49   jobject                _loader;
  50   jobject                _protection_domain;
  51 
  52   InstanceKlass::ClassState _init_state;           // state of class
  53   bool                   _is_shared;
  54   bool                   _has_finalizer;
  55   SubklassValue          _has_subklass;
  56   bool                   _has_nonstatic_fields;
  57   bool                   _has_nonstatic_concrete_methods;
  58   bool                   _is_unsafe_anonymous;
  59   bool                   _is_nonfindable;
  60 
  61   ciFlags                _flags;
  62   jint                   _nonstatic_field_size;
  63   jint                   _nonstatic_oop_map_size;
  64 
  65   // Lazy fields get filled in only upon request.
  66   ciInstanceKlass*       _super;
  67   ciInstance*            _java_mirror;
  68 
  69   ciConstantPoolCache*   _field_cache;  // cached map index->field
  70   GrowableArray<ciField*>* _nonstatic_fields;
  71   int                    _has_injected_fields; // any non static injected fields? lazily initialized.
  72 
  73   // The possible values of the _implementor fall into following three cases:
  74   //   NULL: no implementor.
  75   //   A ciInstanceKlass that's not itself: one implementor.
  76   //   Itself: more than one implementor.
  77   ciInstanceKlass*       _implementor;
  78 
  79   void compute_injected_fields();


 168   ciInstanceKlass*       super();
 169   jint                   nof_implementors() {
 170     ciInstanceKlass* impl;
 171     assert(is_loaded(), "must be loaded");
 172     impl = implementor();
 173     if (impl == NULL) {
 174       return 0;
 175     } else if (impl != this) {
 176       return 1;
 177     } else {
 178       return 2;
 179     }
 180   }
 181   bool has_nonstatic_concrete_methods()  {
 182     assert(is_loaded(), "must be loaded");
 183     return _has_nonstatic_concrete_methods;
 184   }
 185 
 186   bool is_unsafe_anonymous() {
 187     return _is_unsafe_anonymous;
 188   }
 189  
 190   bool is_nonfindable() {
 191     return _is_nonfindable;
 192   }
 193 
 194   ciInstanceKlass* get_canonical_holder(int offset);
 195   ciField* get_field_by_offset(int field_offset, bool is_static);
 196   ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
 197 
 198   // total number of nonstatic fields (including inherited):
 199   int nof_nonstatic_fields() {
 200     if (_nonstatic_fields == NULL)
 201       return compute_nonstatic_fields();
 202     else
 203       return _nonstatic_fields->length();
 204   }
 205 
 206   bool has_injected_fields() {
 207     if (_has_injected_fields == -1) {
 208       compute_injected_fields();
 209     }
 210     return _has_injected_fields > 0 ? true : false;
 211   }


< prev index next >