< prev index next >

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

Print this page

 61   const Register end = count;
 62 
 63   __ cbz(count, L_done); // zero count - nothing to do
 64 
 65   __ lea(end, Address(start, count, Address::lsl(LogBytesPerHeapOop))); // end = start + count << LogBytesPerHeapOop
 66   __ sub(end, end, BytesPerHeapOop); // last element address to make inclusive
 67   __ lsr(start, start, CardTable::card_shift);
 68   __ lsr(end, end, CardTable::card_shift);
 69   __ sub(count, end, start); // number of bytes to copy
 70 
 71   __ load_byte_map_base(scratch);
 72   __ add(start, start, scratch);
 73   __ bind(L_loop);
 74   __ strb(zr, Address(start, count));
 75   __ subs(count, count, 1);
 76   __ br(Assembler::GE, L_loop);
 77   __ bind(L_done);
 78 }
 79 
 80 void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
 81                                                 Address dst, Register val, Register tmp1, Register tmp2) {
 82   bool in_heap = (decorators & IN_HEAP) != 0;
 83   bool is_array = (decorators & IS_ARRAY) != 0;
 84   bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
 85   bool precise = is_array || on_anonymous;
 86 
 87   bool needs_post_barrier = val != noreg && in_heap;
 88   BarrierSetAssembler::store_at(masm, decorators, type, dst, val, noreg, noreg);
 89   if (needs_post_barrier) {
 90     // flatten object address if needed
 91     if (!precise || (dst.index() == noreg && dst.offset() == 0)) {
 92       store_check(masm, dst.base(), dst);








 93     } else {
 94       __ lea(r3, dst);
 95       store_check(masm, r3, dst);
 96     }
 97   }

 98 }

 61   const Register end = count;
 62 
 63   __ cbz(count, L_done); // zero count - nothing to do
 64 
 65   __ lea(end, Address(start, count, Address::lsl(LogBytesPerHeapOop))); // end = start + count << LogBytesPerHeapOop
 66   __ sub(end, end, BytesPerHeapOop); // last element address to make inclusive
 67   __ lsr(start, start, CardTable::card_shift);
 68   __ lsr(end, end, CardTable::card_shift);
 69   __ sub(count, end, start); // number of bytes to copy
 70 
 71   __ load_byte_map_base(scratch);
 72   __ add(start, start, scratch);
 73   __ bind(L_loop);
 74   __ strb(zr, Address(start, count));
 75   __ subs(count, count, 1);
 76   __ br(Assembler::GE, L_loop);
 77   __ bind(L_done);
 78 }
 79 
 80 void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
 81                                                 Address dst, Register val, Register tmp1, Register tmp2, Register tmp3) {
 82   bool in_heap = (decorators & IN_HEAP) != 0;
 83   bool is_array = (decorators & IS_ARRAY) != 0;
 84   bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
 85   bool precise = is_array || on_anonymous;
 86 
 87   bool needs_post_barrier = val != noreg && in_heap;
 88   BarrierSetAssembler::store_at(masm, decorators, type, dst, val, noreg, noreg, noreg);
 89   if (needs_post_barrier) {
 90     // flatten object address if needed
 91     if (!precise || (dst.index() == noreg && dst.offset() == 0)) {
 92       if (tmp3 != noreg) {
 93         // Called by MacroAssembler::pack_inline_helper. We cannot corrupt the dst.base() register
 94         __ mov(tmp3, dst.base());
 95         store_check(masm, tmp3, dst);
 96       } else {
 97         // It's OK to corrupt the dst.base() register.
 98         store_check(masm, dst.base(), dst);
 99       }
100 
101     } else {
102       __ lea(r3, dst);
103       store_check(masm, r3, dst);
104     }
105   }
106 
107 }
< prev index next >