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
☠☠ backed out by a330a9835751 ☠ ☠
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Sun, 07 Apr 2019 16:40:12 +0300
changeset 525998 0e0e954b3cdc98870700da9e8d76b2f5b142fdb0
parent 525997 9d3bcd768496b23e1423f41a15e78e6d35ff1ff6
child 525999 e099b8601dc77a26fbaaf6cfef7254cb4a9d5247
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 Summary: 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. Reviewers: nbp Reviewed By: nbp Bug #: 1382650 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();