diff src/cpu/x86/vm/templateTable_x86.cpp @ 13581:c6b48833776d

8187625: [MVT] Interpreter cleanup Reviewed-by: dsimms
author fparain
date Mon, 18 Sep 2017 10:34:11 -0400
parents bc075a2f87ad
children
line wrap: on
line diff
--- a/src/cpu/x86/vm/templateTable_x86.cpp	Fri Sep 15 13:49:06 2017 -0700
+++ b/src/cpu/x86/vm/templateTable_x86.cpp	Mon Sep 18 10:34:11 2017 -0400
@@ -2874,6 +2874,7 @@
   const Register off   = rbx;
   const Register flags = rax;
   const Register bc    = LP64_ONLY(c_rarg3) NOT_LP64(rcx); // uses same reg as obj, so don't mix them
+  const Register flags2 = rdx;
 
   resolve_cache_and_index(byte_no, cache, index, sizeof(u2));
   jvmti_post_field_access(cache, index, is_static, false);
@@ -2884,6 +2885,8 @@
 
   Label Done, notByte, notBool, notInt, notShort, notChar, notLong, notFloat, notObj, notValueType, notDouble;
 
+  __ movl(flags2, flags);
+
   __ shrl(flags, ConstantPoolCacheEntry::tos_state_shift);
   // Make sure we don't need to mask edx after the above shift
   assert(btos == 0, "change code, btos != 0");
@@ -2912,15 +2915,17 @@
     __ load_heap_oop(rax, field);
     __ testptr(rax, rax);
     __ jcc(Assembler::notZero, initialized);
+    __ andl(flags2, ConstantPoolCacheEntry::field_index_mask);
     __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::initialize_static_value_field),
-         obj, off);
+         obj, flags2);
     __ verify_oop(rax);
     __ bind(initialized);
     __ push(qtos);
   } else {
     pop_and_check_object(obj);
+    __ andl(flags2, ConstantPoolCacheEntry::field_index_mask);
     call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::qgetfield),
-        obj, off);
+        obj, flags2);
     __ verify_oop(rax);
     __ push(qtos);
     // Bytecode rewrite?
@@ -3175,6 +3180,7 @@
   const Register off   = rbx;
   const Register flags = rax;
   const Register bc    = LP64_ONLY(c_rarg3) NOT_LP64(rcx);
+  const Register flags2 = rdx;
 
   resolve_cache_and_index(byte_no, cache, index, sizeof(u2));
   jvmti_post_field_mod(cache, index, is_static);
@@ -3185,9 +3191,8 @@
   //                                              Assembler::StoreStore));
 
   Label notVolatile, Done;
-  __ movl(rdx, flags);
-  __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift);
-  __ andl(rdx, 0x1);
+
+  __ movl(flags2, flags);
 
   // field addresses
   const Address field(obj, off, Address::times_1, 0*wordSize);
@@ -3254,17 +3259,16 @@
     __ pop(qtos); // => rax == value
     if (!is_static) {
       // value types in non-static fields are embedded
-      __ movl(rcx, off);
       pop_and_check_object(rbx);
       call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::qputfield),
-          rbx, rax, rcx);
+          rbx, rax, flags2);
       __ jmp(notVolatile); // value types are never volatile
     } else {
       // Store into the static field
       // Value types in static fields are currently handled with indirection
       // but a copy to the Java heap might be required if the value is currently
       // stored in a thread local buffer
-      call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::qputstatic), rax);
+      call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::qputstatic), rax, off, obj);
     }
     __ jmp(Done);
   }
@@ -3401,8 +3405,11 @@
 
   __ bind(Done);
 
+  __ shrl(flags2, ConstantPoolCacheEntry::is_volatile_shift);
+  __ andl(flags2, 0x1);
+
   // Check for volatile store
-  __ testl(rdx, rdx);
+  __ testl(flags2, flags2);
   __ jcc(Assembler::zero, notVolatile);
   volatile_barrier(Assembler::Membar_mask_bits(Assembler::StoreLoad |
                                                Assembler::StoreStore));