< prev index next >

src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp

Print this page

        

@@ -669,16 +669,16 @@
   }
 #endif // ASSERT
 
   // 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
     {
       Label L;

@@ -686,11 +686,18 @@
       __ jcc(Assembler::notZero, L);
       __ stop("synchronization object is NULL");
       __ 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);
   }
 
   // add space for monitor & lock
   __ subptr(rsp, entry_size); // add space for a monitor entry
< prev index next >