< prev index next >

src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp

Print this page
rev 50100 : 8203172: Primitive heap access for interpreter BarrierSetAssembler/aarch64

@@ -89,34 +89,27 @@
 
   __ lsr(roffset, c_rarg2, 2);                // offset
 
   assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
   speculative_load_pclist[count] = __ pc();   // Used by the segfault handler
+  __ access_load_at(type, IN_HEAP, noreg /* tos: r0/v0 */, Address(robj, roffset), noreg, noreg);
+
+  // Ensure that field has finished loading before loading the safepoint_counter.
   switch (type) {
-    case T_BOOLEAN: __ ldrb    (result, Address(robj, roffset)); break;
-    case T_BYTE:    __ ldrsb   (result, Address(robj, roffset)); break;
-    case T_CHAR:    __ ldrh    (result, Address(robj, roffset)); break;
-    case T_SHORT:   __ ldrsh   (result, Address(robj, roffset)); break;
-    case T_FLOAT:   __ ldrw    (result, Address(robj, roffset)); break;
-    case T_INT:     __ ldrsw   (result, Address(robj, roffset)); break;
+    case T_FLOAT:
     case T_DOUBLE:
-    case T_LONG:    __ ldr     (result, Address(robj, roffset)); break;
-    default:        ShouldNotReachHere();
+      __ membar(MacroAssembler::LoadLoad);
+      break;
+    default:
+      // counter_addr is address dependent on result.
+      __ eor(rcounter_addr, rcounter_addr, r0);
+      __ eor(rcounter_addr, rcounter_addr, r0);
   }
 
-  // counter_addr is address dependent on result.
-  __ eor(rcounter_addr, rcounter_addr, result);
-  __ eor(rcounter_addr, rcounter_addr, result);
   __ ldrw(rscratch1, safepoint_counter_addr);
   __ cmpw(rcounter, rscratch1);
   __ br (Assembler::NE, slow);
-
-  switch (type) {
-    case T_FLOAT:   __ fmovs(v0, result); break;
-    case T_DOUBLE:  __ fmovd(v0, result); break;
-    default:        __ mov(r0, result);   break;
-  }
   __ ret(lr);
 
   slowcase_entry_pclist[count++] = __ pc();
   __ bind(slow);
   address slow_case_addr;
< prev index next >