8147432: JVMCI should report bailouts in PrintCompilation output

Reviewed-by: kvn, twisti
This commit is contained in:
Tom Rodriguez 2016-01-22 11:08:07 -08:00
parent 0691fac50b
commit 87d68c21c4
16 changed files with 165 additions and 101 deletions

View file

@ -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");
}
}
}