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 bool compute_injected_fields();
76 void compute_injected_fields_helper();
77
78 protected:
79 ciInstanceKlass(KlassHandle h_k);
80 ciInstanceKlass(ciSymbol* name, jobject loader, jobject protection_domain);
81
82 InstanceKlass* get_instanceKlass() const {
83 return (InstanceKlass*)get_Klass();
84 }
85
86 oop loader();
87 jobject loader_handle();
88
89 oop protection_domain();
90 jobject protection_domain_handle();
91
92 const char* type_string() { return "ciInstanceKlass"; }
93
94 bool is_in_package_impl(const char* packagename, int len);
95
96 void print_impl(outputStream* st);
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 return compute_injected_fields();
197 }
198 return _has_injected_fields > 0 ? true : false;
199 }
200
201 // nth nonstatic field (presented by ascending address)
202 ciField* nonstatic_field_at(int i) {
203 assert(_nonstatic_fields != NULL, "");
204 return _nonstatic_fields->at(i);
205 }
206
207 ciInstanceKlass* unique_concrete_subklass();
208 bool has_finalizable_subclass();
209
210 bool contains_field_offset(int offset) {
211 return instanceOopDesc::contains_field_offset(offset, nonstatic_field_size());
212 }
213
214 // Get the instance of java.lang.Class corresponding to
215 // this klass. This instance is used for locking of
216 // synchronized static methods of this klass.
|
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();
76 bool compute_injected_fields_helper();
77
78 protected:
79 ciInstanceKlass(KlassHandle h_k);
80 ciInstanceKlass(ciSymbol* name, jobject loader, jobject protection_domain);
81
82 InstanceKlass* get_instanceKlass() const {
83 return (InstanceKlass*)get_Klass();
84 }
85
86 oop loader();
87 jobject loader_handle();
88
89 oop protection_domain();
90 jobject protection_domain_handle();
91
92 const char* type_string() { return "ciInstanceKlass"; }
93
94 bool is_in_package_impl(const char* packagename, int len);
95
96 void print_impl(outputStream* st);
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)
202 ciField* nonstatic_field_at(int i) {
203 assert(_nonstatic_fields != NULL, "");
204 return _nonstatic_fields->at(i);
205 }
206
207 ciInstanceKlass* unique_concrete_subklass();
208 bool has_finalizable_subclass();
209
210 bool contains_field_offset(int offset) {
211 return instanceOopDesc::contains_field_offset(offset, nonstatic_field_size());
212 }
213
214 // Get the instance of java.lang.Class corresponding to
215 // this klass. This instance is used for locking of
216 // synchronized static methods of this klass.
|