8221183: Avoid code cache walk in MetadataOnStackMark

Note nmethods with "old" Methods in them in table to walk instead.

Reviewed-by: eosterlund, sspitsyn
This commit is contained in:
Coleen Phillimore 2019-04-01 09:53:30 -04:00
parent 6dad89ceae
commit 246544eeb7
10 changed files with 118 additions and 89 deletions

View file

@ -1106,6 +1106,7 @@ void nmethod::make_unloaded() {
MutexLockerEx ml(SafepointSynchronize::is_at_safepoint() ? NULL : CodeCache_lock,
Mutex::_no_safepoint_check_flag);
Universe::heap()->unregister_nmethod(this);
CodeCache::unregister_old_nmethod(this);
}
// Clear the method of this dead nmethod
@ -1291,6 +1292,7 @@ bool nmethod::make_not_entrant_or_zombie(int state) {
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
if (nmethod_needs_unregister) {
Universe::heap()->unregister_nmethod(this);
CodeCache::unregister_old_nmethod(this);
}
flush_dependencies(/*delete_immediately*/true);
}
@ -1988,32 +1990,6 @@ bool nmethod::check_dependency_on(DepChange& changes) {
return found_check;
}
bool nmethod::is_evol_dependent() {
for (Dependencies::DepStream deps(this); deps.next(); ) {
if (deps.type() == Dependencies::evol_method) {
Method* method = deps.method_argument(0);
if (method->is_old()) {
if (log_is_enabled(Debug, redefine, class, nmethod)) {
ResourceMark rm;
log_debug(redefine, class, nmethod)
("Found evol dependency of nmethod %s.%s(%s) compile_id=%d on method %s.%s(%s)",
_method->method_holder()->external_name(),
_method->name()->as_C_string(),
_method->signature()->as_C_string(),
compile_id(),
method->method_holder()->external_name(),
method->name()->as_C_string(),
method->signature()->as_C_string());
}
if (TraceDependencies || LogCompilation)
deps.log_dependency(method->method_holder());
return true;
}
}
}
return false;
}
// Called from mark_for_deoptimization, when dependee is invalidated.
bool nmethod::is_dependent_on_method(Method* dependee) {
for (Dependencies::DepStream deps(this); deps.next(); ) {