author | dlong |
Wed, 24 Apr 2019 09:10:45 -0700 | |
changeset 54647 | c0d9bc9b4e1f |
parent 53417 | 126c5e7b97b1 |
child 54669 | ad45b3802d4e |
permissions | -rw-r--r-- |
33160 | 1 |
/* |
53193
184c51e48260
8216262: Remove develop flag DelayCompilationDuringStartup
redestad
parents:
52934
diff
changeset
|
2 |
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. |
33160 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
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 |
#include "precompiled.hpp" |
|
47765
b7c7428eaab9
8189610: Reconcile jvm.h and all jvm_md.h between java.base and hotspot
coleenp
parents:
47216
diff
changeset
|
25 |
#include "jvm.h" |
54647
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
26 |
#include "classfile/moduleEntry.hpp" |
33160 | 27 |
#include "memory/oopFactory.hpp" |
37248 | 28 |
#include "memory/resourceArea.hpp" |
33160 | 29 |
#include "oops/oop.inline.hpp" |
30 |
#include "runtime/javaCalls.hpp" |
|
31 |
#include "runtime/handles.hpp" |
|
32 |
#include "jvmci/jvmciJavaClasses.hpp" |
|
33 |
#include "jvmci/jvmciCompiler.hpp" |
|
34 |
#include "jvmci/jvmciEnv.hpp" |
|
35 |
#include "jvmci/jvmciRuntime.hpp" |
|
36 |
#include "runtime/compilationPolicy.hpp" |
|
37 |
#include "runtime/globals_extension.hpp" |
|
49480
d7df2dd501ce
8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents:
47765
diff
changeset
|
38 |
#include "runtime/handles.inline.hpp" |
33160 | 39 |
|
40 |
JVMCICompiler* JVMCICompiler::_instance = NULL; |
|
41 |
elapsedTimer JVMCICompiler::_codeInstallTimer; |
|
42 |
||
42040
70ec5a09a0d5
8166377: is_compiled_by_jvmci hot in some profiles - improve nmethod compiler type detection
neliasso
parents:
41322
diff
changeset
|
43 |
JVMCICompiler::JVMCICompiler() : AbstractCompiler(compiler_jvmci) { |
33160 | 44 |
_bootstrapping = false; |
38674
eacc567feae8
8156034: [JVMCI] Notify the jvmci compiler on completion of a bootstrap
never
parents:
38666
diff
changeset
|
45 |
_bootstrap_compilation_request_handled = false; |
35845
30025047885d
8148507: [JVMCI] mitigate deadlocks related to JVMCI compiler under -Xbatch
dnsimon
parents:
35592
diff
changeset
|
46 |
_methods_compiled = 0; |
33160 | 47 |
assert(_instance == NULL, "only one instance allowed"); |
48 |
_instance = this; |
|
49 |
} |
|
50 |
||
51 |
// Initialization |
|
52 |
void JVMCICompiler::initialize() { |
|
53 |
if (!UseCompiler || !EnableJVMCI || !UseJVMCICompiler || !should_perform_init()) { |
|
54 |
return; |
|
55 |
} |
|
56 |
||
57 |
set_state(initialized); |
|
58 |
} |
|
59 |
||
38674
eacc567feae8
8156034: [JVMCI] Notify the jvmci compiler on completion of a bootstrap
never
parents:
38666
diff
changeset
|
60 |
void JVMCICompiler::bootstrap(TRAPS) { |
33632 | 61 |
if (Arguments::mode() == Arguments::_int) { |
62 |
// Nothing to do in -Xint mode |
|
63 |
return; |
|
64 |
} |
|
33160 | 65 |
_bootstrapping = true; |
66 |
ResourceMark rm; |
|
67 |
HandleMark hm; |
|
68 |
if (PrintBootstrap) { |
|
69 |
tty->print("Bootstrapping JVMCI"); |
|
70 |
} |
|
71 |
jlong start = os::javaTimeMillis(); |
|
72 |
||
33602 | 73 |
Array<Method*>* objectMethods = SystemDictionary::Object_klass()->methods(); |
33160 | 74 |
// Initialize compile queue with a selected set of methods. |
75 |
int len = objectMethods->length(); |
|
76 |
for (int i = 0; i < len; i++) { |
|
77 |
methodHandle mh = objectMethods->at(i); |
|
78 |
if (!mh->is_native() && !mh->is_static() && !mh->is_initializer()) { |
|
79 |
ResourceMark rm; |
|
80 |
int hot_count = 10; // TODO: what's the appropriate value? |
|
38218 | 81 |
CompileBroker::compile_method(mh, InvocationEntryBci, CompLevel_full_optimization, mh, hot_count, CompileTask::Reason_Bootstrap, THREAD); |
33160 | 82 |
} |
83 |
} |
|
84 |
||
85 |
int qsize; |
|
86 |
bool first_round = true; |
|
87 |
int z = 0; |
|
88 |
do { |
|
89 |
// Loop until there is something in the queue. |
|
90 |
do { |
|
91 |
os::sleep(THREAD, 100, true); |
|
92 |
qsize = CompileBroker::queue_size(CompLevel_full_optimization); |
|
38674
eacc567feae8
8156034: [JVMCI] Notify the jvmci compiler on completion of a bootstrap
never
parents:
38666
diff
changeset
|
93 |
} while (!_bootstrap_compilation_request_handled && first_round && qsize == 0); |
33160 | 94 |
first_round = false; |
95 |
if (PrintBootstrap) { |
|
35845
30025047885d
8148507: [JVMCI] mitigate deadlocks related to JVMCI compiler under -Xbatch
dnsimon
parents:
35592
diff
changeset
|
96 |
while (z < (_methods_compiled / 100)) { |
33160 | 97 |
++z; |
98 |
tty->print_raw("."); |
|
99 |
} |
|
100 |
} |
|
101 |
} while (qsize != 0); |
|
102 |
||
103 |
if (PrintBootstrap) { |
|
35845
30025047885d
8148507: [JVMCI] mitigate deadlocks related to JVMCI compiler under -Xbatch
dnsimon
parents:
35592
diff
changeset
|
104 |
tty->print_cr(" in " JLONG_FORMAT " ms (compiled %d methods)", os::javaTimeMillis() - start, _methods_compiled); |
33160 | 105 |
} |
106 |
_bootstrapping = false; |
|
38674
eacc567feae8
8156034: [JVMCI] Notify the jvmci compiler on completion of a bootstrap
never
parents:
38666
diff
changeset
|
107 |
JVMCIRuntime::bootstrap_finished(CHECK); |
33160 | 108 |
} |
109 |
||
41322
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
110 |
#define CHECK_EXIT THREAD); \ |
35143
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
34185
diff
changeset
|
111 |
if (HAS_PENDING_EXCEPTION) { \ |
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
34185
diff
changeset
|
112 |
char buf[256]; \ |
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
34185
diff
changeset
|
113 |
jio_snprintf(buf, 256, "Uncaught exception at %s:%d", __FILE__, __LINE__); \ |
41322
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
114 |
JVMCICompiler::exit_on_pending_exception(PENDING_EXCEPTION, buf); \ |
35143
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
34185
diff
changeset
|
115 |
return; \ |
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
34185
diff
changeset
|
116 |
} \ |
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
34185
diff
changeset
|
117 |
(void)(0 |
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
34185
diff
changeset
|
118 |
|
34165 | 119 |
void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JVMCIEnv* env) { |
33160 | 120 |
JVMCI_EXCEPTION_CONTEXT |
121 |
||
122 |
bool is_osr = entry_bci != InvocationEntryBci; |
|
123 |
if (_bootstrapping && is_osr) { |
|
124 |
// no OSR compilations during bootstrap - the compiler is just too slow at this point, |
|
125 |
// and we know that there are no endless loops |
|
53417
126c5e7b97b1
8217445: [JVMCI] incorrect management of JVMCI compilation failure reason string
dnsimon
parents:
53193
diff
changeset
|
126 |
env->set_failure(true, "No OSR during boostrap"); |
33160 | 127 |
return; |
128 |
} |
|
129 |
||
41322
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
130 |
JVMCIRuntime::initialize_well_known_classes(CHECK_EXIT); |
33160 | 131 |
|
132 |
HandleMark hm; |
|
41322
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
133 |
Handle receiver = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK_EXIT); |
33160 | 134 |
|
135 |
JavaValue method_result(T_OBJECT); |
|
33632 | 136 |
JavaCallArguments args; |
137 |
args.push_long((jlong) (address) method()); |
|
138 |
JavaCalls::call_static(&method_result, SystemDictionary::HotSpotResolvedJavaMethodImpl_klass(), |
|
139 |
vmSymbols::fromMetaspace_name(), vmSymbols::method_fromMetaspace_signature(), &args, THREAD); |
|
140 |
||
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
141 |
JavaValue result(T_OBJECT); |
33632 | 142 |
if (!HAS_PENDING_EXCEPTION) { |
33160 | 143 |
JavaCallArguments args; |
33632 | 144 |
args.push_oop(receiver); |
46271
979ebd346ecf
8169881: Remove implicit Handle conversions oop->Handle
coleenp
parents:
42040
diff
changeset
|
145 |
args.push_oop(Handle(THREAD, (oop)method_result.get_jobject())); |
33632 | 146 |
args.push_int(entry_bci); |
147 |
args.push_long((jlong) (address) env); |
|
148 |
args.push_int(env->task()->compile_id()); |
|
149 |
JavaCalls::call_special(&result, receiver->klass(), |
|
150 |
vmSymbols::compileMethod_name(), vmSymbols::compileMethod_signature(), &args, THREAD); |
|
33160 | 151 |
} |
152 |
||
33632 | 153 |
// An uncaught exception was thrown during compilation. Generally these |
154 |
// should be handled by the Java code in some useful way but if they leak |
|
155 |
// through to here report them instead of dying or silently ignoring them. |
|
156 |
if (HAS_PENDING_EXCEPTION) { |
|
35143
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
34185
diff
changeset
|
157 |
Handle exception(THREAD, PENDING_EXCEPTION); |
33632 | 158 |
CLEAR_PENDING_EXCEPTION; |
33160 | 159 |
|
35557
029dcb9bfa8b
8146246: JVMCICompiler::abort_on_pending_exception: assert(!thread->owns_locks()) failed: must release all locks when leaving VM
twisti
parents:
35143
diff
changeset
|
160 |
java_lang_Throwable::java_printStackTrace(exception, THREAD); |
36612
2191de2a73f1
8151871: [JVMCI] missing HAS_PENDING_EXCEPTION check
never
parents:
35845
diff
changeset
|
161 |
if (HAS_PENDING_EXCEPTION) { |
2191de2a73f1
8151871: [JVMCI] missing HAS_PENDING_EXCEPTION check
never
parents:
35845
diff
changeset
|
162 |
CLEAR_PENDING_EXCEPTION; |
2191de2a73f1
8151871: [JVMCI] missing HAS_PENDING_EXCEPTION check
never
parents:
35845
diff
changeset
|
163 |
} |
33632 | 164 |
|
53417
126c5e7b97b1
8217445: [JVMCI] incorrect management of JVMCI compilation failure reason string
dnsimon
parents:
53193
diff
changeset
|
165 |
env->set_failure(false, "unexpected exception thrown"); |
33632 | 166 |
} else { |
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
167 |
oop result_object = (oop) result.get_jobject(); |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
168 |
if (result_object != NULL) { |
38695 | 169 |
oop failure_message = HotSpotCompilationRequestResult::failureMessage(result_object); |
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
170 |
if (failure_message != NULL) { |
53417
126c5e7b97b1
8217445: [JVMCI] incorrect management of JVMCI compilation failure reason string
dnsimon
parents:
53193
diff
changeset
|
171 |
// Copy failure reason into resource memory first ... |
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
172 |
const char* failure_reason = java_lang_String::as_utf8_string(failure_message); |
53417
126c5e7b97b1
8217445: [JVMCI] incorrect management of JVMCI compilation failure reason string
dnsimon
parents:
53193
diff
changeset
|
173 |
// ... and then into the C heap. |
126c5e7b97b1
8217445: [JVMCI] incorrect management of JVMCI compilation failure reason string
dnsimon
parents:
53193
diff
changeset
|
174 |
failure_reason = os::strdup(failure_reason, mtCompiler); |
126c5e7b97b1
8217445: [JVMCI] incorrect management of JVMCI compilation failure reason string
dnsimon
parents:
53193
diff
changeset
|
175 |
bool retryable = HotSpotCompilationRequestResult::retry(result_object) != 0; |
126c5e7b97b1
8217445: [JVMCI] incorrect management of JVMCI compilation failure reason string
dnsimon
parents:
53193
diff
changeset
|
176 |
env->set_failure(retryable, failure_reason, true); |
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
177 |
} else { |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
178 |
if (env->task()->code() == NULL) { |
53417
126c5e7b97b1
8217445: [JVMCI] incorrect management of JVMCI compilation failure reason string
dnsimon
parents:
53193
diff
changeset
|
179 |
env->set_failure(true, "no nmethod produced"); |
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
180 |
} else { |
38695 | 181 |
env->task()->set_num_inlined_bytecodes(HotSpotCompilationRequestResult::inlinedBytecodes(result_object)); |
35845
30025047885d
8148507: [JVMCI] mitigate deadlocks related to JVMCI compiler under -Xbatch
dnsimon
parents:
35592
diff
changeset
|
182 |
Atomic::inc(&_methods_compiled); |
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
183 |
} |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
184 |
} |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
185 |
} else { |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
186 |
assert(false, "JVMCICompiler.compileMethod should always return non-null"); |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35557
diff
changeset
|
187 |
} |
33632 | 188 |
} |
38674
eacc567feae8
8156034: [JVMCI] Notify the jvmci compiler on completion of a bootstrap
never
parents:
38666
diff
changeset
|
189 |
if (_bootstrapping) { |
eacc567feae8
8156034: [JVMCI] Notify the jvmci compiler on completion of a bootstrap
never
parents:
38666
diff
changeset
|
190 |
_bootstrap_compilation_request_handled = true; |
eacc567feae8
8156034: [JVMCI] Notify the jvmci compiler on completion of a bootstrap
never
parents:
38666
diff
changeset
|
191 |
} |
33160 | 192 |
} |
193 |
||
46271
979ebd346ecf
8169881: Remove implicit Handle conversions oop->Handle
coleenp
parents:
42040
diff
changeset
|
194 |
void JVMCICompiler::exit_on_pending_exception(oop exception, const char* message) { |
41322
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
195 |
JavaThread* THREAD = JavaThread::current(); |
35143
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
34185
diff
changeset
|
196 |
CLEAR_PENDING_EXCEPTION; |
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
34185
diff
changeset
|
197 |
|
41322
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
198 |
static volatile int report_error = 0; |
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
199 |
if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) { |
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
200 |
// Only report an error once |
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
201 |
tty->print_raw_cr(message); |
46271
979ebd346ecf
8169881: Remove implicit Handle conversions oop->Handle
coleenp
parents:
42040
diff
changeset
|
202 |
Handle ex(THREAD, exception); |
979ebd346ecf
8169881: Remove implicit Handle conversions oop->Handle
coleenp
parents:
42040
diff
changeset
|
203 |
java_lang_Throwable::java_printStackTrace(ex, THREAD); |
41322
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
204 |
} else { |
50858 | 205 |
// Allow error reporting thread to print the stack trace. Windows |
206 |
// doesn't allow uninterruptible wait for JavaThreads |
|
207 |
const bool interruptible = true; |
|
208 |
os::sleep(THREAD, 200, interruptible); |
|
41322
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
209 |
} |
35143
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
34185
diff
changeset
|
210 |
|
41322
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
211 |
before_exit(THREAD); |
d91c045cdfe4
8165755: [JVMCI] replace use of vm_abort with vm_exit
dnsimon
parents:
38695
diff
changeset
|
212 |
vm_exit(-1); |
35143
33daaea9d5c2
8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread
twisti
parents:
34185
diff
changeset
|
213 |
} |
33160 | 214 |
|
215 |
// Compilation entry point for methods |
|
33451
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
216 |
void JVMCICompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci, DirectiveSet* directive) { |
33160 | 217 |
ShouldNotReachHere(); |
218 |
} |
|
219 |
||
220 |
// Print compilation timers and statistics |
|
221 |
void JVMCICompiler::print_timers() { |
|
222 |
print_compilation_timers(); |
|
223 |
} |
|
224 |
||
225 |
// Print compilation timers and statistics |
|
226 |
void JVMCICompiler::print_compilation_timers() { |
|
227 |
TRACE_jvmci_1("JVMCICompiler::print_timers"); |
|
228 |
tty->print_cr(" JVMCI code install time: %6.3f s", _codeInstallTimer.seconds()); |
|
229 |
} |
|
54647
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
230 |
|
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
231 |
bool JVMCICompiler::force_comp_at_level_simple(Method *method) { |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
232 |
JVMCI_EXCEPTION_CONTEXT |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
233 |
|
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
234 |
if (_bootstrapping) { |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
235 |
// When bootstrapping, the JVMCI compiler can compile its own methods. |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
236 |
return false; |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
237 |
} |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
238 |
|
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
239 |
if (!JVMCIRuntime::is_HotSpotJVMCIRuntime_initialized()) { |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
240 |
// JVMCI cannot participate in compilation scheduling until |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
241 |
// JVMCI is initialized and indicates it wants to participate. |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
242 |
return false; |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
243 |
} |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
244 |
// Support for graal.CompileGraalWithC1Only |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
245 |
HandleMark hm(thread); |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
246 |
jobject runtime = JVMCIRuntime::get_HotSpotJVMCIRuntime_jobject(CATCH); |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
247 |
objArrayHandle excludeFromJVMCICompilation(thread, HotSpotJVMCIRuntime::excludeFromJVMCICompilation(runtime)); |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
248 |
if (excludeFromJVMCICompilation.is_null()) { |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
249 |
return false; |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
250 |
} |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
251 |
ModuleEntry *module = method->method_holder()->module(); |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
252 |
for (int i = 0; i < excludeFromJVMCICompilation->length(); ++i) { |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
253 |
if (module->module() == excludeFromJVMCICompilation->obj_at(i)) { |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
254 |
return true; |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
255 |
} |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
256 |
} |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
257 |
|
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
258 |
return false; |
c0d9bc9b4e1f
8219403: JVMCIRuntime::adjust_comp_level should be replaced
dlong
parents:
53417
diff
changeset
|
259 |
} |