< prev index next >

src/hotspot/cpu/x86/templateTable_x86.cpp

Print this page

        

@@ -3450,12 +3450,15 @@
         // Store into the field
         do_oop_store(_masm, field, rax);
         __ jmp(rewriteFlattenable);
         __ bind(isFlattened);
         pop_and_check_object(obj);
-        call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::write_flattened_value),
-                rax, off, obj);
+        assert_different_registers(rax, rdx, obj, off);
+        __ load_klass(rdx, rax);
+        __ data_for_oop(rax, rax, rdx);
+        __ addptr(obj, off);
+        __ access_value_copy(IN_HEAP, rax, obj, rdx);
         __ bind(rewriteFlattenable);
         if (rc == may_rewrite) {
           patch_bytecode(Bytecodes::_fast_qputfield, bc, rbx, true, byte_no);
         }
         __ jmp(Done);

@@ -3664,11 +3667,11 @@
   // volatile_barrier(Assembler::Membar_mask_bits(Assembler::LoadStore |
   //                                              Assembler::StoreStore));
 
   Label notVolatile, Done;
   if (bytecode() == Bytecodes::_fast_qputfield) {
-    __ movl(rscratch2, rdx);
+    __ movl(rscratch2, rdx);  // saving flags for isFlattened test
   }
 
   __ shrl(rdx, ConstantPoolCacheEntry::is_volatile_shift);
   __ andl(rdx, 0x1);
 

@@ -3680,36 +3683,45 @@
 
   // Check for volatile store
   __ testl(rdx, rdx);
   __ jcc(Assembler::zero, notVolatile);
 
-  fast_storefield_helper(field, rax);
+  if (bytecode() == Bytecodes::_fast_qputfield) {
+    __ movl(rdx, rscratch2);  // restoring flags for isFlattened test
+  }
+  fast_storefield_helper(field, rax, rdx);
   volatile_barrier(Assembler::Membar_mask_bits(Assembler::StoreLoad |
                                                Assembler::StoreStore));
   __ jmp(Done);
   __ bind(notVolatile);
 
-  fast_storefield_helper(field, rax);
+  if (bytecode() == Bytecodes::_fast_qputfield) {
+    __ movl(rdx, rscratch2);  // restoring flags for isFlattened test
+  }
+  fast_storefield_helper(field, rax, rdx);
 
   __ bind(Done);
 }
 
-void TemplateTable::fast_storefield_helper(Address field, Register rax) {
+void TemplateTable::fast_storefield_helper(Address field, Register rax, Register flags) {
 
   // access field
   switch (bytecode()) {
   case Bytecodes::_fast_qputfield:
     {
       Label isFlattened, done;
       __ null_check(rax);
-      __ test_field_is_flattened(rscratch2, rscratch1, isFlattened);
+      __ test_field_is_flattened(flags, rscratch1, isFlattened);
       // No Flattened case
       do_oop_store(_masm, field, rax);
       __ jmp(done);
       __ bind(isFlattened);
-      call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::write_flattened_value),
-          rax, rbx, rcx);
+      // Flattened case
+      __ load_klass(rdx, rax);
+      __ data_for_oop(rax, rax, rdx);
+      __ lea(rcx, field);
+      __ access_value_copy(IN_HEAP, rax, rcx, rdx);
       __ bind(done);
     }
     break;
   case Bytecodes::_fast_aputfield:
     {
< prev index next >