46 CI_PACKAGE_ACCESS_TO
47
48 friend class CompileBroker;
49 friend class Dependencies; // for get_object, during logging
50
51 private:
52 Arena* _arena; // Alias for _ciEnv_arena except in init_shared_objects()
53 Arena _ciEnv_arena;
54 int _system_dictionary_modification_counter;
55 ciObjectFactory* _factory;
56 OopRecorder* _oop_recorder;
57 DebugInformationRecorder* _debug_info;
58 Dependencies* _dependencies;
59 const char* _failure_reason;
60 int _compilable;
61 bool _break_at_compile;
62 int _num_inlined_bytecodes;
63 CompileTask* _task; // faster access to CompilerThread::task
64 CompileLog* _log; // faster access to CompilerThread::log
65 void* _compiler_data; // compiler-specific stuff, if any
66
67 char* _name_buffer;
68 int _name_buffer_len;
69
70 // Cache Jvmti state
71 bool _jvmti_can_hotswap_or_post_breakpoint;
72 bool _jvmti_can_access_local_variables;
73 bool _jvmti_can_post_on_exceptions;
74 bool _jvmti_can_pop_frame;
75
76 // Cache DTrace flags
77 bool _dtrace_extended_probes;
78 bool _dtrace_monitor_probes;
79 bool _dtrace_method_probes;
80 bool _dtrace_alloc_probes;
81
82 // Distinguished instances of certain ciObjects..
83 static ciObject* _null_object_instance;
84
85 #define WK_KLASS_DECL(name, ignore_s, ignore_o) static ciInstanceKlass* _##name;
279 }
280
281 // General utility : get a buffer of some required length.
282 // Used in symbol creation.
283 char* name_buffer(int req_len);
284
285 // Is this thread currently in the VM state?
286 static bool is_in_vm();
287
288 // Helper routine for determining the validity of a compilation with
289 // respect to method dependencies (e.g. concurrent class loading).
290 void validate_compile_task_dependencies(ciMethod* target);
291
292 public:
293 enum {
294 MethodCompilable,
295 MethodCompilable_not_at_tier,
296 MethodCompilable_never
297 };
298
299 ciEnv(CompileTask* task, int system_dictionary_modification_counter);
300 // Used only during initialization of the ci
301 ciEnv(Arena* arena);
302 ~ciEnv();
303
304 OopRecorder* oop_recorder() { return _oop_recorder; }
305 void set_oop_recorder(OopRecorder* r) { _oop_recorder = r; }
306
307 DebugInformationRecorder* debug_info() { return _debug_info; }
308 void set_debug_info(DebugInformationRecorder* i) { _debug_info = i; }
309
310 Dependencies* dependencies() { return _dependencies; }
311 void set_dependencies(Dependencies* d) { _dependencies = d; }
312
313 // This is true if the compilation is not going to produce code.
314 // (It is reasonable to retry failed compilations.)
315 bool failing() { return _failure_reason != NULL; }
316
317 // Reason this compilation is failing, such as "too many basic blocks".
318 const char* failure_reason() { return _failure_reason; }
319
337 bool break_at_compile() { return _break_at_compile; }
338 void set_break_at_compile(bool z) { _break_at_compile = z; }
339
340 // Cache Jvmti state
341 void cache_jvmti_state();
342 bool jvmti_state_changed() const;
343 bool should_retain_local_variables() const;
344 bool jvmti_can_hotswap_or_post_breakpoint() const { return _jvmti_can_hotswap_or_post_breakpoint; }
345 bool jvmti_can_post_on_exceptions() const { return _jvmti_can_post_on_exceptions; }
346
347 // Cache DTrace flags
348 void cache_dtrace_flags();
349 bool dtrace_extended_probes() const { return _dtrace_extended_probes; }
350 bool dtrace_monitor_probes() const { return _dtrace_monitor_probes; }
351 bool dtrace_method_probes() const { return _dtrace_method_probes; }
352 bool dtrace_alloc_probes() const { return _dtrace_alloc_probes; }
353
354 // The compiler task which has created this env.
355 // May be useful to find out compile_id, comp_level, etc.
356 CompileTask* task() { return _task; }
357
358 // Handy forwards to the task:
359 int comp_level(); // task()->comp_level()
360 uint compile_id(); // task()->compile_id()
361
362 // Register the result of a compilation.
363 void register_method(ciMethod* target,
364 int entry_bci,
365 CodeOffsets* offsets,
366 int orig_pc_offset,
367 CodeBuffer* code_buffer,
368 int frame_words,
369 OopMapSet* oop_map_set,
370 ExceptionHandlerTable* handler_table,
371 ImplicitExceptionTable* inc_table,
372 AbstractCompiler* compiler,
373 bool has_unsafe_access,
374 bool has_wide_vectors,
375 DirectiveSet* directives,
376 RTMState rtm_state = NoRTM);
|
46 CI_PACKAGE_ACCESS_TO
47
48 friend class CompileBroker;
49 friend class Dependencies; // for get_object, during logging
50
51 private:
52 Arena* _arena; // Alias for _ciEnv_arena except in init_shared_objects()
53 Arena _ciEnv_arena;
54 int _system_dictionary_modification_counter;
55 ciObjectFactory* _factory;
56 OopRecorder* _oop_recorder;
57 DebugInformationRecorder* _debug_info;
58 Dependencies* _dependencies;
59 const char* _failure_reason;
60 int _compilable;
61 bool _break_at_compile;
62 int _num_inlined_bytecodes;
63 CompileTask* _task; // faster access to CompilerThread::task
64 CompileLog* _log; // faster access to CompilerThread::log
65 void* _compiler_data; // compiler-specific stuff, if any
66 DirectiveSet* _directive;
67
68 char* _name_buffer;
69 int _name_buffer_len;
70
71 // Cache Jvmti state
72 bool _jvmti_can_hotswap_or_post_breakpoint;
73 bool _jvmti_can_access_local_variables;
74 bool _jvmti_can_post_on_exceptions;
75 bool _jvmti_can_pop_frame;
76
77 // Cache DTrace flags
78 bool _dtrace_extended_probes;
79 bool _dtrace_monitor_probes;
80 bool _dtrace_method_probes;
81 bool _dtrace_alloc_probes;
82
83 // Distinguished instances of certain ciObjects..
84 static ciObject* _null_object_instance;
85
86 #define WK_KLASS_DECL(name, ignore_s, ignore_o) static ciInstanceKlass* _##name;
280 }
281
282 // General utility : get a buffer of some required length.
283 // Used in symbol creation.
284 char* name_buffer(int req_len);
285
286 // Is this thread currently in the VM state?
287 static bool is_in_vm();
288
289 // Helper routine for determining the validity of a compilation with
290 // respect to method dependencies (e.g. concurrent class loading).
291 void validate_compile_task_dependencies(ciMethod* target);
292
293 public:
294 enum {
295 MethodCompilable,
296 MethodCompilable_not_at_tier,
297 MethodCompilable_never
298 };
299
300 ciEnv(CompileTask* task, int system_dictionary_modification_counter, DirectiveSet* set);
301 // Used only during initialization of the ci
302 ciEnv(Arena* arena);
303 ~ciEnv();
304
305 OopRecorder* oop_recorder() { return _oop_recorder; }
306 void set_oop_recorder(OopRecorder* r) { _oop_recorder = r; }
307
308 DebugInformationRecorder* debug_info() { return _debug_info; }
309 void set_debug_info(DebugInformationRecorder* i) { _debug_info = i; }
310
311 Dependencies* dependencies() { return _dependencies; }
312 void set_dependencies(Dependencies* d) { _dependencies = d; }
313
314 // This is true if the compilation is not going to produce code.
315 // (It is reasonable to retry failed compilations.)
316 bool failing() { return _failure_reason != NULL; }
317
318 // Reason this compilation is failing, such as "too many basic blocks".
319 const char* failure_reason() { return _failure_reason; }
320
338 bool break_at_compile() { return _break_at_compile; }
339 void set_break_at_compile(bool z) { _break_at_compile = z; }
340
341 // Cache Jvmti state
342 void cache_jvmti_state();
343 bool jvmti_state_changed() const;
344 bool should_retain_local_variables() const;
345 bool jvmti_can_hotswap_or_post_breakpoint() const { return _jvmti_can_hotswap_or_post_breakpoint; }
346 bool jvmti_can_post_on_exceptions() const { return _jvmti_can_post_on_exceptions; }
347
348 // Cache DTrace flags
349 void cache_dtrace_flags();
350 bool dtrace_extended_probes() const { return _dtrace_extended_probes; }
351 bool dtrace_monitor_probes() const { return _dtrace_monitor_probes; }
352 bool dtrace_method_probes() const { return _dtrace_method_probes; }
353 bool dtrace_alloc_probes() const { return _dtrace_alloc_probes; }
354
355 // The compiler task which has created this env.
356 // May be useful to find out compile_id, comp_level, etc.
357 CompileTask* task() { return _task; }
358 DirectiveSet* directive() { return _directive; }
359
360 // Handy forwards to the task:
361 int comp_level(); // task()->comp_level()
362 uint compile_id(); // task()->compile_id()
363
364 // Register the result of a compilation.
365 void register_method(ciMethod* target,
366 int entry_bci,
367 CodeOffsets* offsets,
368 int orig_pc_offset,
369 CodeBuffer* code_buffer,
370 int frame_words,
371 OopMapSet* oop_map_set,
372 ExceptionHandlerTable* handler_table,
373 ImplicitExceptionTable* inc_table,
374 AbstractCompiler* compiler,
375 bool has_unsafe_access,
376 bool has_wide_vectors,
377 DirectiveSet* directives,
378 RTMState rtm_state = NoRTM);
|