99 |
99 |
100 __ branch(lir_cond_notEqual, T_INT, slow); |
100 __ branch(lir_cond_notEqual, T_INT, slow); |
101 __ branch_destination(slow->continuation()); |
101 __ branch_destination(slow->continuation()); |
102 } |
102 } |
103 |
103 |
104 LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier(LIRGenerator* gen, LIR_Opr obj, CodeEmitInfo* info, bool need_null_check) { |
104 LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier(LIRGenerator* gen, LIR_Opr obj) { |
105 if (ShenandoahLoadRefBarrier) { |
105 if (ShenandoahLoadRefBarrier) { |
106 return load_reference_barrier_impl(gen, obj, info, need_null_check); |
106 return load_reference_barrier_impl(gen, obj); |
107 } else { |
107 } else { |
108 return obj; |
108 return obj; |
109 } |
109 } |
110 } |
110 } |
111 |
111 |
112 LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj, CodeEmitInfo* info, bool need_null_check) { |
112 LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj) { |
113 assert(ShenandoahLoadRefBarrier, "Should be enabled"); |
113 assert(ShenandoahLoadRefBarrier, "Should be enabled"); |
114 |
114 |
115 obj = ensure_in_register(gen, obj); |
115 obj = ensure_in_register(gen, obj); |
116 assert(obj->is_register(), "must be a register at this point"); |
116 assert(obj->is_register(), "must be a register at this point"); |
117 LIR_Opr result = gen->new_register(T_OBJECT); |
117 LIR_Opr result = gen->new_register(T_OBJECT); |
138 __ logical_and(flag_val, mask_reg, masked_flag); |
138 __ logical_and(flag_val, mask_reg, masked_flag); |
139 flag_val = masked_flag; |
139 flag_val = masked_flag; |
140 } |
140 } |
141 __ cmp(lir_cond_notEqual, flag_val, LIR_OprFact::intConst(0)); |
141 __ cmp(lir_cond_notEqual, flag_val, LIR_OprFact::intConst(0)); |
142 |
142 |
143 CodeStub* slow = new ShenandoahLoadReferenceBarrierStub(obj, result, info ? new CodeEmitInfo(info) : NULL, need_null_check); |
143 CodeStub* slow = new ShenandoahLoadReferenceBarrierStub(obj, result); |
144 __ branch(lir_cond_notEqual, T_INT, slow); |
144 __ branch(lir_cond_notEqual, T_INT, slow); |
145 __ branch_destination(slow->continuation()); |
145 __ branch_destination(slow->continuation()); |
146 |
146 |
147 return result; |
147 return result; |
148 } |
148 } |
202 } |
202 } |
203 |
203 |
204 if (ShenandoahLoadRefBarrier) { |
204 if (ShenandoahLoadRefBarrier) { |
205 LIR_Opr tmp = gen->new_register(T_OBJECT); |
205 LIR_Opr tmp = gen->new_register(T_OBJECT); |
206 BarrierSetC1::load_at_resolved(access, tmp); |
206 BarrierSetC1::load_at_resolved(access, tmp); |
207 tmp = load_reference_barrier(access.gen(), tmp, access.access_emit_info(), true); |
207 tmp = load_reference_barrier(access.gen(), tmp); |
208 __ move(tmp, result); |
208 __ move(tmp, result); |
209 } else { |
209 } else { |
210 BarrierSetC1::load_at_resolved(access, result); |
210 BarrierSetC1::load_at_resolved(access, result); |
211 } |
211 } |
212 |
212 |