< prev index next >

src/hotspot/share/ci/ciInstanceKlass.hpp

Print this page
rev 58565 : 8238358: Implementation of JEP 371: Hidden Classes
Reviewed-by: duke
Contributed-by: mandy.chung@oracle.com, lois.foltan@oracle.com, david.holmes@oracle.com, harold.seigel@oracle.com, serguei.spitsyn@oracle.com, alex.buckley@oracle.com, jamsheed.c.m@oracle.com
rev 58568 : [mq]: hidden-class-4


  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();


 174     assert(is_loaded(), "must be loaded");
 175     return _nonstatic_oop_map_size; }
 176   ciInstanceKlass*       super();
 177   jint                   nof_implementors() {
 178     ciInstanceKlass* impl;
 179     assert(is_loaded(), "must be loaded");
 180     impl = implementor();
 181     if (impl == NULL) {
 182       return 0;
 183     } else if (impl != this) {
 184       return 1;
 185     } else {
 186       return 2;
 187     }
 188   }
 189   bool has_nonstatic_concrete_methods()  {
 190     assert(is_loaded(), "must be loaded");
 191     return _has_nonstatic_concrete_methods;
 192   }
 193 
 194   bool is_unsafe_anonymous() {
 195     return _is_unsafe_anonymous;
 196   }
 197 




 198   ciInstanceKlass* get_canonical_holder(int offset);
 199   ciField* get_field_by_offset(int field_offset, bool is_static);
 200   ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
 201 
 202   // total number of nonstatic fields (including inherited):
 203   int nof_nonstatic_fields() {
 204     if (_nonstatic_fields == NULL)
 205       return compute_nonstatic_fields();
 206     else
 207       return _nonstatic_fields->length();
 208   }
 209 
 210   bool has_injected_fields() {
 211     if (_has_injected_fields == -1) {
 212       compute_injected_fields();
 213     }
 214     return _has_injected_fields > 0 ? true : false;
 215   }
 216 
 217   bool has_object_fields() const;




  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_hidden;
  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();


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


< prev index next >