mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8147432: JVMCI should report bailouts in PrintCompilation output
Reviewed-by: kvn, twisti
This commit is contained in:
parent
0691fac50b
commit
87d68c21c4
16 changed files with 165 additions and 101 deletions
|
@ -134,7 +134,6 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV
|
|||
JVMCIRuntime::initialize_well_known_classes(CHECK_ABORT);
|
||||
|
||||
HandleMark hm;
|
||||
ResourceMark rm;
|
||||
Handle receiver = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK_ABORT);
|
||||
|
||||
JavaValue method_result(T_OBJECT);
|
||||
|
@ -143,8 +142,8 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV
|
|||
JavaCalls::call_static(&method_result, SystemDictionary::HotSpotResolvedJavaMethodImpl_klass(),
|
||||
vmSymbols::fromMetaspace_name(), vmSymbols::method_fromMetaspace_signature(), &args, THREAD);
|
||||
|
||||
JavaValue result(T_OBJECT);
|
||||
if (!HAS_PENDING_EXCEPTION) {
|
||||
JavaValue result(T_VOID);
|
||||
JavaCallArguments args;
|
||||
args.push_oop(receiver);
|
||||
args.push_oop((oop)method_result.get_jobject());
|
||||
|
@ -164,10 +163,25 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV
|
|||
|
||||
java_lang_Throwable::java_printStackTrace(exception, THREAD);
|
||||
|
||||
// Something went wrong so disable compilation at this level
|
||||
method->set_not_compilable(CompLevel_full_optimization);
|
||||
env->set_failure("exception throw", false);
|
||||
} else {
|
||||
_methodsCompiled++;
|
||||
oop result_object = (oop) result.get_jobject();
|
||||
if (result_object != NULL) {
|
||||
oop failure_message = CompilationRequestResult::failureMessage(result_object);
|
||||
if (failure_message != NULL) {
|
||||
const char* failure_reason = java_lang_String::as_utf8_string(failure_message);
|
||||
env->set_failure(failure_reason, CompilationRequestResult::retry(result_object) != 0);
|
||||
} else {
|
||||
if (env->task()->code() == NULL) {
|
||||
env->set_failure("no nmethod produced", true);
|
||||
} else {
|
||||
env->task()->set_num_inlined_bytecodes(CompilationRequestResult::inlinedBytecodes(result_object));
|
||||
_methodsCompiled++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
assert(false, "JVMCICompiler.compileMethod should always return non-null");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue