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
68 // The possible values of the _implementor fall into following three cases:
69 // NULL: no implementor.
70 // A ciInstanceKlass that's not itself: one implementor.
71 // Itsef: more than one implementors.
72 ciInstanceKlass* _implementor;
73
74 protected:
75 ciInstanceKlass(KlassHandle h_k);
76 ciInstanceKlass(ciSymbol* name, jobject loader, jobject protection_domain);
77
78 InstanceKlass* get_instanceKlass() const {
79 return (InstanceKlass*)get_Klass();
80 }
81
82 oop loader();
83 jobject loader_handle();
84
85 oop protection_domain();
86 jobject protection_domain_handle();
87
88 const char* type_string() { return "ciInstanceKlass"; }
89
90 bool is_in_package_impl(const char* packagename, int len);
91
92 void print_impl(outputStream* st);
93
169 return 2;
170 }
171 }
172
173 bool has_default_methods() {
174 assert(is_loaded(), "must be loaded");
175 return _has_default_methods;
176 }
177
178 ciInstanceKlass* get_canonical_holder(int offset);
179 ciField* get_field_by_offset(int field_offset, bool is_static);
180 ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
181
182 // total number of nonstatic fields (including inherited):
183 int nof_nonstatic_fields() {
184 if (_nonstatic_fields == NULL)
185 return compute_nonstatic_fields();
186 else
187 return _nonstatic_fields->length();
188 }
189 // nth nonstatic field (presented by ascending address)
190 ciField* nonstatic_field_at(int i) {
191 assert(_nonstatic_fields != NULL, "");
192 return _nonstatic_fields->at(i);
193 }
194
195 ciInstanceKlass* unique_concrete_subklass();
196 bool has_finalizable_subclass();
197
198 bool contains_field_offset(int offset) {
199 return instanceOopDesc::contains_field_offset(offset, nonstatic_field_size());
200 }
201
202 // Get the instance of java.lang.Class corresponding to
203 // this klass. This instance is used for locking of
204 // synchronized static methods of this klass.
205 ciInstance* java_mirror();
206
207 // Java access flags
208 bool is_public () { return flags().is_public(); }
|
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 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);
97
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 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.
217 ciInstance* java_mirror();
218
219 // Java access flags
220 bool is_public () { return flags().is_public(); }
|