< prev index next >

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

Print this page

157 // not find the expected native instruction at this offset, which needs updating.
158 // Note that this offset is invariant of PreserveFramePointer.
159 static const int entry_barrier_offset = LP64_ONLY(-19) NOT_LP64(-18);
160 
161 static NativeNMethodCmpBarrier* native_nmethod_barrier(nmethod* nm) {
162   address barrier_address = nm->code_begin() + nm->frame_complete_offset() + entry_barrier_offset;
163   NativeNMethodCmpBarrier* barrier = reinterpret_cast<NativeNMethodCmpBarrier*>(barrier_address);
164   debug_only(barrier->verify());
165   return barrier;
166 }
167 
168 void BarrierSetNMethod::disarm(nmethod* nm) {
169   if (!supports_entry_barrier(nm)) {
170     return;
171   }
172 
173   NativeNMethodCmpBarrier* cmp = native_nmethod_barrier(nm);
174   cmp->set_immediate(disarmed_value());
175 }
176 









177 bool BarrierSetNMethod::is_armed(nmethod* nm) {
178   if (!supports_entry_barrier(nm)) {
179     return false;
180   }
181 
182   NativeNMethodCmpBarrier* cmp = native_nmethod_barrier(nm);
183   return (disarmed_value() != cmp->get_immedate());
184 }

157 // not find the expected native instruction at this offset, which needs updating.
158 // Note that this offset is invariant of PreserveFramePointer.
159 static const int entry_barrier_offset = LP64_ONLY(-19) NOT_LP64(-18);
160 
161 static NativeNMethodCmpBarrier* native_nmethod_barrier(nmethod* nm) {
162   address barrier_address = nm->code_begin() + nm->frame_complete_offset() + entry_barrier_offset;
163   NativeNMethodCmpBarrier* barrier = reinterpret_cast<NativeNMethodCmpBarrier*>(barrier_address);
164   debug_only(barrier->verify());
165   return barrier;
166 }
167 
168 void BarrierSetNMethod::disarm(nmethod* nm) {
169   if (!supports_entry_barrier(nm)) {
170     return;
171   }
172 
173   NativeNMethodCmpBarrier* cmp = native_nmethod_barrier(nm);
174   cmp->set_immediate(disarmed_value());
175 }
176 
177 void BarrierSetNMethod::arm(nmethod* nm, int arm_value) {
178   if (!supports_entry_barrier(nm)) {
179     return;
180   }
181 
182   NativeNMethodCmpBarrier* cmp = native_nmethod_barrier(nm);
183   cmp->set_immediate(arm_value);
184 }
185 
186 bool BarrierSetNMethod::is_armed(nmethod* nm) {
187   if (!supports_entry_barrier(nm)) {
188     return false;
189   }
190 
191   NativeNMethodCmpBarrier* cmp = native_nmethod_barrier(nm);
192   return (disarmed_value() != cmp->get_immedate());
193 }
< prev index next >