< prev index next >

src/hotspot/share/interpreter/invocationCounter.cpp

Print this page

        

@@ -151,13 +151,13 @@
   // When methodData is collected, the backward branch limit is compared against a
   // methodData counter, rather than an InvocationCounter.  In the former case, we
   // don't need the shift by number_of_noncount_bits, but we do need to adjust
   // the factor by which we scale the threshold.
   if (ProfileInterpreter) {
-    InterpreterBackwardBranchLimit = (CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100;
+    InterpreterBackwardBranchLimit = ((int64_t)CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100;
   } else {
-    InterpreterBackwardBranchLimit = ((CompileThreshold * OnStackReplacePercentage) / 100) << number_of_noncount_bits;
+    InterpreterBackwardBranchLimit = (((int64_t)CompileThreshold * OnStackReplacePercentage) / 100) << number_of_noncount_bits;
   }
 
   assert(0 <= InterpreterBackwardBranchLimit,
          "OSR threshold should be non-negative");
   assert(0 <= InterpreterProfileLimit &&
< prev index next >