diff -r ac09c2498c64 -r 07540197d0fd src/hotspot/share/runtime/handshake.cpp --- a/src/hotspot/share/runtime/handshake.cpp Fri Mar 08 12:01:43 2019 +0100 +++ b/src/hotspot/share/runtime/handshake.cpp Fri Mar 08 12:51:36 2019 +0100 @@ -288,13 +288,14 @@ assert(Thread::current() == thread, "should call from thread"); assert(!thread->is_terminated(), "should not be a terminated thread"); - CautiouslyPreserveExceptionMark pem(thread); ThreadInVMForHandshake tivm(thread); if (!_semaphore.trywait()) { _semaphore.wait_with_safepoint_check(thread); } HandshakeOperation* op = OrderAccess::load_acquire(&_operation); if (op != NULL) { + HandleMark hm(thread); + CautiouslyPreserveExceptionMark pem(thread); // Disarm before execute the operation clear_handshake(thread); op->do_handshake(thread);