76 bool _dtrace_method_probes; |
76 bool _dtrace_method_probes; |
77 bool _dtrace_alloc_probes; |
77 bool _dtrace_alloc_probes; |
78 |
78 |
79 // Distinguished instances of certain ciObjects.. |
79 // Distinguished instances of certain ciObjects.. |
80 static ciObject* _null_object_instance; |
80 static ciObject* _null_object_instance; |
81 static ciMethodKlass* _method_klass_instance; |
|
82 static ciKlassKlass* _klass_klass_instance; |
|
83 static ciInstanceKlassKlass* _instance_klass_klass_instance; |
|
84 static ciTypeArrayKlassKlass* _type_array_klass_klass_instance; |
|
85 static ciObjArrayKlassKlass* _obj_array_klass_klass_instance; |
|
86 |
81 |
87 #define WK_KLASS_DECL(name, ignore_s, ignore_o) static ciInstanceKlass* _##name; |
82 #define WK_KLASS_DECL(name, ignore_s, ignore_o) static ciInstanceKlass* _##name; |
88 WK_KLASSES_DO(WK_KLASS_DECL) |
83 WK_KLASSES_DO(WK_KLASS_DECL) |
89 #undef WK_KLASS_DECL |
84 #undef WK_KLASS_DECL |
90 |
85 |
153 int method_index, Bytecodes::Code bc, |
148 int method_index, Bytecodes::Code bc, |
154 ciInstanceKlass* loading_klass); |
149 ciInstanceKlass* loading_klass); |
155 |
150 |
156 // Helper methods |
151 // Helper methods |
157 bool check_klass_accessibility(ciKlass* accessing_klass, |
152 bool check_klass_accessibility(ciKlass* accessing_klass, |
158 klassOop resolved_klassOop); |
153 Klass* resolved_klass); |
159 methodOop lookup_method(instanceKlass* accessor, |
154 Method* lookup_method(InstanceKlass* accessor, |
160 instanceKlass* holder, |
155 InstanceKlass* holder, |
161 Symbol* name, |
156 Symbol* name, |
162 Symbol* sig, |
157 Symbol* sig, |
163 Bytecodes::Code bc); |
158 Bytecodes::Code bc); |
164 |
159 |
165 // Get a ciObject from the object factory. Ensures uniqueness |
160 // Get a ciObject from the object factory. Ensures uniqueness |
179 } else { |
174 } else { |
180 return _factory->get_symbol(o); |
175 return _factory->get_symbol(o); |
181 } |
176 } |
182 } |
177 } |
183 |
178 |
184 ciMethod* get_method_from_handle(jobject method); |
179 ciMetadata* get_metadata(Metadata* o) { |
|
180 if (o == NULL) { |
|
181 return NULL; |
|
182 } else { |
|
183 return _factory->get_metadata(o); |
|
184 } |
|
185 } |
|
186 |
|
187 ciInstance* get_instance(oop o) { |
|
188 if (o == NULL) return NULL; |
|
189 return get_object(o)->as_instance(); |
|
190 } |
|
191 ciObjArrayKlass* get_obj_array_klass(Klass* o) { |
|
192 if (o == NULL) return NULL; |
|
193 return get_metadata(o)->as_obj_array_klass(); |
|
194 } |
|
195 ciTypeArrayKlass* get_type_array_klass(Klass* o) { |
|
196 if (o == NULL) return NULL; |
|
197 return get_metadata(o)->as_type_array_klass(); |
|
198 } |
|
199 ciKlass* get_klass(Klass* o) { |
|
200 if (o == NULL) return NULL; |
|
201 return get_metadata(o)->as_klass(); |
|
202 } |
|
203 ciInstanceKlass* get_instance_klass(Klass* o) { |
|
204 if (o == NULL) return NULL; |
|
205 return get_metadata(o)->as_instance_klass(); |
|
206 } |
|
207 ciMethod* get_method(Method* o) { |
|
208 if (o == NULL) return NULL; |
|
209 return get_metadata(o)->as_method(); |
|
210 } |
|
211 ciMethodData* get_method_data(MethodData* o) { |
|
212 if (o == NULL) return NULL; |
|
213 return get_metadata(o)->as_method_data(); |
|
214 } |
|
215 |
|
216 ciMethod* get_method_from_handle(Method* method); |
185 |
217 |
186 ciInstance* get_or_create_exception(jobject& handle, Symbol* name); |
218 ciInstance* get_or_create_exception(jobject& handle, Symbol* name); |
187 |
219 |
188 // Get a ciMethod representing either an unfound method or |
220 // Get a ciMethod representing either an unfound method or |
189 // a method with an unloaded holder. Ensures uniqueness of |
221 // a method with an unloaded holder. Ensures uniqueness of |
370 |
402 |
371 ciKlass* find_system_klass(ciSymbol* klass_name); |
403 ciKlass* find_system_klass(ciSymbol* klass_name); |
372 // Note: To find a class from its name string, use ciSymbol::make, |
404 // Note: To find a class from its name string, use ciSymbol::make, |
373 // but consider adding to vmSymbols.hpp instead. |
405 // but consider adding to vmSymbols.hpp instead. |
374 |
406 |
375 // Use this to make a holder for non-perm compile time constants. |
|
376 // The resulting array is guaranteed to satisfy "can_be_constant". |
|
377 ciArray* make_system_array(GrowableArray<ciObject*>* objects); |
|
378 |
|
379 // converts the ciKlass* representing the holder of a method into a |
407 // converts the ciKlass* representing the holder of a method into a |
380 // ciInstanceKlass*. This is needed since the holder of a method in |
408 // ciInstanceKlass*. This is needed since the holder of a method in |
381 // the bytecodes could be an array type. Basically this converts |
409 // the bytecodes could be an array type. Basically this converts |
382 // array types into java/lang/Object and other types stay as they are. |
410 // array types into java/lang/Object and other types stay as they are. |
383 static ciInstanceKlass* get_instance_klass_for_declared_method_holder(ciKlass* klass); |
411 static ciInstanceKlass* get_instance_klass_for_declared_method_holder(ciKlass* klass); |
414 bool system_dictionary_modification_counter_changed(); |
442 bool system_dictionary_modification_counter_changed(); |
415 |
443 |
416 void record_failure(const char* reason); |
444 void record_failure(const char* reason); |
417 void record_method_not_compilable(const char* reason, bool all_tiers = true); |
445 void record_method_not_compilable(const char* reason, bool all_tiers = true); |
418 void record_out_of_memory_failure(); |
446 void record_out_of_memory_failure(); |
|
447 |
|
448 // RedefineClasses support |
|
449 void metadata_do(void f(Metadata*)) { _factory->metadata_do(f); } |
419 }; |
450 }; |
420 |
451 |
421 #endif // SHARE_VM_CI_CIENV_HPP |
452 #endif // SHARE_VM_CI_CIENV_HPP |