< prev index next >
src/share/vm/code/codeCache.cpp
Print this page
@@ -744,19 +744,22 @@
}
void CodeCache::gc_epilogue() {
assert_locked_or_safepoint(CodeCache_lock);
NMethodIterator iter;
- while(iter.next_alive()) {
+ while(iter.next()) {
nmethod* nm = iter.method();
- assert(!nm->is_unloaded(), "Tautology");
+ if (!nm->is_zombie()) {
if (needs_cache_clean()) {
+ // Clean ICs of unloaded nmethods as well because they may reference other
+ // unloaded nmethods that may be flushed earlier in the sweeper cycle.
nm->cleanup_inline_caches();
}
DEBUG_ONLY(nm->verify());
DEBUG_ONLY(nm->verify_oop_relocations());
}
+ }
set_needs_cache_clean(false);
prune_scavenge_root_nmethods();
verify_icholder_relocations();
}
@@ -991,33 +994,10 @@
}
return number_of_marked_CodeBlobs;
}
-void CodeCache::make_marked_nmethods_zombies() {
- assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint");
- NMethodIterator iter;
- while(iter.next_alive()) {
- nmethod* nm = iter.method();
- if (nm->is_marked_for_deoptimization()) {
-
- // If the nmethod has already been made non-entrant and it can be converted
- // then zombie it now. Otherwise make it non-entrant and it will eventually
- // be zombied when it is no longer seen on the stack. Note that the nmethod
- // might be "entrant" and not on the stack and so could be zombied immediately
- // but we can't tell because we don't track it on stack until it becomes
- // non-entrant.
-
- if (nm->is_not_entrant() && nm->can_not_entrant_be_converted()) {
- nm->make_zombie();
- } else {
- nm->make_not_entrant();
- }
- }
- }
-}
-
void CodeCache::make_marked_nmethods_not_entrant() {
assert_locked_or_safepoint(CodeCache_lock);
NMethodIterator iter;
while(iter.next_alive()) {
nmethod* nm = iter.method();
@@ -1070,11 +1050,11 @@
DeoptimizationMarker dm;
// Deoptimize all activations depending on marked nmethods
Deoptimization::deoptimize_dependents();
- // Make the dependent methods not entrant (in VM_Deoptimize they are made zombies)
+ // Make the dependent methods not entrant
make_marked_nmethods_not_entrant();
}
}
#endif // HOTSWAP
@@ -1100,11 +1080,11 @@
DeoptimizationMarker dm;
// Deoptimize all activations depending on marked nmethods
Deoptimization::deoptimize_dependents();
- // Make the dependent methods not entrant (in VM_Deoptimize they are made zombies)
+ // Make the dependent methods not entrant
make_marked_nmethods_not_entrant();
}
}
void CodeCache::verify() {
< prev index next >