203 if (!access.is_oop()) {
204 BarrierSetC1::load_at_resolved(access, result);
205 return;
206 }
207
208 LIRGenerator* gen = access.gen();
209 DecoratorSet decorators = access.decorators();
210 BasicType type = access.type();
211
212 // 2: load a reference from src location and apply LRB if ShenandoahLoadRefBarrier is set
213 if (ShenandoahBarrierSet::need_load_reference_barrier(decorators, type)) {
214 LIR_Opr tmp = gen->new_register(T_OBJECT);
215 BarrierSetC1::load_at_resolved(access, tmp);
216 bool is_native = ShenandoahBarrierSet::use_load_reference_barrier_native(decorators, type);
217 tmp = load_reference_barrier(gen, tmp, access.resolved_addr(), is_native);
218 __ move(tmp, result);
219 } else {
220 BarrierSetC1::load_at_resolved(access, result);
221 }
222
223 // 3: apply keep-alive barrier if ShenandoahKeepAliveBarrier is set
224 if (ShenandoahKeepAliveBarrier) {
225 bool is_weak = (decorators & ON_WEAK_OOP_REF) != 0;
226 bool is_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
227 bool is_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
228 bool is_traversal_mode = ShenandoahHeap::heap()->is_traversal_mode();
229 bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0 || is_traversal_mode;
230
231 if ((is_weak || is_phantom || is_anonymous) && keep_alive) {
232 // Register the value in the referent field with the pre-barrier
233 LabelObj *Lcont_anonymous;
234 if (is_anonymous) {
235 Lcont_anonymous = new LabelObj();
236 generate_referent_check(access, Lcont_anonymous);
237 }
238 pre_barrier(gen, access.access_emit_info(), decorators, LIR_OprFact::illegalOpr /* addr_opr */,
239 result /* pre_val */);
240 if (is_anonymous) {
241 __ branch_destination(Lcont_anonymous->label());
242 }
243 }
244 }
|
203 if (!access.is_oop()) {
204 BarrierSetC1::load_at_resolved(access, result);
205 return;
206 }
207
208 LIRGenerator* gen = access.gen();
209 DecoratorSet decorators = access.decorators();
210 BasicType type = access.type();
211
212 // 2: load a reference from src location and apply LRB if ShenandoahLoadRefBarrier is set
213 if (ShenandoahBarrierSet::need_load_reference_barrier(decorators, type)) {
214 LIR_Opr tmp = gen->new_register(T_OBJECT);
215 BarrierSetC1::load_at_resolved(access, tmp);
216 bool is_native = ShenandoahBarrierSet::use_load_reference_barrier_native(decorators, type);
217 tmp = load_reference_barrier(gen, tmp, access.resolved_addr(), is_native);
218 __ move(tmp, result);
219 } else {
220 BarrierSetC1::load_at_resolved(access, result);
221 }
222
223 // 3: apply keep-alive barrier if ShenandoahSATBBarrier is set
224 if (ShenandoahSATBBarrier) {
225 bool is_weak = (decorators & ON_WEAK_OOP_REF) != 0;
226 bool is_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
227 bool is_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
228 bool is_traversal_mode = ShenandoahHeap::heap()->is_traversal_mode();
229 bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0 || is_traversal_mode;
230
231 if ((is_weak || is_phantom || is_anonymous) && keep_alive) {
232 // Register the value in the referent field with the pre-barrier
233 LabelObj *Lcont_anonymous;
234 if (is_anonymous) {
235 Lcont_anonymous = new LabelObj();
236 generate_referent_check(access, Lcont_anonymous);
237 }
238 pre_barrier(gen, access.access_emit_info(), decorators, LIR_OprFact::illegalOpr /* addr_opr */,
239 result /* pre_val */);
240 if (is_anonymous) {
241 __ branch_destination(Lcont_anonymous->label());
242 }
243 }
244 }
|