< prev index next >

src/hotspot/share/ci/ciInstanceKlass.hpp

Print this page




  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_nonstatic_concrete_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();
  77   bool compute_injected_fields_helper();

  78 
  79 protected:
  80   ciInstanceKlass(Klass* k);
  81   ciInstanceKlass(ciSymbol* name, jobject loader, jobject protection_domain);
  82 
  83   InstanceKlass* get_instanceKlass() const {
  84     return InstanceKlass::cast(get_Klass());
  85   }
  86 
  87   oop loader();
  88   jobject loader_handle();
  89 
  90   oop protection_domain();
  91   jobject protection_domain_handle();
  92 
  93   const char* type_string() { return "ciInstanceKlass"; }
  94 
  95   bool is_in_package_impl(const char* packagename, int len);
  96 
  97   void print_impl(outputStream* st);


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







 205   // nth nonstatic field (presented by ascending address)
 206   ciField* nonstatic_field_at(int i) {
 207     assert(_nonstatic_fields != NULL, "");
 208     return _nonstatic_fields->at(i);
 209   }
 210 
 211   ciInstanceKlass* unique_concrete_subklass();
 212   bool has_finalizable_subclass();
 213 
 214   bool contains_field_offset(int offset) {
 215     return instanceOopDesc::contains_field_offset(offset, nonstatic_field_size());
 216   }
 217 
 218   // Get the instance of java.lang.Class corresponding to
 219   // this klass.  This instance is used for locking of
 220   // synchronized static methods of this klass.
 221   ciInstance*            java_mirror();
 222 
 223   // Java access flags
 224   bool is_public      () { return flags().is_public(); }


 252   // What kind of ciObject is this?
 253   bool is_instance_klass() const { return true; }
 254   bool is_java_klass() const     { return true; }
 255 
 256   virtual ciKlass* exact_klass() {
 257     if (is_loaded() && is_final() && !is_interface()) {
 258       return this;
 259     }
 260     return NULL;
 261   }
 262 
 263   ciInstanceKlass* host_klass();
 264 
 265   bool can_be_instantiated() {
 266     assert(is_loaded(), "must be loaded");
 267     return !is_interface() && !is_abstract();
 268   }
 269 
 270   // Dump the current state of this klass for compilation replay.
 271   virtual void dump_replay_data(outputStream* out);





 272 };
 273 
 274 #endif // SHARE_VM_CI_CIINSTANCEKLASS_HPP


  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_nonstatic_concrete_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   int                    _has_object_fields; // any object fields? lazily initialized.
  70 
  71   // The possible values of the _implementor fall into following three cases:
  72   //   NULL: no implementor.
  73   //   A ciInstanceKlass that's not itself: one implementor.
  74   //   Itsef: more than one implementors.
  75   ciInstanceKlass*       _implementor;
  76 
  77   void compute_injected_fields();
  78   bool compute_injected_fields_helper();
  79   void compute_object_fields();
  80 
  81 protected:
  82   ciInstanceKlass(Klass* k);
  83   ciInstanceKlass(ciSymbol* name, jobject loader, jobject protection_domain);
  84 
  85   InstanceKlass* get_instanceKlass() const {
  86     return InstanceKlass::cast(get_Klass());
  87   }
  88 
  89   oop loader();
  90   jobject loader_handle();
  91 
  92   oop protection_domain();
  93   jobject protection_domain_handle();
  94 
  95   const char* type_string() { return "ciInstanceKlass"; }
  96 
  97   bool is_in_package_impl(const char* packagename, int len);
  98 
  99   void print_impl(outputStream* st);


 187 
 188   ciInstanceKlass* get_canonical_holder(int offset);
 189   ciField* get_field_by_offset(int field_offset, bool is_static);
 190   ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
 191 
 192   // total number of nonstatic fields (including inherited):
 193   int nof_nonstatic_fields() {
 194     if (_nonstatic_fields == NULL)
 195       return compute_nonstatic_fields();
 196     else
 197       return _nonstatic_fields->length();
 198   }
 199 
 200   bool has_injected_fields() {
 201     if (_has_injected_fields == -1) {
 202       compute_injected_fields();
 203     }
 204     return _has_injected_fields > 0 ? true : false;
 205   }
 206 
 207   bool has_object_fields() {
 208     if (_has_object_fields == -1) {
 209       compute_object_fields();
 210     }
 211     return _has_object_fields > 0 ? true : false;
 212   }
 213 
 214   // nth nonstatic field (presented by ascending address)
 215   ciField* nonstatic_field_at(int i) {
 216     assert(_nonstatic_fields != NULL, "");
 217     return _nonstatic_fields->at(i);
 218   }
 219 
 220   ciInstanceKlass* unique_concrete_subklass();
 221   bool has_finalizable_subclass();
 222 
 223   bool contains_field_offset(int offset) {
 224     return instanceOopDesc::contains_field_offset(offset, nonstatic_field_size());
 225   }
 226 
 227   // Get the instance of java.lang.Class corresponding to
 228   // this klass.  This instance is used for locking of
 229   // synchronized static methods of this klass.
 230   ciInstance*            java_mirror();
 231 
 232   // Java access flags
 233   bool is_public      () { return flags().is_public(); }


 261   // What kind of ciObject is this?
 262   bool is_instance_klass() const { return true; }
 263   bool is_java_klass() const     { return true; }
 264 
 265   virtual ciKlass* exact_klass() {
 266     if (is_loaded() && is_final() && !is_interface()) {
 267       return this;
 268     }
 269     return NULL;
 270   }
 271 
 272   ciInstanceKlass* host_klass();
 273 
 274   bool can_be_instantiated() {
 275     assert(is_loaded(), "must be loaded");
 276     return !is_interface() && !is_abstract();
 277   }
 278 
 279   // Dump the current state of this klass for compilation replay.
 280   virtual void dump_replay_data(outputStream* out);
 281 
 282 #ifdef ASSERT
 283   bool debug_final_field_at(int offset);
 284   bool debug_stable_field_at(int offset);
 285 #endif
 286 };
 287 
 288 #endif // SHARE_VM_CI_CIINSTANCEKLASS_HPP
< prev index next >