mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
Merge
This commit is contained in:
commit
d98c766949
5 changed files with 26 additions and 14 deletions
|
@ -576,9 +576,8 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
||||||
// normal bytecode execution.
|
// normal bytecode execution.
|
||||||
thread->clear_exception_oop_and_pc();
|
thread->clear_exception_oop_and_pc();
|
||||||
|
|
||||||
Handle original_exception(thread, exception());
|
bool recursive_exception = false;
|
||||||
|
continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false, recursive_exception);
|
||||||
continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false);
|
|
||||||
// If an exception was thrown during exception dispatch, the exception oop may have changed
|
// If an exception was thrown during exception dispatch, the exception oop may have changed
|
||||||
thread->set_exception_oop(exception());
|
thread->set_exception_oop(exception());
|
||||||
thread->set_exception_pc(pc);
|
thread->set_exception_pc(pc);
|
||||||
|
@ -586,8 +585,9 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
||||||
// the exception cache is used only by non-implicit exceptions
|
// the exception cache is used only by non-implicit exceptions
|
||||||
// Update the exception cache only when there didn't happen
|
// Update the exception cache only when there didn't happen
|
||||||
// another exception during the computation of the compiled
|
// another exception during the computation of the compiled
|
||||||
// exception handler.
|
// exception handler. Checking for exception oop equality is not
|
||||||
if (continuation != NULL && original_exception() == exception()) {
|
// sufficient because some exceptions are pre-allocated and reused.
|
||||||
|
if (continuation != NULL && !recursive_exception) {
|
||||||
nm->add_handler_for_exception_and_pc(exception, pc, continuation);
|
nm->add_handler_for_exception_and_pc(exception, pc, continuation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,13 +313,18 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
||||||
// normal bytecode execution.
|
// normal bytecode execution.
|
||||||
thread->clear_exception_oop_and_pc();
|
thread->clear_exception_oop_and_pc();
|
||||||
|
|
||||||
continuation = SharedRuntime::compute_compiled_exc_handler(cm, pc, exception, false, false);
|
bool recursive_exception = false;
|
||||||
|
continuation = SharedRuntime::compute_compiled_exc_handler(cm, pc, exception, false, false, recursive_exception);
|
||||||
// If an exception was thrown during exception dispatch, the exception oop may have changed
|
// If an exception was thrown during exception dispatch, the exception oop may have changed
|
||||||
thread->set_exception_oop(exception());
|
thread->set_exception_oop(exception());
|
||||||
thread->set_exception_pc(pc);
|
thread->set_exception_pc(pc);
|
||||||
|
|
||||||
// the exception cache is used only by non-implicit exceptions
|
// the exception cache is used only by non-implicit exceptions
|
||||||
if (continuation != NULL && !SharedRuntime::deopt_blob()->contains(continuation)) {
|
// Update the exception cache only when there didn't happen
|
||||||
|
// another exception during the computation of the compiled
|
||||||
|
// exception handler. Checking for exception oop equality is not
|
||||||
|
// sufficient because some exceptions are pre-allocated and reused.
|
||||||
|
if (continuation != NULL && !recursive_exception && !SharedRuntime::deopt_blob()->contains(continuation)) {
|
||||||
cm->add_handler_for_exception_and_pc(exception, pc, continuation);
|
cm->add_handler_for_exception_and_pc(exception, pc, continuation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1349,17 +1349,23 @@ JRT_ENTRY_NO_ASYNC(address, OptoRuntime::handle_exception_C_helper(JavaThread* t
|
||||||
force_unwind ? NULL : nm->handler_for_exception_and_pc(exception, pc);
|
force_unwind ? NULL : nm->handler_for_exception_and_pc(exception, pc);
|
||||||
|
|
||||||
if (handler_address == NULL) {
|
if (handler_address == NULL) {
|
||||||
Handle original_exception(thread, exception());
|
bool recursive_exception = false;
|
||||||
handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true);
|
handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true, recursive_exception);
|
||||||
assert (handler_address != NULL, "must have compiled handler");
|
assert (handler_address != NULL, "must have compiled handler");
|
||||||
// Update the exception cache only when the unwind was not forced
|
// Update the exception cache only when the unwind was not forced
|
||||||
// and there didn't happen another exception during the computation of the
|
// and there didn't happen another exception during the computation of the
|
||||||
// compiled exception handler.
|
// compiled exception handler. Checking for exception oop equality is not
|
||||||
if (!force_unwind && original_exception() == exception()) {
|
// sufficient because some exceptions are pre-allocated and reused.
|
||||||
|
if (!force_unwind && !recursive_exception) {
|
||||||
nm->add_handler_for_exception_and_pc(exception,pc,handler_address);
|
nm->add_handler_for_exception_and_pc(exception,pc,handler_address);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true), "Must be the same");
|
#ifdef ASSERT
|
||||||
|
bool recursive_exception = false;
|
||||||
|
address computed_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true, recursive_exception);
|
||||||
|
vmassert(recursive_exception || (handler_address == computed_address), "Handler address inconsistency: " PTR_FORMAT " != " PTR_FORMAT,
|
||||||
|
p2i(handler_address), p2i(computed_address));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -621,7 +621,7 @@ JRT_END
|
||||||
// ret_pc points into caller; we are returning caller's exception handler
|
// ret_pc points into caller; we are returning caller's exception handler
|
||||||
// for given exception
|
// for given exception
|
||||||
address SharedRuntime::compute_compiled_exc_handler(CompiledMethod* cm, address ret_pc, Handle& exception,
|
address SharedRuntime::compute_compiled_exc_handler(CompiledMethod* cm, address ret_pc, Handle& exception,
|
||||||
bool force_unwind, bool top_frame_only) {
|
bool force_unwind, bool top_frame_only, bool& recursive_exception_occurred) {
|
||||||
assert(cm != NULL, "must exist");
|
assert(cm != NULL, "must exist");
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
|
|
||||||
|
@ -677,6 +677,7 @@ address SharedRuntime::compute_compiled_exc_handler(CompiledMethod* cm, address
|
||||||
// BCI of the exception handler which caused the exception to be
|
// BCI of the exception handler which caused the exception to be
|
||||||
// thrown (bugs 4307310 and 4546590). Set "exception" reference
|
// thrown (bugs 4307310 and 4546590). Set "exception" reference
|
||||||
// argument to ensure that the correct exception is thrown (4870175).
|
// argument to ensure that the correct exception is thrown (4870175).
|
||||||
|
recursive_exception_occurred = true;
|
||||||
exception = Handle(THREAD, PENDING_EXCEPTION);
|
exception = Handle(THREAD, PENDING_EXCEPTION);
|
||||||
CLEAR_PENDING_EXCEPTION;
|
CLEAR_PENDING_EXCEPTION;
|
||||||
if (handler_bci >= 0) {
|
if (handler_bci >= 0) {
|
||||||
|
|
|
@ -189,7 +189,7 @@ class SharedRuntime: AllStatic {
|
||||||
|
|
||||||
// exception handling and implicit exceptions
|
// exception handling and implicit exceptions
|
||||||
static address compute_compiled_exc_handler(CompiledMethod* nm, address ret_pc, Handle& exception,
|
static address compute_compiled_exc_handler(CompiledMethod* nm, address ret_pc, Handle& exception,
|
||||||
bool force_unwind, bool top_frame_only);
|
bool force_unwind, bool top_frame_only, bool& recursive_exception_occurred);
|
||||||
enum ImplicitExceptionKind {
|
enum ImplicitExceptionKind {
|
||||||
IMPLICIT_NULL,
|
IMPLICIT_NULL,
|
||||||
IMPLICIT_DIVIDE_BY_ZERO,
|
IMPLICIT_DIVIDE_BY_ZERO,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue