src/share/vm/memory/universe.cpp

Print this page




1239   if (CodeCache::number_of_nmethods_with_dependencies() == 0) return;
1240 
1241   // CodeCache can only be updated by a thread_in_VM and they will all be
1242   // stopped during the safepoint so CodeCache will be safe to update without
1243   // holding the CodeCache_lock.
1244 
1245   // Compute the dependent nmethods
1246   if (CodeCache::mark_for_evol_deoptimization(ev_k_h) > 0) {
1247     // At least one nmethod has been marked for deoptimization
1248 
1249     // All this already happens inside a VM_Operation, so we'll do all the work here.
1250     // Stuff copied from VM_Deoptimize and modified slightly.
1251 
1252     // We do not want any GCs to happen while we are in the middle of this VM operation
1253     ResourceMark rm;
1254     DeoptimizationMarker dm;
1255 
1256     // Deoptimize all activations depending on marked nmethods
1257     Deoptimization::deoptimize_dependents();
1258 
1259     // Make the dependent methods not entrant (in VM_Deoptimize they are made zombies)
1260     CodeCache::make_marked_nmethods_not_entrant();
1261   }
1262 }
1263 #endif // HOTSWAP
1264 
1265 
1266 // Flushes compiled methods dependent on dependee
1267 void Universe::flush_dependents_on_method(methodHandle m_h) {
1268   // --- Compile_lock is not held. However we are at a safepoint.
1269   assert_locked_or_safepoint(Compile_lock);
1270 
1271   // CodeCache can only be updated by a thread_in_VM and they will all be
1272   // stopped dring the safepoint so CodeCache will be safe to update without
1273   // holding the CodeCache_lock.
1274 
1275   // Compute the dependent nmethods
1276   if (CodeCache::mark_for_deoptimization(m_h()) > 0) {
1277     // At least one nmethod has been marked for deoptimization
1278 
1279     // All this already happens inside a VM_Operation, so we'll do all the work here.
1280     // Stuff copied from VM_Deoptimize and modified slightly.




1239   if (CodeCache::number_of_nmethods_with_dependencies() == 0) return;
1240 
1241   // CodeCache can only be updated by a thread_in_VM and they will all be
1242   // stopped during the safepoint so CodeCache will be safe to update without
1243   // holding the CodeCache_lock.
1244 
1245   // Compute the dependent nmethods
1246   if (CodeCache::mark_for_evol_deoptimization(ev_k_h) > 0) {
1247     // At least one nmethod has been marked for deoptimization
1248 
1249     // All this already happens inside a VM_Operation, so we'll do all the work here.
1250     // Stuff copied from VM_Deoptimize and modified slightly.
1251 
1252     // We do not want any GCs to happen while we are in the middle of this VM operation
1253     ResourceMark rm;
1254     DeoptimizationMarker dm;
1255 
1256     // Deoptimize all activations depending on marked nmethods
1257     Deoptimization::deoptimize_dependents();
1258 
1259     // Make the dependent methods zombies (like VM_Deoptimize)
1260     CodeCache::make_marked_nmethods_zombies();
1261   }
1262 }
1263 #endif // HOTSWAP
1264 
1265 
1266 // Flushes compiled methods dependent on dependee
1267 void Universe::flush_dependents_on_method(methodHandle m_h) {
1268   // --- Compile_lock is not held. However we are at a safepoint.
1269   assert_locked_or_safepoint(Compile_lock);
1270 
1271   // CodeCache can only be updated by a thread_in_VM and they will all be
1272   // stopped dring the safepoint so CodeCache will be safe to update without
1273   // holding the CodeCache_lock.
1274 
1275   // Compute the dependent nmethods
1276   if (CodeCache::mark_for_deoptimization(m_h()) > 0) {
1277     // At least one nmethod has been marked for deoptimization
1278 
1279     // All this already happens inside a VM_Operation, so we'll do all the work here.
1280     // Stuff copied from VM_Deoptimize and modified slightly.