6935466: new CodeCache flushing code is not guarded by the flag
Summary: Add missing guard.
Reviewed-by: never
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp Tue Mar 16 11:52:17 2010 +0100
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp Tue Mar 16 15:35:33 2010 -0700
@@ -988,10 +988,12 @@
}
if (method->is_not_compilable(comp_level)) return NULL;
- nmethod* saved = CodeCache::find_and_remove_saved_code(method());
- if (saved != NULL) {
- method->set_code(method, saved);
- return saved;
+ if (UseCodeCacheFlushing) {
+ nmethod* saved = CodeCache::find_and_remove_saved_code(method());
+ if (saved != NULL) {
+ method->set_code(method, saved);
+ return saved;
+ }
}
} else {