--- old/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp 2018-05-07 15:51:59.408301803 +0200 +++ new/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp 2018-05-07 15:51:59.132297129 +0200 @@ -671,12 +671,12 @@ // get synchronization object { - Label done; + Label check_value_recv, done; __ movl(rax, access_flags); __ testl(rax, JVM_ACC_STATIC); // get receiver (assume this is frequent case) __ movptr(rax, Address(rlocals, Interpreter::local_offset_in_bytes(0))); - __ jcc(Assembler::zero, done); + __ jcc(Assembler::zero, (EnableValhalla) ? check_value_recv : done); __ load_mirror(rax, rbx); #ifdef ASSERT @@ -688,7 +688,14 @@ __ bind(L); } #endif // ASSERT - + __ jmp(done); + if (EnableValhalla) { + __ bind(check_value_recv); + __ test_oop_is_not_value(rax, rbx, done); + __ call_VM(noreg, CAST_FROM_FN_PTR(address, + InterpreterRuntime::throw_illegal_monitor_state_exception)); + __ should_not_reach_here(); + } __ bind(done); }