mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8212070: Introduce diagnostic flag to abort VM on failed JIT compilation
Reviewed-by: mikael, thartmann
This commit is contained in:
parent
b146cbfc10
commit
ffeae5bd65
@ -1946,7 +1946,8 @@ static void codecache_print(outputStream* out, bool detailed) {
|
||||
}
|
||||
}
|
||||
|
||||
void CompileBroker::post_compile(CompilerThread* thread, CompileTask* task, bool success, ciEnv* ci_env) {
|
||||
void CompileBroker::post_compile(CompilerThread* thread, CompileTask* task, bool success, ciEnv* ci_env,
|
||||
int compilable, const char* failure_reason) {
|
||||
if (success) {
|
||||
task->mark_success();
|
||||
if (ci_env != NULL) {
|
||||
@ -1958,6 +1959,13 @@ void CompileBroker::post_compile(CompilerThread* thread, CompileTask* task, bool
|
||||
_compilation_log->log_nmethod(thread, code);
|
||||
}
|
||||
}
|
||||
} else if (AbortVMOnCompilationFailure) {
|
||||
if (compilable == ciEnv::MethodCompilable_not_at_tier) {
|
||||
fatal("Not compilable at tier %d: %s", task->comp_level(), failure_reason);
|
||||
}
|
||||
if (compilable == ciEnv::MethodCompilable_never) {
|
||||
fatal("Never compilable: %s", failure_reason);
|
||||
}
|
||||
}
|
||||
// simulate crash during compilation
|
||||
assert(task->compile_id() != CICrashAt, "just as planned");
|
||||
@ -2068,7 +2076,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
||||
compilable = ciEnv::MethodCompilable_not_at_tier;
|
||||
}
|
||||
}
|
||||
post_compile(thread, task, task->code() != NULL, NULL);
|
||||
post_compile(thread, task, task->code() != NULL, NULL, compilable, failure_reason);
|
||||
if (event.should_commit()) {
|
||||
post_compilation_event(&event, task);
|
||||
}
|
||||
@ -2128,7 +2136,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
||||
ci_env.report_failure(failure_reason);
|
||||
}
|
||||
|
||||
post_compile(thread, task, !ci_env.failing(), &ci_env);
|
||||
post_compile(thread, task, !ci_env.failing(), &ci_env, compilable, failure_reason);
|
||||
if (event.should_commit()) {
|
||||
post_compilation_event(&event, task);
|
||||
}
|
||||
|
||||
@ -252,7 +252,8 @@ class CompileBroker: AllStatic {
|
||||
#endif
|
||||
|
||||
static void invoke_compiler_on_method(CompileTask* task);
|
||||
static void post_compile(CompilerThread* thread, CompileTask* task, bool success, ciEnv* ci_env);
|
||||
static void post_compile(CompilerThread* thread, CompileTask* task, bool success, ciEnv* ci_env,
|
||||
int compilable, const char* failure_reason);
|
||||
static void set_last_compile(CompilerThread *thread, const methodHandle& method, bool is_osr, int comp_level);
|
||||
static void push_jni_handle_block();
|
||||
static void pop_jni_handle_block();
|
||||
|
||||
@ -2016,6 +2016,9 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G);
|
||||
notproduct(bool, CIObjectFactoryVerify, false, \
|
||||
"enable potentially expensive verification in ciObjectFactory") \
|
||||
\
|
||||
diagnostic(bool, AbortVMOnCompilationFailure, false, \
|
||||
"Abort VM when method had failed to compile.") \
|
||||
\
|
||||
/* Priorities */ \
|
||||
product_pd(bool, UseThreadPriorities, "Use native thread priorities") \
|
||||
\
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user