mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
8257910: [JVMCI] Set exception_seen accordingly in the runtime.
Reviewed-by: kvn
This commit is contained in:
parent
e90d0d1da4
commit
58dca9253d
4 changed files with 62 additions and 28 deletions
|
@ -538,6 +538,20 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// debugging support
|
||||||
|
// tracing
|
||||||
|
if (log_is_enabled(Info, exceptions)) {
|
||||||
|
ResourceMark rm;
|
||||||
|
stringStream tempst;
|
||||||
|
assert(nm->method() != NULL, "Unexpected NULL method()");
|
||||||
|
tempst.print("C1 compiled method <%s>\n"
|
||||||
|
" at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT,
|
||||||
|
nm->method()->print_value_string(), p2i(pc), p2i(thread));
|
||||||
|
Exceptions::log_exception(exception, tempst.as_string());
|
||||||
|
}
|
||||||
|
// for AbortVMOnException flag
|
||||||
|
Exceptions::debug_check_abort(exception);
|
||||||
|
|
||||||
// Check the stack guard pages and reenable them if necessary and there is
|
// Check the stack guard pages and reenable them if necessary and there is
|
||||||
// enough space on the stack to do so. Use fast exceptions only if the guard
|
// enough space on the stack to do so. Use fast exceptions only if the guard
|
||||||
// pages are enabled.
|
// pages are enabled.
|
||||||
|
@ -584,20 +598,6 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
||||||
// New exception handling mechanism can support inlined methods
|
// New exception handling mechanism can support inlined methods
|
||||||
// with exception handlers since the mappings are from PC to PC
|
// with exception handlers since the mappings are from PC to PC
|
||||||
|
|
||||||
// debugging support
|
|
||||||
// tracing
|
|
||||||
if (log_is_enabled(Info, exceptions)) {
|
|
||||||
ResourceMark rm;
|
|
||||||
stringStream tempst;
|
|
||||||
assert(nm->method() != NULL, "Unexpected NULL method()");
|
|
||||||
tempst.print("compiled method <%s>\n"
|
|
||||||
" at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT,
|
|
||||||
nm->method()->print_value_string(), p2i(pc), p2i(thread));
|
|
||||||
Exceptions::log_exception(exception, tempst.as_string());
|
|
||||||
}
|
|
||||||
// for AbortVMOnException flag
|
|
||||||
Exceptions::debug_check_abort(exception);
|
|
||||||
|
|
||||||
// Clear out the exception oop and pc since looking up an
|
// Clear out the exception oop and pc since looking up an
|
||||||
// exception handler can cause class loading, which might throw an
|
// exception handler can cause class loading, which might throw an
|
||||||
// exception and those fields are expected to be clear during
|
// exception and those fields are expected to be clear during
|
||||||
|
|
|
@ -267,6 +267,20 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// debugging support
|
||||||
|
// tracing
|
||||||
|
if (log_is_enabled(Info, exceptions)) {
|
||||||
|
ResourceMark rm;
|
||||||
|
stringStream tempst;
|
||||||
|
assert(cm->method() != NULL, "Unexpected null method()");
|
||||||
|
tempst.print("JVMCI compiled method <%s>\n"
|
||||||
|
" at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT,
|
||||||
|
cm->method()->print_value_string(), p2i(pc), p2i(thread));
|
||||||
|
Exceptions::log_exception(exception, tempst.as_string());
|
||||||
|
}
|
||||||
|
// for AbortVMOnException flag
|
||||||
|
Exceptions::debug_check_abort(exception);
|
||||||
|
|
||||||
// Check the stack guard pages and reenable them if necessary and there is
|
// Check the stack guard pages and reenable them if necessary and there is
|
||||||
// enough space on the stack to do so. Use fast exceptions only if the guard
|
// enough space on the stack to do so. Use fast exceptions only if the guard
|
||||||
// pages are enabled.
|
// pages are enabled.
|
||||||
|
@ -313,20 +327,6 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
||||||
// New exception handling mechanism can support inlined methods
|
// New exception handling mechanism can support inlined methods
|
||||||
// with exception handlers since the mappings are from PC to PC
|
// with exception handlers since the mappings are from PC to PC
|
||||||
|
|
||||||
// debugging support
|
|
||||||
// tracing
|
|
||||||
if (log_is_enabled(Info, exceptions)) {
|
|
||||||
ResourceMark rm;
|
|
||||||
stringStream tempst;
|
|
||||||
assert(cm->method() != NULL, "Unexpected null method()");
|
|
||||||
tempst.print("compiled method <%s>\n"
|
|
||||||
" at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT,
|
|
||||||
cm->method()->print_value_string(), p2i(pc), p2i(thread));
|
|
||||||
Exceptions::log_exception(exception, tempst.as_string());
|
|
||||||
}
|
|
||||||
// for AbortVMOnException flag
|
|
||||||
NOT_PRODUCT(Exceptions::debug_check_abort(exception));
|
|
||||||
|
|
||||||
// Clear out the exception oop and pc since looking up an
|
// Clear out the exception oop and pc since looking up an
|
||||||
// exception handler can cause class loading, which might throw an
|
// exception handler can cause class loading, which might throw an
|
||||||
// exception and those fields are expected to be clear during
|
// exception and those fields are expected to be clear during
|
||||||
|
|
|
@ -1731,6 +1731,18 @@ address Deoptimization::deoptimize_for_missing_exception_handler(CompiledMethod*
|
||||||
frame runtime_frame = thread->last_frame();
|
frame runtime_frame = thread->last_frame();
|
||||||
frame caller_frame = runtime_frame.sender(®_map);
|
frame caller_frame = runtime_frame.sender(®_map);
|
||||||
assert(caller_frame.cb()->as_compiled_method_or_null() == cm, "expect top frame compiled method");
|
assert(caller_frame.cb()->as_compiled_method_or_null() == cm, "expect top frame compiled method");
|
||||||
|
vframe* vf = vframe::new_vframe(&caller_frame, ®_map, thread);
|
||||||
|
compiledVFrame* cvf = compiledVFrame::cast(vf);
|
||||||
|
ScopeDesc* imm_scope = cvf->scope();
|
||||||
|
MethodData* imm_mdo = get_method_data(thread, methodHandle(thread, imm_scope->method()), true);
|
||||||
|
if (imm_mdo != NULL) {
|
||||||
|
ProfileData* pdata = imm_mdo->allocate_bci_to_data(imm_scope->bci(), NULL);
|
||||||
|
if (pdata != NULL && pdata->is_BitData()) {
|
||||||
|
BitData* bit_data = (BitData*) pdata;
|
||||||
|
bit_data->set_exception_seen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Deoptimization::deoptimize(thread, caller_frame, Deoptimization::Reason_not_compiled_exception_handler);
|
Deoptimization::deoptimize(thread, caller_frame, Deoptimization::Reason_not_compiled_exception_handler);
|
||||||
|
|
||||||
MethodData* trap_mdo = get_method_data(thread, methodHandle(thread, cm->method()), true);
|
MethodData* trap_mdo = get_method_data(thread, methodHandle(thread, cm->method()), true);
|
||||||
|
|
|
@ -599,6 +599,28 @@ void SharedRuntime::throw_and_post_jvmti_exception(JavaThread *thread, Handle h_
|
||||||
address bcp = method()->bcp_from(vfst.bci());
|
address bcp = method()->bcp_from(vfst.bci());
|
||||||
JvmtiExport::post_exception_throw(thread, method(), bcp, h_exception());
|
JvmtiExport::post_exception_throw(thread, method(), bcp, h_exception());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if INCLUDE_JVMCI
|
||||||
|
if (EnableJVMCI && UseJVMCICompiler) {
|
||||||
|
vframeStream vfst(thread, true);
|
||||||
|
methodHandle method = methodHandle(thread, vfst.method());
|
||||||
|
int bci = vfst.bci();
|
||||||
|
MethodData* trap_mdo = method->method_data();
|
||||||
|
if (trap_mdo != NULL) {
|
||||||
|
// Set exception_seen if the exceptional bytecode is an invoke
|
||||||
|
Bytecode_invoke call = Bytecode_invoke_check(method, bci);
|
||||||
|
if (call.is_valid()) {
|
||||||
|
ResourceMark rm(thread);
|
||||||
|
ProfileData* pdata = trap_mdo->allocate_bci_to_data(bci, NULL);
|
||||||
|
if (pdata != NULL && pdata->is_BitData()) {
|
||||||
|
BitData* bit_data = (BitData*) pdata;
|
||||||
|
bit_data->set_exception_seen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Exceptions::_throw(thread, __FILE__, __LINE__, h_exception);
|
Exceptions::_throw(thread, __FILE__, __LINE__, h_exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue