Bug 1382650 part 5 - Calculate OSR warm-up threshold difference based on the warm-up threshold instead of hard-coding 100. r=nbp a=pascalc
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 27 Mar 2019 18:58:13 +0000
changeset 526041 adcc63bfb4dc36fc8b2ff3571430ef18a78f7ff2
parent 526040 d4a898d579ec1f10696774f3678ad97db02b0ae4
child 526042 e896facf3e28c0389d3941d1947181afba0fd49d
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp, pascalc
bugs1382650
milestone67.0
Bug 1382650 part 5 - Calculate OSR warm-up threshold difference based on the warm-up threshold instead of hard-coding 100. r=nbp a=pascalc We want this to be more than 100 for the full-optimizations tier. Making this relative also works better for tests that set a small Ion warm-up threshold. Also disables OSR in some tests depending on the old behavior. Differential Revision: https://phabricator.services.mozilla.com/D24157
js/src/jit-test/tests/debug/Frame-eval-20.js
js/src/jit-test/tests/ion/recover-lambdas.js
js/src/jit/IonOptimizationLevels.cpp
--- a/js/src/jit-test/tests/debug/Frame-eval-20.js
+++ b/js/src/jit-test/tests/debug/Frame-eval-20.js
@@ -1,8 +1,10 @@
+// |jit-test| --ion-osr=off
+
 // Eval-in-frame with different type on non-youngest Ion frame.
 
 load(libdir + "jitopts.js");
 
 if (!jitTogglesMatch(Opts_Ion2NoOffthreadCompilation))
   quit(0);
 
 withJitOptions(Opts_Ion2NoOffthreadCompilation, function () {
--- a/js/src/jit-test/tests/ion/recover-lambdas.js
+++ b/js/src/jit-test/tests/ion/recover-lambdas.js
@@ -1,8 +1,9 @@
+// |jit-test| --ion-osr=off
 
 var max = 40;
 setJitCompilerOption("ion.warmup.trigger", max - 10);
 
 // This function is used to escape "g" which is a non-escaped inner function.
 // As it is not escaped within "f", the lambda for "g" would be computed on the
 // bailout path. Resolving the first ".caller" implies that we have to recover
 // the lambda. Resolving the second ".caller" is needed such as we can build the
--- a/js/src/jit/IonOptimizationLevels.cpp
+++ b/js/src/jit/IonOptimizationLevels.cpp
@@ -95,17 +95,17 @@ uint32_t OptimizationInfo::compilerWarmU
     return warmUpThreshold;
   }
 
   // It's more efficient to enter outer loops, rather than inner loops, via OSR.
   // To accomplish this, we use a slightly higher threshold for inner loops.
   // Note that the loop depth is always > 0 so we will prefer non-OSR over OSR.
   uint32_t loopDepth = LoopEntryDepthHint(pc);
   MOZ_ASSERT(loopDepth > 0);
-  return warmUpThreshold + loopDepth * 100;
+  return warmUpThreshold + loopDepth * (baseCompilerWarmUpThreshold() / 10);
 }
 
 OptimizationLevelInfo::OptimizationLevelInfo() {
   infos_[OptimizationLevel::Normal].initNormalOptimizationInfo();
   infos_[OptimizationLevel::Wasm].initWasmOptimizationInfo();
 
 #ifdef DEBUG
   OptimizationLevel level = firstLevel();