6935466: new CodeCache flushing code is not guarded by the flag
authorkvn
Tue, 16 Mar 2010 15:35:33 -0700
changeset 5051 796beb45e4f5
parent 5050 47ecd86932ce
child 5052 c6c9ff8ad36a
6935466: new CodeCache flushing code is not guarded by the flag Summary: Add missing guard. Reviewed-by: never
hotspot/src/share/vm/compiler/compileBroker.cpp
--- 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 {