23 |
23 |
24 #ifndef SHARE_JVMCI_JVMCICOMPILER_HPP |
24 #ifndef SHARE_JVMCI_JVMCICOMPILER_HPP |
25 #define SHARE_JVMCI_JVMCICOMPILER_HPP |
25 #define SHARE_JVMCI_JVMCICOMPILER_HPP |
26 |
26 |
27 #include "compiler/abstractCompiler.hpp" |
27 #include "compiler/abstractCompiler.hpp" |
28 #include "jvmci/jvmciEnv.hpp" |
|
29 #include "utilities/exceptions.hpp" |
|
30 |
28 |
31 class JVMCICompiler : public AbstractCompiler { |
29 class JVMCICompiler : public AbstractCompiler { |
32 private: |
30 private: |
33 bool _bootstrapping; |
31 bool _bootstrapping; |
34 |
32 |
63 THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "The JVMCI compiler instance has not been created"); |
61 THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "The JVMCI compiler instance has not been created"); |
64 } |
62 } |
65 return _instance; |
63 return _instance; |
66 } |
64 } |
67 |
65 |
68 virtual const char* name() { return "JVMCI"; } |
66 virtual const char* name() { return UseJVMCINativeLibrary ? "JVMCI-native" : "JVMCI"; } |
69 |
67 |
70 virtual bool supports_native() { return true; } |
68 virtual bool supports_native() { return true; } |
71 virtual bool supports_osr () { return true; } |
69 virtual bool supports_osr () { return true; } |
72 |
70 |
73 bool is_jvmci() { return true; } |
71 bool is_jvmci() { return true; } |
88 // Should force compilation of method at CompLevel_simple? |
86 // Should force compilation of method at CompLevel_simple? |
89 bool force_comp_at_level_simple(Method* method); |
87 bool force_comp_at_level_simple(Method* method); |
90 |
88 |
91 bool is_bootstrapping() const { return _bootstrapping; } |
89 bool is_bootstrapping() const { return _bootstrapping; } |
92 |
90 |
|
91 void set_bootstrap_compilation_request_handled() { |
|
92 _instance->_bootstrap_compilation_request_handled = true; |
|
93 } |
|
94 |
93 // Compilation entry point for methods |
95 // Compilation entry point for methods |
94 virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci, DirectiveSet* directive); |
96 virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci, DirectiveSet* directive); |
95 |
|
96 void compile_method(const methodHandle& target, int entry_bci, JVMCIEnv* env); |
|
97 |
97 |
98 // Print compilation timers and statistics |
98 // Print compilation timers and statistics |
99 virtual void print_timers(); |
99 virtual void print_timers(); |
100 |
100 |
101 /** |
101 /** |
102 * Gets the number of methods that have been successfully compiled by |
102 * Gets the number of methods that have been successfully compiled by |
103 * a call to JVMCICompiler::compile_method(). |
103 * a call to JVMCICompiler::compile_method(). |
104 */ |
104 */ |
105 int methods_compiled() { return _methods_compiled; } |
105 int methods_compiled() { return _methods_compiled; } |
106 |
106 |
|
107 void inc_methods_compiled() { |
|
108 Atomic::inc(&_methods_compiled); |
|
109 } |
|
110 |
107 // Print compilation timers and statistics |
111 // Print compilation timers and statistics |
108 static void print_compilation_timers(); |
112 static void print_compilation_timers(); |
109 |
113 |
110 static elapsedTimer* codeInstallTimer() { return &_codeInstallTimer; } |
114 static elapsedTimer* codeInstallTimer() { return &_codeInstallTimer; } |
111 }; |
115 }; |