15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_CI_CIENV_HPP
26 #define SHARE_VM_CI_CIENV_HPP
27
28 #include "ci/ciClassList.hpp"
29 #include "ci/ciObjectFactory.hpp"
30 #include "classfile/systemDictionary.hpp"
31 #include "code/debugInfoRec.hpp"
32 #include "code/dependencies.hpp"
33 #include "code/exceptionHandlerTable.hpp"
34 #include "compiler/oopMap.hpp"
35 #include "runtime/thread.hpp"
36
37 class CompileTask;
38
39 // ciEnv
40 //
41 // This class is the top level broker for requests from the compiler
42 // to the VM.
43 class ciEnv : StackObj {
44 CI_PACKAGE_ACCESS_TO
45
46 friend class CompileBroker;
47 friend class Dependencies; // for get_object, during logging
48
49 private:
50 Arena* _arena; // Alias for _ciEnv_arena except in init_shared_objects()
51 Arena _ciEnv_arena;
52 int _system_dictionary_modification_counter;
53 ciObjectFactory* _factory;
54 OopRecorder* _oop_recorder;
55 DebugInformationRecorder* _debug_info;
56 Dependencies* _dependencies;
57 const char* _failure_reason;
335 bool break_at_compile() { return _break_at_compile; }
336 void set_break_at_compile(bool z) { _break_at_compile = z; }
337
338 // Cache Jvmti state
339 void cache_jvmti_state();
340 bool jvmti_state_changed() const;
341 bool should_retain_local_variables() const;
342 bool jvmti_can_hotswap_or_post_breakpoint() const { return _jvmti_can_hotswap_or_post_breakpoint; }
343 bool jvmti_can_post_on_exceptions() const { return _jvmti_can_post_on_exceptions; }
344
345 // Cache DTrace flags
346 void cache_dtrace_flags();
347 bool dtrace_extended_probes() const { return _dtrace_extended_probes; }
348 bool dtrace_monitor_probes() const { return _dtrace_monitor_probes; }
349 bool dtrace_method_probes() const { return _dtrace_method_probes; }
350 bool dtrace_alloc_probes() const { return _dtrace_alloc_probes; }
351
352 // The compiler task which has created this env.
353 // May be useful to find out compile_id, comp_level, etc.
354 CompileTask* task() { return _task; }
355 // Handy forwards to the task:
356 int comp_level(); // task()->comp_level()
357 uint compile_id(); // task()->compile_id()
358
359 // Register the result of a compilation.
360 void register_method(ciMethod* target,
361 int entry_bci,
362 CodeOffsets* offsets,
363 int orig_pc_offset,
364 CodeBuffer* code_buffer,
365 int frame_words,
366 OopMapSet* oop_map_set,
367 ExceptionHandlerTable* handler_table,
368 ImplicitExceptionTable* inc_table,
369 AbstractCompiler* compiler,
370 int comp_level,
371 bool has_unsafe_access,
372 bool has_wide_vectors,
373 RTMState rtm_state = NoRTM);
374
375
376 // Access to certain well known ciObjects.
377 #define WK_KLASS_FUNC(name, ignore_s, ignore_o) \
378 ciInstanceKlass* name() { \
379 return _##name;\
380 }
381 WK_KLASSES_DO(WK_KLASS_FUNC)
382 #undef WK_KLASS_FUNC
383
384 ciInstance* NullPointerException_instance() {
385 assert(_NullPointerException_instance != NULL, "initialization problem");
386 return _NullPointerException_instance;
387 }
388 ciInstance* ArithmeticException_instance() {
389 assert(_ArithmeticException_instance != NULL, "initialization problem");
390 return _ArithmeticException_instance;
391 }
392
|
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_CI_CIENV_HPP
26 #define SHARE_VM_CI_CIENV_HPP
27
28 #include "ci/ciClassList.hpp"
29 #include "ci/ciObjectFactory.hpp"
30 #include "classfile/systemDictionary.hpp"
31 #include "code/debugInfoRec.hpp"
32 #include "code/dependencies.hpp"
33 #include "code/exceptionHandlerTable.hpp"
34 #include "compiler/oopMap.hpp"
35 #include "compiler/compilerDirectives.hpp"
36 #include "runtime/thread.hpp"
37
38 class CompileTask;
39 class DirectiveSet;
40
41 // ciEnv
42 //
43 // This class is the top level broker for requests from the compiler
44 // to the VM.
45 class ciEnv : StackObj {
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;
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);
377
378
379 // Access to certain well known ciObjects.
380 #define WK_KLASS_FUNC(name, ignore_s, ignore_o) \
381 ciInstanceKlass* name() { \
382 return _##name;\
383 }
384 WK_KLASSES_DO(WK_KLASS_FUNC)
385 #undef WK_KLASS_FUNC
386
387 ciInstance* NullPointerException_instance() {
388 assert(_NullPointerException_instance != NULL, "initialization problem");
389 return _NullPointerException_instance;
390 }
391 ciInstance* ArithmeticException_instance() {
392 assert(_ArithmeticException_instance != NULL, "initialization problem");
393 return _ArithmeticException_instance;
394 }
395
|