8134493: Cleaning inline caches of unloaded nmethods should be done in sweeper

Clean ICs of unloaded nmethods in sweeper to avoid impact on safepoint duration.

Reviewed-by: kvn, mdoerr
This commit is contained in:
Tobias Hartmann 2015-08-31 13:49:18 +02:00
parent 9dcbe322e0
commit 7b6480cfa4
6 changed files with 20 additions and 14 deletions

View file

@ -745,13 +745,12 @@ void CodeCache::gc_prologue() {
void CodeCache::gc_epilogue() {
assert_locked_or_safepoint(CodeCache_lock);
NMethodIterator iter;
while(iter.next()) {
nmethod* nm = iter.method();
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.
NOT_DEBUG(if (needs_cache_clean())) {
NMethodIterator iter;
while(iter.next_alive()) {
nmethod* nm = iter.method();
assert(!nm->is_unloaded(), "Tautology");
DEBUG_ONLY(if (needs_cache_clean())) {
nm->cleanup_inline_caches();
}
DEBUG_ONLY(nm->verify());