hotspot/src/share/vm/runtime/arguments.cpp
changeset 28834 4925a7f447b0
parent 28832 4c2704386850
parent 28726 e69d7f50ef94
child 28838 da47c3cc5c98
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Mon Feb 02 10:38:39 2015 +0100
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Mon Feb 02 13:57:38 2015 +0100
@@ -1127,7 +1127,7 @@
 #endif
 
 intx Arguments::scaled_compile_threshold(intx threshold, double scale) {
-  if (scale == 1.0 || scale < 0.0) {
+  if (scale == 1.0 || scale <= 0.0) {
     return threshold;
   } else {
     return (intx)(threshold * scale);
@@ -1143,7 +1143,7 @@
 
   // Check value to avoid calculating log2 of 0.
   if (scale == 0.0) {
-    return 1;
+    return freq_log;
   }
 
   intx scaled_freq = scaled_compile_threshold((intx)1 << freq_log, scale);
@@ -3480,8 +3480,10 @@
     set_mode_flags(_int);
   }
 
-  if ((TieredCompilation && CompileThresholdScaling == 0)
-      || (!TieredCompilation && scaled_compile_threshold(CompileThreshold) == 0)) {
+  // CompileThresholdScaling == 0.0 is same as -Xint: Disable compilation (enable interpreter-only mode),
+  // but like -Xint, leave compilation thresholds unaffected.
+  // With tiered compilation disabled, setting CompileThreshold to 0 disables compilation as well.
+  if ((CompileThresholdScaling == 0.0) || (!TieredCompilation && CompileThreshold == 0)) {
     set_mode_flags(_int);
   }