< prev index next >

src/hotspot/cpu/x86/templateTable_x86.cpp

Print this page

@@ -2774,11 +2774,23 @@
                                     InterpreterRuntime::at_safepoint));
     __ pop(state);
     __ bind(no_safepoint);
   }
 
-  if (state == atos) {
+  if (EnableValhalla && state == atos) {
+    Label not_returning_null_vt;
+    const Register method = rbx, tmp = rdx;
+
+    __ testl(rax, rax);
+    __ jcc(Assembler::notZero, not_returning_null_vt);
+    __ get_method(method);
+    __ load_unsigned_short(tmp, Address(rbx, Method::flags_offset()));
+    __ testl(tmp, Method::is_returning_vt_mask());
+    __ jcc(Assembler::zero, not_returning_null_vt);
+    __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::deoptimize_caller_frame_for_vt), method);
+    __ bind(not_returning_null_vt);
+
     if (ValueTypesBufferMaxMemory > 0) {
       Label notBuffered;
 
       __ test_value_is_not_buffered(rax, rbx, notBuffered);
       const Register thread1 = NOT_LP64(rcx) LP64_ONLY(r15_thread);
< prev index next >