< prev index next >

src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp

Print this page




  74 
  75   __ lea(end, Address(start, count, Address::lsl(LogBytesPerHeapOop))); // end = start + count << LogBytesPerHeapOop
  76   __ sub(end, end, BytesPerHeapOop); // last element address to make inclusive
  77   __ lsr(start, start, CardTable::card_shift);
  78   __ lsr(end, end, CardTable::card_shift);
  79   __ sub(count, end, start); // number of bytes to copy
  80 
  81   __ load_byte_map_base(scratch);
  82   __ add(start, start, scratch);
  83   if (ct->scanned_concurrently()) {
  84     __ membar(__ StoreStore);
  85   }
  86   __ bind(L_loop);
  87   __ strb(zr, Address(start, count));
  88   __ subs(count, count, 1);
  89   __ br(Assembler::GE, L_loop);
  90   __ bind(L_done);
  91 }
  92 
  93 void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
  94                                                 Address dst, Register val, Register tmp1, Register tmp2) {
  95   bool in_heap = (decorators & IN_HEAP) != 0;
  96   bool is_array = (decorators & IS_ARRAY) != 0;
  97   bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
  98   bool precise = is_array || on_anonymous;
  99 
 100   bool needs_post_barrier = val != noreg && in_heap;
 101   BarrierSetAssembler::store_at(masm, decorators, type, dst, val, noreg, noreg);
 102   if (needs_post_barrier) {
 103     // flatten object address if needed
 104     if (!precise || (dst.index() == noreg && dst.offset() == 0)) {






 105       store_check(masm, dst.base(), dst);


 106     } else {
 107       __ lea(r3, dst);
 108       store_check(masm, r3, dst);
 109     }
 110   }
 111 }


  74 
  75   __ lea(end, Address(start, count, Address::lsl(LogBytesPerHeapOop))); // end = start + count << LogBytesPerHeapOop
  76   __ sub(end, end, BytesPerHeapOop); // last element address to make inclusive
  77   __ lsr(start, start, CardTable::card_shift);
  78   __ lsr(end, end, CardTable::card_shift);
  79   __ sub(count, end, start); // number of bytes to copy
  80 
  81   __ load_byte_map_base(scratch);
  82   __ add(start, start, scratch);
  83   if (ct->scanned_concurrently()) {
  84     __ membar(__ StoreStore);
  85   }
  86   __ bind(L_loop);
  87   __ strb(zr, Address(start, count));
  88   __ subs(count, count, 1);
  89   __ br(Assembler::GE, L_loop);
  90   __ bind(L_done);
  91 }
  92 
  93 void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
  94                                                 Address dst, Register val, Register tmp1, Register tmp2, Register tmp3) {
  95   bool in_heap = (decorators & IN_HEAP) != 0;
  96   bool is_array = (decorators & IS_ARRAY) != 0;
  97   bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
  98   bool precise = is_array || on_anonymous;
  99 
 100   bool needs_post_barrier = val != noreg && in_heap;
 101   BarrierSetAssembler::store_at(masm, decorators, type, dst, val, noreg, noreg, noreg);
 102   if (needs_post_barrier) {
 103     // flatten object address if needed
 104     if (!precise || (dst.index() == noreg && dst.offset() == 0)) {
 105       if (tmp3 != noreg) {
 106         // Called by MacroAssembler::pack_value_helper. We cannot corrupt the dst.base() register
 107         __ mov(tmp3, dst.base());
 108         store_check(masm, tmp3, dst);
 109       } else {
 110         // It's OK to corrupt the dst.base() register.
 111         store_check(masm, dst.base(), dst);
 112       }
 113 
 114     } else {
 115       __ lea(r3, dst);
 116       store_check(masm, r3, dst);
 117     }
 118   }
 119 }
< prev index next >