< prev index next >

src/hotspot/share/gc/z/zNMethod.cpp

Print this page




 241 
 242 void ZNMethod::oops_do_begin() {
 243   ZNMethodTable::nmethods_do_begin();
 244 }
 245 
 246 void ZNMethod::oops_do_end() {
 247   ZNMethodTable::nmethods_do_end();
 248 }
 249 
 250 void ZNMethod::oops_do(OopClosure* cl) {
 251   ZNMethodToOopsDoClosure nmethod_cl(cl);
 252   ZNMethodTable::nmethods_do(&nmethod_cl);
 253 }
 254 
 255 class ZNMethodUnlinkClosure : public NMethodClosure {
 256 private:
 257   bool          _unloading_occurred;
 258   volatile bool _failed;
 259 
 260   void set_failed() {
 261     Atomic::store(true, &_failed);
 262   }
 263 
 264   void unlink(nmethod* nm) {
 265     // Unlinking of the dependencies must happen before the
 266     // handshake separating unlink and purge.
 267     nm->flush_dependencies(false /* delete_immediately */);
 268 
 269     // unlink_from_method will take the CompiledMethod_lock.
 270     // In this case we don't strictly need it when unlinking nmethods from
 271     // the Method, because it is only concurrently unlinked by
 272     // the entry barrier, which acquires the per nmethod lock.
 273     nm->unlink_from_method();
 274 
 275     if (nm->is_osr_method()) {
 276       // Invalidate the osr nmethod before the handshake. The nmethod
 277       // will be made unloaded after the handshake. Then invalidate_osr_method()
 278       // will be called again, which will be a no-op.
 279       nm->invalidate_osr_method();
 280     }
 281   }




 241 
 242 void ZNMethod::oops_do_begin() {
 243   ZNMethodTable::nmethods_do_begin();
 244 }
 245 
 246 void ZNMethod::oops_do_end() {
 247   ZNMethodTable::nmethods_do_end();
 248 }
 249 
 250 void ZNMethod::oops_do(OopClosure* cl) {
 251   ZNMethodToOopsDoClosure nmethod_cl(cl);
 252   ZNMethodTable::nmethods_do(&nmethod_cl);
 253 }
 254 
 255 class ZNMethodUnlinkClosure : public NMethodClosure {
 256 private:
 257   bool          _unloading_occurred;
 258   volatile bool _failed;
 259 
 260   void set_failed() {
 261     Atomic::store(&_failed, true);
 262   }
 263 
 264   void unlink(nmethod* nm) {
 265     // Unlinking of the dependencies must happen before the
 266     // handshake separating unlink and purge.
 267     nm->flush_dependencies(false /* delete_immediately */);
 268 
 269     // unlink_from_method will take the CompiledMethod_lock.
 270     // In this case we don't strictly need it when unlinking nmethods from
 271     // the Method, because it is only concurrently unlinked by
 272     // the entry barrier, which acquires the per nmethod lock.
 273     nm->unlink_from_method();
 274 
 275     if (nm->is_osr_method()) {
 276       // Invalidate the osr nmethod before the handshake. The nmethod
 277       // will be made unloaded after the handshake. Then invalidate_osr_method()
 278       // will be called again, which will be a no-op.
 279       nm->invalidate_osr_method();
 280     }
 281   }


< prev index next >