< prev index next >

src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp

Print this page

124     __ bind(L_already_dirty);
125   } else {
126     __ movb(card_addr, dirty);
127   }
128 }
129 
130 void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
131                                                 Address dst, Register val, Register tmp1, Register tmp2, Register tmp3) {
132   bool in_heap = (decorators & IN_HEAP) != 0;
133 
134   bool is_array = (decorators & IS_ARRAY) != 0;
135   bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
136   bool precise = is_array || on_anonymous;
137 
138   bool needs_post_barrier = val != noreg && in_heap;
139 
140   BarrierSetAssembler::store_at(masm, decorators, type, dst, val, noreg, noreg, noreg);
141   if (needs_post_barrier) {
142     // flatten object address if needed
143     if (!precise || (dst.index() == noreg && dst.disp() == 0)) {
144       store_check(masm, dst.base(), dst);







145     } else {
146       __ lea(tmp1, dst);
147       store_check(masm, tmp1, dst);
148     }
149   }
150 }

124     __ bind(L_already_dirty);
125   } else {
126     __ movb(card_addr, dirty);
127   }
128 }
129 
130 void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
131                                                 Address dst, Register val, Register tmp1, Register tmp2, Register tmp3) {
132   bool in_heap = (decorators & IN_HEAP) != 0;
133 
134   bool is_array = (decorators & IS_ARRAY) != 0;
135   bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
136   bool precise = is_array || on_anonymous;
137 
138   bool needs_post_barrier = val != noreg && in_heap;
139 
140   BarrierSetAssembler::store_at(masm, decorators, type, dst, val, noreg, noreg, noreg);
141   if (needs_post_barrier) {
142     // flatten object address if needed
143     if (!precise || (dst.index() == noreg && dst.disp() == 0)) {
144       if (tmp3 != noreg) {
145         // Called by MacroAssembler::pack_inline_helper. We cannot corrupt the dst.base() register
146         __ movptr(tmp3, dst.base());
147         store_check(masm, tmp3, dst);
148       } else {
149         // It's OK to corrupt the dst.base() register.
150         store_check(masm, dst.base(), dst);
151       }
152     } else {
153       __ lea(tmp1, dst);
154       store_check(masm, tmp1, dst);
155     }
156   }
157 }
< prev index next >