提交 45e4cf78 编写于 作者: N never

6908267: Zero fails to unlock synchronized native methods on exception

Reviewed-by: never
Contributed-by: NGary Benson <gbenson@redhat.com>
上级 018891a3
...@@ -245,7 +245,7 @@ void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) { ...@@ -245,7 +245,7 @@ void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) {
if (handlerAddr == NULL) { if (handlerAddr == NULL) {
CALL_VM_NOCHECK(InterpreterRuntime::prepare_native_call(thread, method)); CALL_VM_NOCHECK(InterpreterRuntime::prepare_native_call(thread, method));
if (HAS_PENDING_EXCEPTION) if (HAS_PENDING_EXCEPTION)
goto unwind_and_return; goto unlock_unwind_and_return;
handlerAddr = method->signature_handler(); handlerAddr = method->signature_handler();
assert(handlerAddr != NULL, "eh?"); assert(handlerAddr != NULL, "eh?");
...@@ -254,7 +254,7 @@ void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) { ...@@ -254,7 +254,7 @@ void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) {
CALL_VM_NOCHECK(handlerAddr = CALL_VM_NOCHECK(handlerAddr =
InterpreterRuntime::slow_signature_handler(thread, method, NULL,NULL)); InterpreterRuntime::slow_signature_handler(thread, method, NULL,NULL));
if (HAS_PENDING_EXCEPTION) if (HAS_PENDING_EXCEPTION)
goto unwind_and_return; goto unlock_unwind_and_return;
} }
handler = \ handler = \
InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr); InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr);
...@@ -365,10 +365,10 @@ void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) { ...@@ -365,10 +365,10 @@ void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) {
// Reset handle block // Reset handle block
thread->active_handles()->clear(); thread->active_handles()->clear();
// Unlock if necessary. It seems totally wrong that this unlock_unwind_and_return:
// is skipped in the event of an exception but apparently
// the template interpreter does this so we do too. // Unlock if necessary
if (monitor && !HAS_PENDING_EXCEPTION) { if (monitor) {
BasicLock *lock = monitor->lock(); BasicLock *lock = monitor->lock();
markOop header = lock->displaced_header(); markOop header = lock->displaced_header();
oop rcvr = monitor->obj(); oop rcvr = monitor->obj();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册