comparison src/share/vm/ci/ciEnv.hpp @ 6948:e522a00b91aa

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Nov 2012 23:14:12 +0100
parents c38f13903fdf 137868b7aa6f
children 2cb439954abf
comparison
equal deleted inserted replaced
6711:ae13cc658b80 6948:e522a00b91aa
43 class ciEnv : StackObj { 43 class ciEnv : StackObj {
44 CI_PACKAGE_ACCESS_TO 44 CI_PACKAGE_ACCESS_TO
45 45
46 friend class CompileBroker; 46 friend class CompileBroker;
47 friend class Dependencies; // for get_object, during logging 47 friend class Dependencies; // for get_object, during logging
48 48 #ifdef GRAAL
49 friend class CodeInstaller;
50 #endif
49 private: 51 private:
50 Arena* _arena; // Alias for _ciEnv_arena except in init_shared_objects() 52 Arena* _arena; // Alias for _ciEnv_arena except in init_shared_objects()
51 Arena _ciEnv_arena; 53 Arena _ciEnv_arena;
52 int _system_dictionary_modification_counter; 54 int _system_dictionary_modification_counter;
53 ciObjectFactory* _factory; 55 ciObjectFactory* _factory;
76 bool _dtrace_method_probes; 78 bool _dtrace_method_probes;
77 bool _dtrace_alloc_probes; 79 bool _dtrace_alloc_probes;
78 80
79 // Distinguished instances of certain ciObjects.. 81 // Distinguished instances of certain ciObjects..
80 static ciObject* _null_object_instance; 82 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 83
87 #define WK_KLASS_DECL(name, ignore_s, ignore_o) static ciInstanceKlass* _##name; 84 #define WK_KLASS_DECL(name, ignore_s, ignore_o) static ciInstanceKlass* _##name;
88 WK_KLASSES_DO(WK_KLASS_DECL) 85 WK_KLASSES_DO(WK_KLASS_DECL)
89 #undef WK_KLASS_DECL 86 #undef WK_KLASS_DECL
90 87
157 int method_index, Bytecodes::Code bc, 154 int method_index, Bytecodes::Code bc,
158 ciInstanceKlass* loading_klass); 155 ciInstanceKlass* loading_klass);
159 156
160 // Helper methods 157 // Helper methods
161 bool check_klass_accessibility(ciKlass* accessing_klass, 158 bool check_klass_accessibility(ciKlass* accessing_klass,
162 klassOop resolved_klassOop); 159 Klass* resolved_klass);
163 methodOop lookup_method(instanceKlass* accessor, 160 Method* lookup_method(InstanceKlass* accessor,
164 instanceKlass* holder, 161 InstanceKlass* holder,
165 Symbol* name, 162 Symbol* name,
166 Symbol* sig, 163 Symbol* sig,
167 Bytecodes::Code bc); 164 Bytecodes::Code bc);
168 165
169 public: 166 public:
185 } else { 182 } else {
186 return _factory->get_symbol(o); 183 return _factory->get_symbol(o);
187 } 184 }
188 } 185 }
189 186
190 ciMethod* get_method_from_handle(jobject method); 187 ciMetadata* get_metadata(Metadata* o) {
188 if (o == NULL) {
189 return NULL;
190 } else {
191 return _factory->get_metadata(o);
192 }
193 }
194
195 ciInstance* get_instance(oop o) {
196 if (o == NULL) return NULL;
197 return get_object(o)->as_instance();
198 }
199 ciObjArrayKlass* get_obj_array_klass(Klass* o) {
200 if (o == NULL) return NULL;
201 return get_metadata(o)->as_obj_array_klass();
202 }
203 ciTypeArrayKlass* get_type_array_klass(Klass* o) {
204 if (o == NULL) return NULL;
205 return get_metadata(o)->as_type_array_klass();
206 }
207 ciKlass* get_klass(Klass* o) {
208 if (o == NULL) return NULL;
209 return get_metadata(o)->as_klass();
210 }
211 ciInstanceKlass* get_instance_klass(Klass* o) {
212 if (o == NULL) return NULL;
213 return get_metadata(o)->as_instance_klass();
214 }
215 ciMethod* get_method(Method* o) {
216 if (o == NULL) return NULL;
217 return get_metadata(o)->as_method();
218 }
219 ciMethodData* get_method_data(MethodData* o) {
220 if (o == NULL) return NULL;
221 return get_metadata(o)->as_method_data();
222 }
223
224 ciMethod* get_method_from_handle(Method* method);
191 225
192 ciInstance* get_or_create_exception(jobject& handle, Symbol* name); 226 ciInstance* get_or_create_exception(jobject& handle, Symbol* name);
193 227
194 // Get a ciMethod representing either an unfound method or 228 // Get a ciMethod representing either an unfound method or
195 // a method with an unloaded holder. Ensures uniqueness of 229 // a method with an unloaded holder. Ensures uniqueness of
334 OopMapSet* oop_map_set, 368 OopMapSet* oop_map_set,
335 ExceptionHandlerTable* handler_table, 369 ExceptionHandlerTable* handler_table,
336 ImplicitExceptionTable* inc_table, 370 ImplicitExceptionTable* inc_table,
337 AbstractCompiler* compiler, 371 AbstractCompiler* compiler,
338 int comp_level, 372 int comp_level,
339 bool has_unsafe_access); 373 bool has_unsafe_access,
374 bool has_wide_vectors);
340 375
341 376
342 // Access to certain well known ciObjects. 377 // Access to certain well known ciObjects.
343 #define WK_KLASS_FUNC(name, ignore_s, ignore_o) \ 378 #define WK_KLASS_FUNC(name, ignore_s, ignore_o) \
344 ciInstanceKlass* name() { \ 379 ciInstanceKlass* name() { \
375 } 410 }
376 411
377 ciKlass* find_system_klass(ciSymbol* klass_name); 412 ciKlass* find_system_klass(ciSymbol* klass_name);
378 // Note: To find a class from its name string, use ciSymbol::make, 413 // Note: To find a class from its name string, use ciSymbol::make,
379 // but consider adding to vmSymbols.hpp instead. 414 // but consider adding to vmSymbols.hpp instead.
380
381 // Use this to make a holder for non-perm compile time constants.
382 // The resulting array is guaranteed to satisfy "can_be_constant".
383 ciArray* make_system_array(GrowableArray<ciObject*>* objects);
384 415
385 // converts the ciKlass* representing the holder of a method into a 416 // converts the ciKlass* representing the holder of a method into a
386 // ciInstanceKlass*. This is needed since the holder of a method in 417 // ciInstanceKlass*. This is needed since the holder of a method in
387 // the bytecodes could be an array type. Basically this converts 418 // the bytecodes could be an array type. Basically this converts
388 // array types into java/lang/Object and other types stay as they are. 419 // array types into java/lang/Object and other types stay as they are.
420 bool system_dictionary_modification_counter_changed(); 451 bool system_dictionary_modification_counter_changed();
421 452
422 void record_failure(const char* reason); 453 void record_failure(const char* reason);
423 void record_method_not_compilable(const char* reason, bool all_tiers = true); 454 void record_method_not_compilable(const char* reason, bool all_tiers = true);
424 void record_out_of_memory_failure(); 455 void record_out_of_memory_failure();
456
457 // RedefineClasses support
458 void metadata_do(void f(Metadata*)) { _factory->metadata_do(f); }
425 }; 459 };
426 460
427 #endif // SHARE_VM_CI_CIENV_HPP 461 #endif // SHARE_VM_CI_CIENV_HPP