< prev index next >

src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp

Print this page

132   if ((decorators & ON_WEAK_OOP_REF) != 0) {
133     return _load_barrier_on_weak_oop_field_preloaded_runtime_stub;
134   } else {
135     return _load_barrier_on_oop_field_preloaded_runtime_stub;
136   }
137 }
138 
139 #ifdef ASSERT
140 #define __ access.gen()->lir(__FILE__, __LINE__)->
141 #else
142 #define __ access.gen()->lir()->
143 #endif
144 
145 void ZBarrierSetC1::load_barrier(LIRAccess& access, LIR_Opr result) const {
146   // Fast path
147   __ append(new LIR_OpZLoadBarrierTest(result));
148 
149   // Slow path
150   const address runtime_stub = load_barrier_on_oop_field_preloaded_runtime_stub(access.decorators());
151   CodeStub* const stub = new ZLoadBarrierStubC1(access, result, runtime_stub);



152   __ branch(lir_cond_notEqual, stub);
153   __ branch_destination(stub->continuation());
154 }
155 
156 LIR_Opr ZBarrierSetC1::resolve_address(LIRAccess& access, bool resolve_in_register) {
157   // We must resolve in register when patching. This is to avoid
158   // having a patch area in the load barrier stub, since the call
159   // into the runtime to patch will not have the proper oop map.
160   const bool patch_before_barrier = barrier_needed(access) && (access.decorators() & C1_NEEDS_PATCHING) != 0;
161   return BarrierSetC1::resolve_address(access, resolve_in_register || patch_before_barrier);
162 }
163 
164 #undef __
165 
166 void ZBarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result) {
167   BarrierSetC1::load_at_resolved(access, result);
168 
169   if (barrier_needed(access)) {
170     load_barrier(access, result);
171   }

132   if ((decorators & ON_WEAK_OOP_REF) != 0) {
133     return _load_barrier_on_weak_oop_field_preloaded_runtime_stub;
134   } else {
135     return _load_barrier_on_oop_field_preloaded_runtime_stub;
136   }
137 }
138 
139 #ifdef ASSERT
140 #define __ access.gen()->lir(__FILE__, __LINE__)->
141 #else
142 #define __ access.gen()->lir()->
143 #endif
144 
145 void ZBarrierSetC1::load_barrier(LIRAccess& access, LIR_Opr result) const {
146   // Fast path
147   __ append(new LIR_OpZLoadBarrierTest(result));
148 
149   // Slow path
150   const address runtime_stub = load_barrier_on_oop_field_preloaded_runtime_stub(access.decorators());
151   CodeStub* const stub = new ZLoadBarrierStubC1(access, result, runtime_stub);
152 #ifdef RISCV
153   __ cmp(lir_cond_notEqual, FrameMap::t1_long_opr, LIR_OprFact::longConst(0));
154 #endif
155   __ branch(lir_cond_notEqual, stub);
156   __ branch_destination(stub->continuation());
157 }
158 
159 LIR_Opr ZBarrierSetC1::resolve_address(LIRAccess& access, bool resolve_in_register) {
160   // We must resolve in register when patching. This is to avoid
161   // having a patch area in the load barrier stub, since the call
162   // into the runtime to patch will not have the proper oop map.
163   const bool patch_before_barrier = barrier_needed(access) && (access.decorators() & C1_NEEDS_PATCHING) != 0;
164   return BarrierSetC1::resolve_address(access, resolve_in_register || patch_before_barrier);
165 }
166 
167 #undef __
168 
169 void ZBarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result) {
170   BarrierSetC1::load_at_resolved(access, result);
171 
172   if (barrier_needed(access)) {
173     load_barrier(access, result);
174   }
< prev index next >