mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8246381: VM crashes with "Current BasicObjectLock* below than low_mark"
Save and restores "donotunlock" flag in check_and_handle_async_exceptions Reviewed-by: coleenp, dholmes
This commit is contained in:
parent
4320afbd58
commit
d63aebe6cb
3 changed files with 22 additions and 17 deletions
|
@ -74,21 +74,6 @@
|
|||
#include "opto/runtime.hpp"
|
||||
#endif
|
||||
|
||||
class UnlockFlagSaver {
|
||||
private:
|
||||
JavaThread* _thread;
|
||||
bool _do_not_unlock;
|
||||
public:
|
||||
UnlockFlagSaver(JavaThread* t) {
|
||||
_thread = t;
|
||||
_do_not_unlock = t->do_not_unlock_if_synchronized();
|
||||
t->set_do_not_unlock_if_synchronized(false);
|
||||
}
|
||||
~UnlockFlagSaver() {
|
||||
_thread->set_do_not_unlock_if_synchronized(_do_not_unlock);
|
||||
}
|
||||
};
|
||||
|
||||
// Helper class to access current interpreter state
|
||||
class LastFrameAccessor : public StackObj {
|
||||
frame _last_frame;
|
||||
|
@ -1064,6 +1049,9 @@ nmethod* InterpreterRuntime::frequency_counter_overflow(JavaThread* thread, addr
|
|||
|
||||
JRT_ENTRY(nmethod*,
|
||||
InterpreterRuntime::frequency_counter_overflow_inner(JavaThread* thread, address branch_bcp))
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
return NULL;
|
||||
}
|
||||
// use UnlockFlagSaver to clear and restore the _do_not_unlock_if_synchronized
|
||||
// flag, in case this method triggers classloading which will call into Java.
|
||||
UnlockFlagSaver fs(thread);
|
||||
|
@ -1074,7 +1062,6 @@ JRT_ENTRY(nmethod*,
|
|||
const int branch_bci = branch_bcp != NULL ? method->bci_from(branch_bcp) : InvocationEntryBci;
|
||||
const int bci = branch_bcp != NULL ? method->bci_from(last_frame.bcp()) : InvocationEntryBci;
|
||||
|
||||
assert(!HAS_PENDING_EXCEPTION, "Should not have any exceptions pending");
|
||||
nmethod* osr_nm = CompilationPolicy::policy()->event(method, method, branch_bci, bci, CompLevel_none, NULL, thread);
|
||||
assert(!HAS_PENDING_EXCEPTION, "Event handler should not throw any exceptions");
|
||||
|
||||
|
@ -1117,6 +1104,9 @@ JRT_LEAF(jint, InterpreterRuntime::bcp_to_di(Method* method, address cur_bcp))
|
|||
JRT_END
|
||||
|
||||
JRT_ENTRY(void, InterpreterRuntime::profile_method(JavaThread* thread))
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
return;
|
||||
}
|
||||
// use UnlockFlagSaver to clear and restore the _do_not_unlock_if_synchronized
|
||||
// flag, in case this method triggers classloading which will call into Java.
|
||||
UnlockFlagSaver fs(thread);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue