< prev index next >

src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp

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


  74   Label slow;
  75 
  76   unsigned long offset;
  77   __ adrp(rcounter_addr,
  78           SafepointSynchronize::safepoint_counter_addr(), offset);
  79   Address safepoint_counter_addr(rcounter_addr, offset);
  80   __ ldrw(rcounter, safepoint_counter_addr);
  81   __ tbnz(rcounter, 0, slow);
  82   __ eor(robj, c_rarg1, rcounter);
  83   __ eor(robj, robj, rcounter);               // obj, since
  84                                               // robj ^ rcounter ^ rcounter == robj
  85                                               // robj is address dependent on rcounter.
  86 
  87   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
  88   bs->try_resolve_jobject_in_native(masm, c_rarg0, robj, rscratch1, slow);
  89 
  90   __ lsr(roffset, c_rarg2, 2);                // offset
  91 
  92   assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
  93   speculative_load_pclist[count] = __ pc();   // Used by the segfault handler



  94   switch (type) {
  95     case T_BOOLEAN: __ ldrb    (result, Address(robj, roffset)); break;
  96     case T_BYTE:    __ ldrsb   (result, Address(robj, roffset)); break;
  97     case T_CHAR:    __ ldrh    (result, Address(robj, roffset)); break;
  98     case T_SHORT:   __ ldrsh   (result, Address(robj, roffset)); break;
  99     case T_FLOAT:   __ ldrw    (result, Address(robj, roffset)); break;
 100     case T_INT:     __ ldrsw   (result, Address(robj, roffset)); break;
 101     case T_DOUBLE:
 102     case T_LONG:    __ ldr     (result, Address(robj, roffset)); break;
 103     default:        ShouldNotReachHere();




 104   }
 105 
 106   // counter_addr is address dependent on result.
 107   __ eor(rcounter_addr, rcounter_addr, result);
 108   __ eor(rcounter_addr, rcounter_addr, result);
 109   __ ldrw(rscratch1, safepoint_counter_addr);
 110   __ cmpw(rcounter, rscratch1);
 111   __ br (Assembler::NE, slow);
 112 
 113   switch (type) {
 114     case T_FLOAT:   __ fmovs(v0, result); break;
 115     case T_DOUBLE:  __ fmovd(v0, result); break;
 116     default:        __ mov(r0, result);   break;
 117   }
 118   __ ret(lr);
 119 
 120   slowcase_entry_pclist[count++] = __ pc();
 121   __ bind(slow);
 122   address slow_case_addr;
 123   switch (type) {
 124     case T_BOOLEAN: slow_case_addr = jni_GetBooleanField_addr(); break;
 125     case T_BYTE:    slow_case_addr = jni_GetByteField_addr();    break;
 126     case T_CHAR:    slow_case_addr = jni_GetCharField_addr();    break;
 127     case T_SHORT:   slow_case_addr = jni_GetShortField_addr();   break;
 128     case T_INT:     slow_case_addr = jni_GetIntField_addr();     break;
 129     case T_LONG:    slow_case_addr = jni_GetLongField_addr();    break;
 130     case T_FLOAT:   slow_case_addr = jni_GetFloatField_addr();   break;
 131     case T_DOUBLE:  slow_case_addr = jni_GetDoubleField_addr();  break;
 132     default:        ShouldNotReachHere();
 133       slow_case_addr = NULL;  // unreachable
 134   }
 135 
 136   {
 137     __ enter();




  74   Label slow;
  75 
  76   unsigned long offset;
  77   __ adrp(rcounter_addr,
  78           SafepointSynchronize::safepoint_counter_addr(), offset);
  79   Address safepoint_counter_addr(rcounter_addr, offset);
  80   __ ldrw(rcounter, safepoint_counter_addr);
  81   __ tbnz(rcounter, 0, slow);
  82   __ eor(robj, c_rarg1, rcounter);
  83   __ eor(robj, robj, rcounter);               // obj, since
  84                                               // robj ^ rcounter ^ rcounter == robj
  85                                               // robj is address dependent on rcounter.
  86 
  87   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
  88   bs->try_resolve_jobject_in_native(masm, c_rarg0, robj, rscratch1, slow);
  89 
  90   __ lsr(roffset, c_rarg2, 2);                // offset
  91 
  92   assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
  93   speculative_load_pclist[count] = __ pc();   // Used by the segfault handler
  94   __ access_load_at(type, IN_HEAP, noreg /* tos: r0/v0 */, Address(robj, roffset), noreg, noreg);
  95 
  96   // Ensure that field has finished loading before loading the safepoint_counter.
  97   switch (type) {
  98     case T_FLOAT:





  99     case T_DOUBLE:
 100       __ membar(MacroAssembler::LoadLoad);
 101       break;
 102     default:
 103       // counter_addr is address dependent on result.
 104       __ eor(rcounter_addr, rcounter_addr, r0);
 105       __ eor(rcounter_addr, rcounter_addr, r0);
 106   }
 107 



 108   __ ldrw(rscratch1, safepoint_counter_addr);
 109   __ cmpw(rcounter, rscratch1);
 110   __ br (Assembler::NE, slow);






 111   __ ret(lr);
 112 
 113   slowcase_entry_pclist[count++] = __ pc();
 114   __ bind(slow);
 115   address slow_case_addr;
 116   switch (type) {
 117     case T_BOOLEAN: slow_case_addr = jni_GetBooleanField_addr(); break;
 118     case T_BYTE:    slow_case_addr = jni_GetByteField_addr();    break;
 119     case T_CHAR:    slow_case_addr = jni_GetCharField_addr();    break;
 120     case T_SHORT:   slow_case_addr = jni_GetShortField_addr();   break;
 121     case T_INT:     slow_case_addr = jni_GetIntField_addr();     break;
 122     case T_LONG:    slow_case_addr = jni_GetLongField_addr();    break;
 123     case T_FLOAT:   slow_case_addr = jni_GetFloatField_addr();   break;
 124     case T_DOUBLE:  slow_case_addr = jni_GetDoubleField_addr();  break;
 125     default:        ShouldNotReachHere();
 126       slow_case_addr = NULL;  // unreachable
 127   }
 128 
 129   {
 130     __ enter();


< prev index next >