Bug 1563510 part 4 - Change JSFunction::hasJITCode to JSFunction::hasJitScript. r=iain
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 09 Jul 2019 07:22:16 +0000
changeset 481835 6a3e9d8abe2c7012ea6fd3255a2f7ae9094e6037
parent 481834 77bc29e90670098deb2fc7ce9f050a23f26e5f6e
child 481836 b7c4e84d22c21669ff839e7456f3f75a15570eeb
push id36265
push userrgurzau@mozilla.com
push dateTue, 09 Jul 2019 15:37:42 +0000
treeherdermozilla-central@404680ad41e4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersiain
bugs1563510
milestone70.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 1563510 part 4 - Change JSFunction::hasJITCode to JSFunction::hasJitScript. r=iain This prevents slowdowns when we increase the Baseline JIT threshold and is more predictable when we move BaselineCompiler off-thread. Differential Revision: https://phabricator.services.mozilla.com/D36906
js/src/jit/CacheIR.cpp
js/src/vm/JSFunction.h
--- a/js/src/jit/CacheIR.cpp
+++ b/js/src/jit/CacheIR.cpp
@@ -5050,21 +5050,20 @@ AttachDecision CallIRGenerator::tryAttac
   }
 
   if (!calleeFunc->hasJitEntry()) {
     // Don't treat this as an unoptimizable case, as we'll add a
     // stub when the callee is delazified.
     return AttachDecision::TemporarilyUnoptimizable;
   }
 
-  if (isConstructing && !calleeFunc->hasJITCode()) {
-    // If we're constructing, require the callee to have JIT
-    // code. This isn't required for correctness but avoids allocating
-    // a template object below for constructors that aren't hot. See
-    // bug 1419758.
+  if (isConstructing && !calleeFunc->hasJitScript()) {
+    // If we're constructing, require the callee to have a JitScript. This isn't
+    // required for correctness but avoids allocating a template object below
+    // for constructors that aren't hot. See bug 1419758.
     return AttachDecision::TemporarilyUnoptimizable;
   }
 
   // Keep track of the function's |prototype| property in type
   // information, for use during Ion compilation.
   if (IsIonEnabled(cx_)) {
     EnsureTrackPropertyTypes(cx_, calleeFunc, NameToId(cx_->names().prototype));
   }
--- a/js/src/vm/JSFunction.h
+++ b/js/src/vm/JSFunction.h
@@ -323,23 +323,22 @@ class JSFunction : public js::NativeObje
   bool hasResolvedName() const { return flags() & RESOLVED_NAME; }
 
   bool isSelfHostedOrIntrinsic() const { return flags() & SELF_HOSTED; }
   bool isSelfHostedBuiltin() const {
     return isSelfHostedOrIntrinsic() && !isNative();
   }
   bool isIntrinsic() const { return isSelfHostedOrIntrinsic() && isNative(); }
 
-  bool hasJITCode() const {
+  bool hasJitScript() const {
     if (!hasScript()) {
       return false;
     }
 
-    return nonLazyScript()->hasBaselineScript() ||
-           nonLazyScript()->hasIonScript();
+    return nonLazyScript()->hasJitScript();
   }
   bool hasJitEntry() const { return hasScript() || isNativeWithJitEntry(); }
 
   /* Compound attributes: */
   bool isBuiltin() const { return isBuiltinNative() || isSelfHostedBuiltin(); }
 
   bool isNamedLambda() const {
     return isLambda() && displayAtom() && !hasInferredName() &&