Bug 1511210 part 1 - Check script warm up count before calling ensureJitRealmExists in CanEnterBaselineJIT. r=tcampbell
authorJan de Mooij <jdemooij@mozilla.com>
Sun, 02 Dec 2018 22:05:08 +0000
changeset 508396 aa8de096f6dcdadc8186637f6a742dc350d11781
parent 508395 95e75223f6c7dc1bdd13488deb46a18541c00c93
child 508397 30e5ba51f64aa65ed086da3ccc7b4b139d139e79
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1511210
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1511210 part 1 - Check script warm up count before calling ensureJitRealmExists in CanEnterBaselineJIT. r=tcampbell This is just a minor optimization, but it makes the bug fixed by part 2 reproducible when running jit-tests. Differential Revision: https://phabricator.services.mozilla.com/D13650
js/src/jit/BaselineJIT.cpp
--- a/js/src/jit/BaselineJIT.cpp
+++ b/js/src/jit/BaselineJIT.cpp
@@ -259,31 +259,31 @@ static MethodStatus CanEnterBaselineJIT(
   if (script->nslots() > BaselineMaxScriptSlots) {
     return Method_CantCompile;
   }
 
   if (script->hasBaselineScript()) {
     return Method_Compiled;
   }
 
+  // Check script warm-up counter.
+  if (script->incWarmUpCounter() <= JitOptions.baselineWarmUpThreshold) {
+    return Method_Skipped;
+  }
+
   // Check this before calling ensureJitRealmExists, so we're less
   // likely to report OOM in JSRuntime::createJitRuntime.
   if (!CanLikelyAllocateMoreExecutableMemory()) {
     return Method_Skipped;
   }
 
   if (!cx->realm()->ensureJitRealmExists(cx)) {
     return Method_Error;
   }
 
-  // Check script warm-up counter.
-  if (script->incWarmUpCounter() <= JitOptions.baselineWarmUpThreshold) {
-    return Method_Skipped;
-  }
-
   // Frames can be marked as debuggee frames independently of its underlying
   // script being a debuggee script, e.g., when performing
   // Debugger.Frame.prototype.eval.
   return BaselineCompile(cx, script, osrFrame && osrFrame->isDebuggee());
 }
 
 MethodStatus jit::CanEnterBaselineAtBranch(JSContext* cx,
                                            InterpreterFrame* fp) {