60 __ strb(zr, Address(obj, rscratch1)); |
60 __ strb(zr, Address(obj, rscratch1)); |
61 } |
61 } |
62 } |
62 } |
63 |
63 |
64 void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators, |
64 void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators, |
65 Register start, Register end, Register scratch, RegSet saved_regs) { |
65 Register start, Register count, Register scratch, RegSet saved_regs) { |
66 BarrierSet* bs = BarrierSet::barrier_set(); |
66 BarrierSet* bs = BarrierSet::barrier_set(); |
67 CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(bs); |
67 CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(bs); |
68 CardTable* ct = ctbs->card_table(); |
68 CardTable* ct = ctbs->card_table(); |
69 |
69 |
70 Label L_loop; |
70 Label L_loop, L_done; |
|
71 const Register end = count; |
71 |
72 |
|
73 __ cbz(count, L_done); // zero count - nothing to do |
|
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 |
72 __ lsr(start, start, CardTable::card_shift); |
77 __ lsr(start, start, CardTable::card_shift); |
73 __ lsr(end, end, CardTable::card_shift); |
78 __ lsr(end, end, CardTable::card_shift); |
74 __ sub(end, end, start); // number of bytes to copy |
79 __ sub(count, end, start); // number of bytes to copy |
75 |
80 |
76 const Register count = end; // 'end' register contains bytes count now |
|
77 __ load_byte_map_base(scratch); |
81 __ load_byte_map_base(scratch); |
78 __ add(start, start, scratch); |
82 __ add(start, start, scratch); |
79 if (ct->scanned_concurrently()) { |
83 if (ct->scanned_concurrently()) { |
80 __ membar(__ StoreStore); |
84 __ membar(__ StoreStore); |
81 } |
85 } |
82 __ bind(L_loop); |
86 __ bind(L_loop); |
83 __ strb(zr, Address(start, count)); |
87 __ strb(zr, Address(start, count)); |
84 __ subs(count, count, 1); |
88 __ subs(count, count, 1); |
85 __ br(Assembler::GE, L_loop); |
89 __ br(Assembler::GE, L_loop); |
|
90 __ bind(L_done); |
86 } |
91 } |
87 |
92 |
88 void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, |
93 void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, |
89 Address dst, Register val, Register tmp1, Register tmp2) { |
94 Address dst, Register val, Register tmp1, Register tmp2) { |
90 bool in_heap = (decorators & IN_HEAP) != 0; |
95 bool in_heap = (decorators & IN_HEAP) != 0; |