Bug 1589904 - Remove JSScript::functionNonDelazifying() r=jandem
authorTed Campbell <tcampbell@mozilla.com>
Fri, 25 Oct 2019 13:02:37 +0000
changeset 499019 b6eb1335852342d645e1da3ecec8dee8b707e9a9
parent 499018 327dacef5a0798007456cf20a9277384f57792ca
child 499020 b415d53def5ddcdede93d26433d1c6c8f98ce489
push id36734
push userncsoregi@mozilla.com
push dateSat, 26 Oct 2019 09:45:46 +0000
treeherdermozilla-central@0b9d0a86ebfd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1589904
milestone72.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 1589904 - Remove JSScript::functionNonDelazifying() r=jandem Replace these calls with JSScript::function(). An active script will always have a non-lazy canonical function. Differential Revision: https://phabricator.services.mozilla.com/D49838
js/src/debugger/Script.cpp
js/src/jit/Bailouts.cpp
js/src/jit/BaselineCodeGen.cpp
js/src/jit/BaselineCodeGen.h
js/src/jit/BaselineFrame.h
js/src/jit/BaselineFrameInfo.h
js/src/jit/BaselineIC.cpp
js/src/jit/CodeGenerator.cpp
js/src/jit/CompileInfo.h
js/src/jit/Ion.cpp
js/src/jit/Ion.h
js/src/jit/IonAnalysis.cpp
js/src/jit/IonBuilder.cpp
js/src/jit/Jit.cpp
js/src/jit/JitFrames.cpp
js/src/jit/JitScript-inl.h
js/src/jit/JitScript.cpp
js/src/jit/MCallOptimize.cpp
js/src/jit/RematerializedFrame.h
js/src/jsapi.cpp
js/src/vm/ArgumentsObject.cpp
js/src/vm/BytecodeUtil.cpp
js/src/vm/CodeCoverage.cpp
js/src/vm/EnvironmentObject.cpp
js/src/vm/GeckoProfiler.cpp
js/src/vm/Interpreter.cpp
js/src/vm/JSFunction.h
js/src/vm/JSScript.cpp
js/src/vm/JSScript.h
js/src/vm/ObjectGroup.cpp
js/src/vm/Stack.cpp
js/src/vm/Stack.h
js/src/vm/TypeInference.cpp
--- a/js/src/debugger/Script.cpp
+++ b/js/src/debugger/Script.cpp
@@ -316,34 +316,34 @@ bool DebuggerScript::CallData::getIsAsyn
 
 bool DebuggerScript::CallData::getIsFunction() {
   if (!ensureScriptMaybeLazy()) {
     return false;
   }
 
   // Note: LazyScripts always have functions.
   args.rval().setBoolean(!referent.is<JSScript*>() ||
-                         referent.as<JSScript*>()->functionNonDelazifying());
+                         referent.as<JSScript*>()->function());
   return true;
 }
 
 bool DebuggerScript::CallData::getIsModule() {
   if (!ensureScriptMaybeLazy()) {
     return false;
   }
   args.rval().setBoolean(referent.is<JSScript*>() &&
                          referent.as<JSScript*>()->isModule());
   return true;
 }
 
 bool DebuggerScript::CallData::getDisplayName() {
   if (!ensureScriptMaybeLazy()) {
     return false;
   }
-  JSFunction* func = CallScriptMethod(obj, &JSScript::functionNonDelazifying,
+  JSFunction* func = CallScriptMethod(obj, &JSScript::function,
                                       &LazyScript::functionNonDelazifying);
   Debugger* dbg = Debugger::fromChildJSObject(obj);
 
   JSString* name = func ? func->displayAtom() : nullptr;
   if (!name) {
     args.rval().setUndefined();
     return true;
   }
--- a/js/src/jit/Bailouts.cpp
+++ b/js/src/jit/Bailouts.cpp
@@ -55,17 +55,17 @@ bool jit::Bailout(BailoutStack* sp, Base
   bool success = BailoutIonToBaseline(cx, bailoutData.activation(), frame,
                                       false, bailoutInfo,
                                       /* excInfo = */ nullptr);
   MOZ_ASSERT_IF(success, *bailoutInfo != nullptr);
 
   if (!success) {
     MOZ_ASSERT(cx->isExceptionPending());
     JSScript* script = frame.script();
-    probes::ExitScript(cx, script, script->functionNonDelazifying(),
+    probes::ExitScript(cx, script, script->function(),
                        /* popProfilerFrame = */ false);
   }
 
   // This condition was wrong when we entered this bailout function, but it
   // might be true now. A GC might have reclaimed all the Jit code and
   // invalidated all frames which are currently on the stack. As we are
   // already in a bailout, we could not switch to an invalidation
   // bailout. When the code of an IonScript which is on the stack is
@@ -144,17 +144,17 @@ bool jit::InvalidationBailout(Invalidati
     //
     // We call ExitScript here to ensure that if the ionScript had Gecko
     // Profiler instrumentation, then the entry for it is popped.
     //
     // However, if the bailout was during argument check, then a
     // pseudostack frame would not have been pushed in the first
     // place, so don't pop anything in that case.
     JSScript* script = frame.script();
-    probes::ExitScript(cx, script, script->functionNonDelazifying(),
+    probes::ExitScript(cx, script, script->function(),
                        /* popProfilerFrame = */ false);
 
 #ifdef JS_JITSPEW
     JitFrameLayout* layout = frame.jsFrame();
     JitSpew(JitSpew_IonInvalidate, "Bailout failed (Fatal Error)");
     JitSpew(JitSpew_IonInvalidate, "   calleeToken %p",
             (void*)layout->calleeToken());
     JitSpew(JitSpew_IonInvalidate, "   frameSize %u",
--- a/js/src/jit/BaselineCodeGen.cpp
+++ b/js/src/jit/BaselineCodeGen.cpp
@@ -5610,18 +5610,17 @@ bool BaselineCodeGen<Handler>::emit_JSOP
   frame.storeStackValue(-1, frame.addressOfReturnValue(), R2);
   masm.or32(Imm32(BaselineFrame::HAS_RVAL), frame.addressOfFlags());
   frame.pop();
   return true;
 }
 
 template <typename Handler>
 bool BaselineCodeGen<Handler>::emit_JSOP_CALLEE() {
-  MOZ_ASSERT_IF(handler.maybeScript(),
-                handler.maybeScript()->functionNonDelazifying());
+  MOZ_ASSERT_IF(handler.maybeScript(), handler.maybeScript()->function());
   frame.syncStack(0);
   masm.loadFunctionFromCalleeToken(frame.addressOfCalleeToken(),
                                    R0.scratchReg());
   masm.tagValue(JSVAL_TYPE_OBJECT, R0.scratchReg(), R0);
   frame.push(R0);
   return true;
 }
 
--- a/js/src/jit/BaselineCodeGen.h
+++ b/js/src/jit/BaselineCodeGen.h
@@ -575,21 +575,17 @@ class BaselineCompilerHandler {
     // argument so the DebugEpilogue call needs to be part of the returning
     // bytecode op for this to work.
     return true;
   }
 
   JSScript* script() const { return script_; }
   JSScript* maybeScript() const { return script_; }
 
-  JSFunction* function() const {
-    // Not delazifying here is ok as the function is guaranteed to have
-    // been delazified before compilation started.
-    return script_->functionNonDelazifying();
-  }
+  JSFunction* function() const { return script_->function(); }
   JSFunction* maybeFunction() const { return function(); }
 
   ModuleObject* module() const { return script_->module(); }
 
   void setCompileDebugInstrumentation() { compileDebugInstrumentation_ = true; }
   bool compileDebugInstrumentation() const {
     return compileDebugInstrumentation_;
   }
--- a/js/src/jit/BaselineFrame.h
+++ b/js/src/jit/BaselineFrame.h
@@ -169,19 +169,17 @@ class BaselineFrame {
     MOZ_ASSERT(i < script()->nfixed());
     return *valueSlot(i);
   }
 
   unsigned numActualArgs() const {
     return *(size_t*)(reinterpret_cast<const uint8_t*>(this) +
                       BaselineFrame::Size() + offsetOfNumActualArgs());
   }
-  unsigned numFormalArgs() const {
-    return script()->functionNonDelazifying()->nargs();
-  }
+  unsigned numFormalArgs() const { return script()->function()->nargs(); }
   Value& thisArgument() const {
     MOZ_ASSERT(isFunctionFrame());
     return *(Value*)(reinterpret_cast<const uint8_t*>(this) +
                      BaselineFrame::Size() + offsetOfThis());
   }
   Value* argv() const {
     return (Value*)(reinterpret_cast<const uint8_t*>(this) +
                     BaselineFrame::Size() + offsetOfArg(0));
--- a/js/src/jit/BaselineFrameInfo.h
+++ b/js/src/jit/BaselineFrameInfo.h
@@ -232,17 +232,17 @@ class CompilerFrameInfo : public FrameIn
   size_t spIndex;
 
  public:
   CompilerFrameInfo(JSScript* script, MacroAssembler& masm)
       : FrameInfo(masm), script(script), stack(), spIndex(0) {}
   MOZ_MUST_USE bool init(TempAllocator& alloc);
 
   size_t nlocals() const { return script->nfixed(); }
-  size_t nargs() const { return script->functionNonDelazifying()->nargs(); }
+  size_t nargs() const { return script->function()->nargs(); }
 
  private:
   inline StackValue* rawPush() {
     StackValue* val = &stack[spIndex++];
     val->reset();
     return val;
   }
 
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -212,17 +212,17 @@ bool JitScript::initICEntriesAndBytecode
   // Lambda expression for adding ICs for non-op ICs
   auto addPrologueIC = [cx, this, &icEntryIndex](ICStub* stub) {
     return AddICImpl(cx, this, ICEntry::ProloguePCOffset, stub, icEntryIndex);
   };
 
   // Add ICEntries and fallback stubs for this/argument type checks.
   // Note: we pass a nullptr pc to indicate this is a non-op IC.
   // See ICEntry::NonOpPCOffset.
-  if (JSFunction* fun = script->functionNonDelazifying()) {
+  if (JSFunction* fun = script->function()) {
     ICStub* stub =
         alloc.newStub<ICTypeMonitor_Fallback>(Kind::TypeMonitor, nullptr, 0);
     if (!addPrologueIC(stub)) {
       return false;
     }
 
     for (size_t i = 0; i < fun->nargs(); i++) {
       ICStub* stub = alloc.newStub<ICTypeMonitor_Fallback>(Kind::TypeMonitor,
@@ -888,17 +888,17 @@ static void TypeMonitorMagicValue(JSCont
   if (value.whyMagic() == JS_OPTIMIZED_OUT) {
     MOZ_ASSERT(!stub->monitorsThis());
     return;
   }
 
   // In derived class constructors (including nested arrows/eval), the
   // |this| argument or GETALIASEDVAR can return the magic TDZ value.
   MOZ_ASSERT(value.whyMagic() == JS_UNINITIALIZED_LEXICAL);
-  MOZ_ASSERT(script->functionNonDelazifying() || script->isForEval());
+  MOZ_ASSERT(script->function() || script->isForEval());
   MOZ_ASSERT(stub->monitorsThis() || *GetNextPc(pc) == JSOP_CHECKTHIS ||
              *GetNextPc(pc) == JSOP_CHECKTHISREINIT ||
              *GetNextPc(pc) == JSOP_CHECKRETURN);
   if (stub->monitorsThis()) {
     JitScript::MonitorThisType(cx, script, TypeSet::UnknownType());
   } else {
     JitScript::MonitorBytecodeType(cx, script, pc, TypeSet::UnknownType());
   }
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -3718,17 +3718,17 @@ void CodeGenerator::visitCallee(LCallee*
 
 void CodeGenerator::visitIsConstructing(LIsConstructing* lir) {
   Register output = ToRegister(lir->output());
   Address calleeToken(masm.getStackPointer(),
                       frameSize() + JitFrameLayout::offsetOfCalleeToken());
   masm.loadPtr(calleeToken, output);
 
   // We must be inside a function.
-  MOZ_ASSERT(current->mir()->info().script()->functionNonDelazifying());
+  MOZ_ASSERT(current->mir()->info().script()->function());
 
   // The low bit indicates whether this call is constructing, just clear the
   // other bits.
   static_assert(CalleeToken_Function == 0x0,
                 "CalleeTokenTag value should match");
   static_assert(CalleeToken_FunctionConstructing == 0x1,
                 "CalleeTokenTag value should match");
   masm.andPtr(Imm32(0x1), output);
--- a/js/src/jit/CompileInfo.h
+++ b/js/src/jit/CompileInfo.h
@@ -187,17 +187,17 @@ class CompileInfo {
         inlineScriptTree_(inlineScriptTree) {
     MOZ_ASSERT_IF(osrPc, JSOp(*osrPc) == JSOP_LOOPENTRY);
 
     // The function here can flow in from anywhere so look up the canonical
     // function to ensure that we do not try to embed a nursery pointer in
     // jit-code. Precisely because it can flow in from anywhere, it's not
     // guaranteed to be non-lazy. Hence, don't access its script!
     if (fun_) {
-      fun_ = fun_->nonLazyScript()->functionNonDelazifying();
+      fun_ = fun_->nonLazyScript()->function();
       MOZ_ASSERT(fun_->isTenured());
     }
 
     nimplicit_ = StartArgSlot(script) /* env chain and argument obj */
                  + (fun ? 1 : 0);     /* this */
     nargs_ = fun ? fun->nargs() : 0;
     nlocals_ = script->nfixed();
 
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -1774,19 +1774,18 @@ static AbortReason IonCompile(JSContext*
 
   InlineScriptTree* inlineScriptTree =
       InlineScriptTree::New(temp, nullptr, nullptr, script);
   if (!inlineScriptTree) {
     return AbortReason::Alloc;
   }
 
   CompileInfo* info = alloc->new_<CompileInfo>(
-      CompileRuntime::get(cx->runtime()), script,
-      script->functionNonDelazifying(), osrPc, Analysis_None,
-      script->needsArgsObj(), inlineScriptTree);
+      CompileRuntime::get(cx->runtime()), script, script->function(), osrPc,
+      Analysis_None, script->needsArgsObj(), inlineScriptTree);
   if (!info) {
     return AbortReason::Alloc;
   }
 
   BaselineInspector* inspector = alloc->new_<BaselineInspector>(script);
   if (!inspector) {
     return AbortReason::Alloc;
   }
@@ -1972,17 +1971,17 @@ static bool CanIonCompileOrInlineScript(
     *reason = "generator script";
     return false;
   }
   if (script->isAsync()) {
     *reason = "async script";
     return false;
   }
 
-  if (script->hasNonSyntacticScope() && !script->functionNonDelazifying()) {
+  if (script->hasNonSyntacticScope() && !script->function()) {
     // Support functions with a non-syntactic global scope but not other
     // scripts. For global scripts, IonBuilder currently uses the global
     // object as scope chain, this is not valid when the script has a
     // non-syntactic global scope.
     *reason = "has non-syntactic global scope";
     return false;
   }
 
--- a/js/src/jit/Ion.h
+++ b/js/src/jit/Ion.h
@@ -230,17 +230,17 @@ inline bool TooManyActualArguments(unsig
 }
 
 inline bool TooManyFormalArguments(unsigned nargs) {
   return nargs >= SNAPSHOT_MAX_NARGS || TooManyActualArguments(nargs);
 }
 
 inline size_t NumLocalsAndArgs(JSScript* script) {
   size_t num = 1 /* this */ + script->nfixed();
-  if (JSFunction* fun = script->functionNonDelazifying()) {
+  if (JSFunction* fun = script->function()) {
     num += fun->nargs();
   }
   return num;
 }
 
 // Debugging RAII class which marks the current thread as performing an Ion
 // backend compilation.
 class MOZ_RAII AutoEnterIonBackend {
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -4826,17 +4826,17 @@ bool jit::AnalyzeArgumentsUsage(JSContex
   InlineScriptTree* inlineScriptTree =
       InlineScriptTree::New(&temp, nullptr, nullptr, script);
   if (!inlineScriptTree) {
     ReportOutOfMemory(cx);
     return false;
   }
 
   CompileInfo info(CompileRuntime::get(cx->runtime()), script,
-                   script->functionNonDelazifying(),
+                   script->function(),
                    /* osrPc = */ nullptr, Analysis_ArgumentsUsage,
                    /* needsArgsObj = */ true, inlineScriptTree);
 
   const OptimizationInfo* optimizationInfo =
       IonOptimizations.get(OptimizationLevel::Normal);
 
   CompilerConstraintList* constraints = NewCompilerConstraintList(temp);
   if (!constraints) {
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -91,17 +91,17 @@ BaselineFrameInspector* jit::NewBaseline
   }
 
   if (frame->environmentChain()->isSingleton()) {
     inspector->singletonEnvChain = frame->environmentChain();
   }
 
   JSScript* script = frame->script();
 
-  if (script->functionNonDelazifying()) {
+  if (script->function()) {
     if (!inspector->argTypes.reserve(frame->numFormalArgs())) {
       return nullptr;
     }
     for (size_t i = 0; i < frame->numFormalArgs(); i++) {
       if (script->formalIsAliased(i)) {
         inspector->argTypes.infallibleAppend(TypeSet::UndefinedType());
       } else if (!script->argsObjAliasesFormals()) {
         TypeSet::Type type =
--- a/js/src/jit/Jit.cpp
+++ b/js/src/jit/Jit.cpp
@@ -65,17 +65,17 @@ static EnterJitStatus JS_HAZ_JSNATIVE_CA
     }
 
     constructing = state.asInvoke()->constructing();
     maxArgc = args.length() + 1;
     maxArgv = args.array() - 1;  // -1 to include |this|
     envChain = nullptr;
     calleeToken = CalleeToToken(&args.callee().as<JSFunction>(), constructing);
 
-    unsigned numFormals = script->functionNonDelazifying()->nargs();
+    unsigned numFormals = script->function()->nargs();
     if (numFormals > numActualArgs) {
       code = cx->runtime()->jitRuntime()->getArgumentsRectifier().value;
     }
   } else {
     numActualArgs = 0;
     constructing = false;
     if (script->isDirectEvalInFunction()) {
       if (state.asExecute()->newTarget().isNull()) {
--- a/js/src/jit/JitFrames.cpp
+++ b/js/src/jit/JitFrames.cpp
@@ -659,17 +659,17 @@ void HandleException(ResumeFromException
 
         MOZ_ASSERT(rfe->kind == ResumeFromException::RESUME_ENTRY_FRAME);
 
         // When profiling, each frame popped needs a notification that
         // the function has exited, so invoke the probe that a function
         // is exiting.
 
         JSScript* script = frames.script();
-        probes::ExitScript(cx, script, script->functionNonDelazifying(),
+        probes::ExitScript(cx, script, script->function(),
                            /* popProfilerFrame = */ false);
         if (!frames.more()) {
           TraceLogStopEvent(logger, TraceLogger_IonMonkey);
           TraceLogStopEvent(logger, TraceLogger_Scripts);
           break;
         }
         ++frames;
       }
@@ -692,17 +692,17 @@ void HandleException(ResumeFromException
         return;
       }
 
       TraceLogStopEvent(logger, TraceLogger_Baseline);
       TraceLogStopEvent(logger, TraceLogger_Scripts);
 
       // Unwind profiler pseudo-stack
       JSScript* script = frame.script();
-      probes::ExitScript(cx, script, script->functionNonDelazifying(),
+      probes::ExitScript(cx, script, script->function(),
                          /* popProfilerFrame = */ false);
 
       if (rfe->kind == ResumeFromException::RESUME_FORCED_RETURN) {
         return;
       }
     }
 
     prevJitFrame = frame.current();
--- a/js/src/jit/JitScript-inl.h
+++ b/js/src/jit/JitScript-inl.h
@@ -28,17 +28,17 @@ inline StackTypeSet* JitScript::thisType
 /*
  * Note: for non-escaping arguments, argTypes reflect only the initial type of
  * the variable (e.g. passed values for argTypes, or undefined for localTypes)
  * and not types from subsequent assignments.
  */
 
 inline StackTypeSet* JitScript::argTypes(const AutoSweepJitScript& sweep,
                                          JSScript* script, unsigned i) {
-  MOZ_ASSERT(i < script->functionNonDelazifying()->nargs());
+  MOZ_ASSERT(i < script->function()->nargs());
   return typeArray(sweep) + script->numBytecodeTypeSets() + 1 /* this */ + i;
 }
 
 template <typename TYPESET>
 /* static */ inline TYPESET* JitScript::BytecodeTypes(JSScript* script,
                                                       jsbytecode* pc,
                                                       uint32_t* bytecodeMap,
                                                       uint32_t* hint,
--- a/js/src/jit/JitScript.cpp
+++ b/js/src/jit/JitScript.cpp
@@ -35,17 +35,17 @@ using namespace js::jit;
 size_t JitScript::NumTypeSets(JSScript* script) {
   // We rely on |num| not overflowing below.
   static_assert(JSScript::MaxBytecodeTypeSets == UINT16_MAX,
                 "JSScript typesets should have safe range to avoid overflow");
   static_assert(JSFunction::NArgsBits == 16,
                 "JSFunction nargs should have safe range to avoid overflow");
 
   size_t num = script->numBytecodeTypeSets() + 1 /* this */;
-  if (JSFunction* fun = script->functionNonDelazifying()) {
+  if (JSFunction* fun = script->function()) {
     num += fun->nargs();
   }
 
   return num;
 }
 
 JitScript::JitScript(JSScript* script, uint32_t typeSetOffset,
                      uint32_t bytecodeTypeMapOffset, uint32_t allocBytes,
@@ -162,18 +162,17 @@ bool JSScript::createJitScript(JSContext
   for (unsigned i = 0; i < numBytecodeTypeSets(); i++) {
     InferSpew(ISpewOps, "typeSet: %sT%p%s bytecode%u %p",
               InferSpewColor(&typeArray[i]), &typeArray[i],
               InferSpewColorReset(), i, this);
   }
   StackTypeSet* thisTypes = this->jitScript()->thisTypes(sweep, this);
   InferSpew(ISpewOps, "typeSet: %sT%p%s this %p", InferSpewColor(thisTypes),
             thisTypes, InferSpewColorReset(), this);
-  unsigned nargs =
-      functionNonDelazifying() ? functionNonDelazifying()->nargs() : 0;
+  unsigned nargs = function() ? function()->nargs() : 0;
   for (unsigned i = 0; i < nargs; i++) {
     StackTypeSet* types = this->jitScript()->argTypes(sweep, this, i);
     InferSpew(ISpewOps, "typeSet: %sT%p%s arg%u %p", InferSpewColor(types),
               types, InferSpewColorReset(), i, this);
   }
 #endif
 
   return true;
@@ -259,37 +258,36 @@ void JitScript::ensureProfileString(JSCo
 #ifdef DEBUG
 void JitScript::printTypes(JSContext* cx, HandleScript script) {
   AutoSweepJitScript sweep(script);
   MOZ_ASSERT(script->jitScript() == this);
 
   AutoEnterAnalysis enter(nullptr, script->zone());
   Fprinter out(stderr);
 
-  if (script->functionNonDelazifying()) {
+  if (script->function()) {
     fprintf(stderr, "Function");
   } else if (script->isForEval()) {
     fprintf(stderr, "Eval");
   } else {
     fprintf(stderr, "Main");
   }
   fprintf(stderr, " %#" PRIxPTR " %s:%u ", uintptr_t(script.get()),
           script->filename(), script->lineno());
 
-  if (script->functionNonDelazifying()) {
-    if (JSAtom* name = script->functionNonDelazifying()->explicitName()) {
+  if (script->function()) {
+    if (JSAtom* name = script->function()->explicitName()) {
       name->dumpCharsNoNewline(out);
     }
   }
 
   fprintf(stderr, "\n    this:");
   thisTypes(sweep, script)->print();
 
-  for (uint32_t i = 0; script->functionNonDelazifying() &&
-                       i < script->functionNonDelazifying()->nargs();
+  for (uint32_t i = 0; script->function() && i < script->function()->nargs();
        i++) {
     fprintf(stderr, "\n    arg%u:", i);
     argTypes(sweep, script, i)->print();
   }
   fprintf(stderr, "\n");
 
   for (BytecodeLocation it : AllBytecodesIterable(script)) {
     {
@@ -560,18 +558,18 @@ JitScript::CachedIonData::CachedIonData(
 bool JitScript::ensureHasCachedIonData(JSContext* cx, HandleScript script) {
   MOZ_ASSERT(script->jitScript() == this);
 
   if (hasCachedIonData()) {
     return true;
   }
 
   Rooted<EnvironmentObject*> templateEnv(cx);
-  if (script->functionNonDelazifying()) {
-    RootedFunction fun(cx, script->functionNonDelazifying());
+  if (script->function()) {
+    RootedFunction fun(cx, script->function());
 
     if (fun->needsNamedLambdaEnvironment()) {
       templateEnv =
           NamedLambdaObject::createTemplateObject(cx, fun, gc::TenuredHeap);
       if (!templateEnv) {
         return false;
       }
     }
--- a/js/src/jit/MCallOptimize.cpp
+++ b/js/src/jit/MCallOptimize.cpp
@@ -4123,17 +4123,17 @@ void IonBuilder::atomicsCheckBounds(Call
   *elements = nullptr;
   addTypedArrayLengthAndData(obj, DoBoundsCheck, index, &length, elements);
 }
 
 IonBuilder::InliningResult IonBuilder::inlineIsConstructing(
     CallInfo& callInfo) {
   MOZ_ASSERT(!callInfo.constructing());
   MOZ_ASSERT(callInfo.argc() == 0);
-  MOZ_ASSERT(script()->functionNonDelazifying(),
+  MOZ_ASSERT(script()->function(),
              "isConstructing() should only be called in function scripts");
 
   if (getInlineReturnType() != MIRType::Boolean) {
     return InliningStatus_NotInlined;
   }
 
   callInfo.setImplicitlyUsedUnchecked();
 
--- a/js/src/jit/RematerializedFrame.h
+++ b/js/src/jit/RematerializedFrame.h
@@ -134,17 +134,17 @@ class RematerializedFrame {
 
   bool hasArgsObj() const { return !!argsObj_; }
   ArgumentsObject& argsObj() const {
     MOZ_ASSERT(hasArgsObj());
     MOZ_ASSERT(script()->needsArgsObj());
     return *argsObj_;
   }
 
-  bool isFunctionFrame() const { return !!script_->functionNonDelazifying(); }
+  bool isFunctionFrame() const { return !!script_->function(); }
   bool isGlobalFrame() const { return script_->isGlobalCode(); }
   bool isModuleFrame() const { return script_->module(); }
 
   JSScript* script() const { return script_; }
   JSFunction* callee() const {
     MOZ_ASSERT(isFunctionFrame());
     MOZ_ASSERT(callee_);
     return callee_;
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -3714,17 +3714,17 @@ JS_PUBLIC_API JSScript* JS_GetFunctionSc
   return fun->nonLazyScript();
 }
 
 JS_PUBLIC_API JSString* JS_DecompileScript(JSContext* cx, HandleScript script) {
   MOZ_ASSERT(!cx->zone()->isAtomsZone());
 
   AssertHeapIsIdle();
   CHECK_THREAD(cx);
-  RootedFunction fun(cx, script->functionNonDelazifying());
+  RootedFunction fun(cx, script->function());
   if (fun) {
     return JS_DecompileFunction(cx, fun);
   }
   bool haveSource;
   if (!ScriptSource::loadSource(cx, script->scriptSource(), &haveSource)) {
     return nullptr;
   }
   return haveSource ? JSScript::sourceData(cx, script)
--- a/js/src/vm/ArgumentsObject.cpp
+++ b/js/src/vm/ArgumentsObject.cpp
@@ -510,17 +510,17 @@ static bool MappedArgSetter(JSContext* c
   if (!script) {
     return false;
   }
 
   if (JSID_IS_INT(id)) {
     unsigned arg = unsigned(JSID_TO_INT(id));
     if (arg < argsobj->initialLength() && !argsobj->isElementDeleted(arg)) {
       argsobj->setElement(cx, arg, v);
-      if (arg < script->functionNonDelazifying()->nargs()) {
+      if (arg < script->function()->nargs()) {
         jit::JitScript::MonitorArgType(cx, script, arg, v);
       }
       return result.succeed();
     }
   } else {
     MOZ_ASSERT(JSID_IS_ATOM(id, cx->names().length) ||
                JSID_IS_ATOM(id, cx->names().callee));
   }
@@ -726,17 +726,17 @@ bool MappedArgumentsObject::obj_definePr
     } else {
       if (desc.hasValue()) {
         RootedFunction callee(cx, &argsobj->callee());
         RootedScript script(cx, JSFunction::getOrCreateScript(cx, callee));
         if (!script) {
           return false;
         }
         argsobj->setElement(cx, arg, desc.value());
-        if (arg < script->functionNonDelazifying()->nargs()) {
+        if (arg < script->function()->nargs()) {
           jit::JitScript::MonitorArgType(cx, script, arg, desc.value());
         }
       }
       if (desc.hasWritable() && !desc.writable()) {
         if (!argsobj->markElementDeleted(cx, arg)) {
           return false;
         }
       }
--- a/js/src/vm/BytecodeUtil.cpp
+++ b/js/src/vm/BytecodeUtil.cpp
@@ -2186,17 +2186,17 @@ bool ExpressionDecompiler::quote(JSStrin
   return QuoteString(&sprinter, s, quote);
 }
 
 JSAtom* ExpressionDecompiler::loadAtom(jsbytecode* pc) {
   return script->getAtom(pc);
 }
 
 JSAtom* ExpressionDecompiler::getArg(unsigned slot) {
-  MOZ_ASSERT(script->functionNonDelazifying());
+  MOZ_ASSERT(script->function());
   MOZ_ASSERT(slot < script->numArgs());
 
   for (PositionalFormalParameterIter fi(script); fi; fi++) {
     if (fi.argumentSlot() == slot) {
       if (!fi.isDestructured()) {
         return fi.name();
       }
 
@@ -2646,17 +2646,17 @@ JS_FRIEND_API JSString* js::GetPCCountSc
   if (!filename) {
     return nullptr;
   }
   if (!JSONStringProperty(sp, json, "file", filename)) {
     return nullptr;
   }
   json.property("line", script->lineno());
 
-  if (JSFunction* fun = script->functionNonDelazifying()) {
+  if (JSFunction* fun = script->function()) {
     if (JSAtom* atom = fun->displayAtom()) {
       if (!JSONStringProperty(sp, json, "name", atom)) {
         return nullptr;
       }
     }
   }
 
   uint64_t total = 0;
--- a/js/src/vm/CodeCoverage.cpp
+++ b/js/src/vm/CodeCoverage.cpp
@@ -117,17 +117,17 @@ void LCovSource::exportInto(GenericPrint
   numBranchesHit_ = 0;
   linesHit_.clear();
   numLinesInstrumented_ = 0;
   numLinesHit_ = 0;
   maxLineHit_ = 0;
 }
 
 bool LCovSource::writeScriptName(LSprinter& out, JSScript* script) {
-  JSFunction* fun = script->functionNonDelazifying();
+  JSFunction* fun = script->function();
   if (fun && fun->displayAtom()) {
     return EscapedStringPrinter(out, fun->displayAtom(), 0);
   }
   out.printf("top-level");
   return true;
 }
 
 void LCovSource::writeScript(JSScript* script) {
--- a/js/src/vm/EnvironmentObject.cpp
+++ b/js/src/vm/EnvironmentObject.cpp
@@ -3870,25 +3870,25 @@ static bool AnalyzeEntrainedVariablesInS
   if (!remainingNames.empty()) {
     Sprinter buf(cx);
     if (!buf.init()) {
       return false;
     }
 
     buf.printf("Script ");
 
-    if (JSAtom* name = script->functionNonDelazifying()->displayAtom()) {
+    if (JSAtom* name = script->function()->displayAtom()) {
       buf.putString(name);
       buf.printf(" ");
     }
 
     buf.printf("(%s:%u) has variables entrained by ", script->filename(),
                script->lineno());
 
-    if (JSAtom* name = innerScript->functionNonDelazifying()->displayAtom()) {
+    if (JSAtom* name = innerScript->function()->displayAtom()) {
       buf.putString(name);
       buf.printf(" ");
     }
 
     buf.printf("(%s:%u) ::", innerScript->filename(), innerScript->lineno());
 
     for (PropertyNameSet::Range r = remainingNames.all(); !r.empty();
          r.popFront()) {
--- a/js/src/vm/GeckoProfiler.cpp
+++ b/js/src/vm/GeckoProfiler.cpp
@@ -293,17 +293,17 @@ UniqueChars GeckoProfilerRuntime::allocP
   // Calculate filename length.
   const char* filenameStr = script->filename() ? script->filename() : "(null)";
   size_t filenameLength = strlen(filenameStr);
 
   // Calculate line + column length.
   bool hasLineAndColumn = false;
   size_t lineAndColumnLength = 0;
   char lineAndColumnStr[30];
-  if (hasName || script->functionNonDelazifying() || script->isForEval()) {
+  if (hasName || script->function() || script->isForEval()) {
     lineAndColumnLength = SprintfLiteral(lineAndColumnStr, "%u:%u",
                                          script->lineno(), script->column());
     hasLineAndColumn = true;
   }
 
   // Full profile string for scripts with functions is:
   //      FuncName (FileName:Lineno:Column)
   // Full profile string for scripts without functions is:
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -5370,17 +5370,17 @@ void js::ReportRuntimeLexicalError(JSCon
   JSOp op = JSOp(*pc);
   MOZ_ASSERT(op == JSOP_CHECKLEXICAL || op == JSOP_CHECKALIASEDLEXICAL ||
              op == JSOP_THROWSETCONST || op == JSOP_THROWSETALIASEDCONST ||
              op == JSOP_THROWSETCALLEE || op == JSOP_GETIMPORT);
 
   RootedPropertyName name(cx);
 
   if (op == JSOP_THROWSETCALLEE) {
-    name = script->functionNonDelazifying()->explicitName()->asPropertyName();
+    name = script->function()->explicitName()->asPropertyName();
   } else if (IsLocalOp(op)) {
     name = FrameSlotName(script, pc)->asPropertyName();
   } else if (IsAtomOp(op)) {
     name = script->getName(pc);
   } else {
     MOZ_ASSERT(IsAliasedVarOp(op));
     name = EnvironmentCoordinateNameSlow(script, pc);
   }
--- a/js/src/vm/JSFunction.h
+++ b/js/src/vm/JSFunction.h
@@ -723,17 +723,17 @@ class JSFunction : public js::NativeObje
     return nonLazyScript();
   }
 
   // If this is a scripted function, returns its canonical function (the
   // original function allocated by the frontend). Note that lazy self-hosted
   // builtins don't have a lazy script so in that case we also return nullptr.
   JSFunction* maybeCanonicalFunction() const {
     if (hasScript()) {
-      return nonLazyScript()->functionNonDelazifying();
+      return nonLazyScript()->function();
     }
     if (hasLazyScript()) {
       return lazyScript()->functionNonDelazifying();
     }
     return nullptr;
   }
 
   // The state of a JSFunction whose script errored out during bytecode
--- a/js/src/vm/JSScript.cpp
+++ b/js/src/vm/JSScript.cpp
@@ -1023,17 +1023,17 @@ XDRResult js::XDRScript(XDRState<mode>* 
   // instructions.
   if (xdr->hasOptions() ? !!xdr->options().instrumentationKinds
                         : !!cx->global()->getInstrumentationHolder()) {
     return xdr->fail(JS::TranscodeResult_Failure);
   }
 
   if (mode == XDR_ENCODE) {
     script = scriptp.get();
-    MOZ_ASSERT(script->functionNonDelazifying() == fun);
+    MOZ_ASSERT(script->function() == fun);
 
     if (!fun && script->treatAsRunOnce() && script->hasRunOnce()) {
       // This is a toplevel or eval script that's runOnce.  We want to
       // make sure that we're not XDR-saving an object we emitted for
       // JSOP_OBJECT that then got modified.  So throw if we're not
       // cloning in JSOP_OBJECT or if we ever didn't clone in it in the
       // past.
       Realm* realm = cx->realm();
@@ -4625,17 +4625,17 @@ bool PrivateScriptData::Clone(JSContext*
 JSScript* js::detail::CopyScript(JSContext* cx, HandleScript src,
                                  HandleObject functionOrGlobal,
                                  HandleScriptSourceObject sourceObject,
                                  MutableHandle<GCVector<Scope*>> scopes) {
   // We don't copy the HideScriptFromDebugger flag and it's not clear what
   // should happen if it's set on the source script.
   MOZ_ASSERT(!src->hideScriptFromDebugger());
 
-  if (src->treatAsRunOnce() && !src->functionNonDelazifying()) {
+  if (src->treatAsRunOnce() && !src->function()) {
     JS_ReportErrorASCII(cx, "No cloning toplevel run-once scripts");
     return nullptr;
   }
 
   /* NB: Keep this in sync with XDRScript. */
 
   // Some embeddings are not careful to use ExposeObjectToActiveJS as needed.
   JS::AssertObjectIsNotGray(sourceObject);
@@ -5030,17 +5030,17 @@ void js::SetFrameArgumentsObject(JSConte
     if (IsOptimizedPlaceholderMagicValue(frame.unaliasedLocal(frameSlot))) {
       frame.unaliasedLocal(frameSlot) = ObjectValue(*argsobj);
     }
   }
 }
 
 /* static */
 void JSScript::argumentsOptimizationFailed(JSContext* cx, HandleScript script) {
-  MOZ_ASSERT(script->functionNonDelazifying());
+  MOZ_ASSERT(script->function());
   MOZ_ASSERT(script->analyzedArgsUsage());
   MOZ_ASSERT(script->argumentsHasVarBinding());
 
   /*
    * It is possible that the arguments optimization has already failed,
    * everything has been fixed up, but there was an outstanding magic value
    * on the stack that has just now flowed into an apply. In this case, there
    * is nothing to do; GuardFunApplySpeculation will patch in the real
--- a/js/src/vm/JSScript.h
+++ b/js/src/vm/JSScript.h
@@ -2725,18 +2725,19 @@ class JSScript : public js::BaseScript {
   }
   bool isRelazifiable() const {
     return isRelazifiableIgnoringJitCode() && !hasJitScript();
   }
   void setLazyScript(js::LazyScript* lazy) { lazyScript = lazy; }
   js::LazyScript* maybeLazyScript() { return lazyScript; }
 
   // Canonical function for the script, if it has a function. For global and
-  // eval scripts this is nullptr.
-  JSFunction* functionNonDelazifying() const {
+  // eval scripts this is nullptr. The canonical function is never lazy if the
+  // script exists.
+  JSFunction* function() const {
     if (bodyScope()->is<js::FunctionScope>()) {
       return bodyScope()->as<js::FunctionScope>().canonicalFunction();
     }
     return nullptr;
   }
 
   bool isModule() const {
     MOZ_ASSERT(hasFlag(ImmutableFlags::IsModule) ==
@@ -2796,17 +2797,17 @@ class JSScript : public js::BaseScript {
    *
    * If we evaluate some code which contains a syntax error, then we might
    * produce a JSScript which has no associated bytecode. Testing with
    * |code()| filters out this kind of scripts.
    *
    * If this script has a function associated to it, then it is not the
    * top-level of a file.
    */
-  bool isTopLevel() { return code() && !functionNonDelazifying(); }
+  bool isTopLevel() { return code() && !function(); }
 
   /* Ensure the script has a JitScript. */
   inline bool ensureHasJitScript(JSContext* cx, js::jit::AutoKeepJitScripts&);
 
   bool hasJitScript() const { return warmUpData_.isJitScript(); }
 
   js::jit::JitScript* jitScript() const {
     MOZ_ASSERT(hasJitScript());
@@ -3049,23 +3050,16 @@ class JSScript : public js::BaseScript {
     MOZ_ASSERT(js::JOF_OPTYPE(JSOp(*pc)) == JOF_SCOPE,
                "Did you mean to use lookupScope(pc)?");
     return getScope(GET_UINT32_INDEX(pc));
   }
 
   inline JSFunction* getFunction(size_t index);
   inline JSFunction* getFunction(jsbytecode* pc);
 
-  JSFunction* function() const {
-    if (functionNonDelazifying()) {
-      return functionNonDelazifying();
-    }
-    return nullptr;
-  }
-
   inline js::RegExpObject* getRegExp(size_t index);
   inline js::RegExpObject* getRegExp(jsbytecode* pc);
 
   js::BigInt* getBigInt(size_t index) {
     return &gcthings()[index].as<js::BigInt>();
   }
 
   js::BigInt* getBigInt(jsbytecode* pc) {
--- a/js/src/vm/ObjectGroup.cpp
+++ b/js/src/vm/ObjectGroup.cpp
@@ -231,17 +231,17 @@ bool ObjectGroup::useSingletonForAllocat
                                                 jsbytecode* pc,
                                                 JSProtoKey key) {
   /*
    * Objects created outside loops in global and eval scripts should have
    * singleton types. For now this is only done for plain objects, but not
    * typed arrays or normal arrays.
    */
 
-  if (script->functionNonDelazifying() && !script->treatAsRunOnce()) {
+  if (script->function() && !script->treatAsRunOnce()) {
     return false;
   }
 
   if (key != JSProto_Object) {
     return false;
   }
 
   // All loops in the script will have a try note indicating their boundary.
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -225,24 +225,23 @@ bool InterpreterFrame::prologue(JSContex
       !initFunctionEnvironmentObjects(cx)) {
     return false;
   }
 
   MOZ_ASSERT_IF(isConstructing(),
                 thisArgument().isObject() ||
                     thisArgument().isMagic(JS_UNINITIALIZED_LEXICAL));
 
-  return probes::EnterScript(cx, script, script->functionNonDelazifying(),
-                             this);
+  return probes::EnterScript(cx, script, script->function(), this);
 }
 
 void InterpreterFrame::epilogue(JSContext* cx, jsbytecode* pc) {
   RootedScript script(cx, this->script());
   MOZ_ASSERT(cx->realm() == script->realm());
-  probes::ExitScript(cx, script, script->functionNonDelazifying(),
+  probes::ExitScript(cx, script, script->function(),
                      hasPushedGeckoProfilerFrame());
 
   // Check that the scope matches the environment at the point of leaving
   // the frame.
   AssertScopeMatchesEnvironment(this, pc);
 
   EnvironmentIter ei(cx, this, pc);
   UnwindAllEnvironmentsInFrame(cx, ei);
@@ -942,17 +941,17 @@ bool FrameIter::isFunctionFrame() const 
       break;
     case INTERP:
       return interpFrame()->isFunctionFrame();
     case JIT:
       if (isJSJit()) {
         if (jsJitFrame().isBaselineJS()) {
           return jsJitFrame().baselineFrame()->isFunctionFrame();
         }
-        return script()->functionNonDelazifying();
+        return script()->function();
       }
       MOZ_ASSERT(isWasm());
       return false;
   }
   MOZ_CRASH("Unexpected state");
 }
 
 JSAtom* FrameIter::maybeFunctionDisplayAtom() const {
@@ -1253,17 +1252,17 @@ unsigned FrameIter::numActualArgs() cons
       }
       MOZ_ASSERT(jsJitFrame().isBaselineJS());
       return jsJitFrame().numActualArgs();
   }
   MOZ_CRASH("Unexpected state");
 }
 
 unsigned FrameIter::numFormalArgs() const {
-  return script()->functionNonDelazifying()->nargs();
+  return script()->function()->nargs();
 }
 
 Value FrameIter::unaliasedActual(unsigned i,
                                  MaybeCheckAliasing checkAliasing) const {
   return abstractFramePtr().unaliasedActual(i, checkAliasing);
 }
 
 JSObject* FrameIter::environmentChain(JSContext* cx) const {
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -440,17 +440,17 @@ class InterpreterFrame {
    */
 
   bool isGlobalFrame() const { return script_->isGlobalCode(); }
 
   bool isModuleFrame() const { return script_->module(); }
 
   bool isEvalFrame() const { return script_->isForEval(); }
 
-  bool isFunctionFrame() const { return script_->functionNonDelazifying(); }
+  bool isFunctionFrame() const { return script_->function(); }
 
   inline bool isStrictEvalFrame() const {
     return isEvalFrame() && script()->strict();
   }
 
   bool isNonStrictEvalFrame() const {
     return isEvalFrame() && !script()->strict();
   }
--- a/js/src/vm/TypeInference.cpp
+++ b/js/src/vm/TypeInference.cpp
@@ -1207,18 +1207,17 @@ bool JitScript::FreezeTypeSets(CompilerC
     if (!existing[i].cloneIntoUninitialized(alloc, &types[i])) {
       return false;
     }
   }
 
   size_t thisTypesIndex = jitScript->thisTypes(sweep, script) - existing;
   *pThisTypes = types + thisTypesIndex;
 
-  if (script->functionNonDelazifying() &&
-      script->functionNonDelazifying()->nargs() > 0) {
+  if (script->function() && script->function()->nargs() > 0) {
     size_t firstArgIndex = jitScript->argTypes(sweep, script, 0) - existing;
     *pArgTypes = types + firstArgIndex;
   } else {
     *pArgTypes = nullptr;
   }
 
   *pBytecodeTypes = types;
 
@@ -1524,19 +1523,18 @@ bool js::FinishCompilation(JSContext* cx
     }
 
     JitScript* jitScript = entry.script->jitScript();
     AutoSweepJitScript sweep(entry.script);
     if (!CheckFrozenTypeSet(sweep, cx, entry.thisTypes,
                             jitScript->thisTypes(sweep, entry.script))) {
       succeeded = false;
     }
-    unsigned nargs = entry.script->functionNonDelazifying()
-                         ? entry.script->functionNonDelazifying()->nargs()
-                         : 0;
+    unsigned nargs =
+        entry.script->function() ? entry.script->function()->nargs() : 0;
     for (size_t i = 0; i < nargs; i++) {
       if (!CheckFrozenTypeSet(sweep, cx, &entry.argTypes[i],
                               jitScript->argTypes(sweep, entry.script, i))) {
         succeeded = false;
       }
     }
     for (size_t i = 0; i < entry.script->numBytecodeTypeSets(); i++) {
       if (!CheckFrozenTypeSet(sweep, cx, &entry.bytecodeTypes[i],
@@ -1615,19 +1613,18 @@ void js::FinishDefinitePropertiesAnalysi
     const CompilerConstraintList::FrozenScript& entry =
         constraints->frozenScript(i);
     JSScript* script = entry.script;
     JitScript* jitScript = script->jitScript();
 
     AutoSweepJitScript sweep(script);
     MOZ_ASSERT(jitScript->thisTypes(sweep, script)->isSubset(entry.thisTypes));
 
-    unsigned nargs = entry.script->functionNonDelazifying()
-                         ? entry.script->functionNonDelazifying()->nargs()
-                         : 0;
+    unsigned nargs =
+        entry.script->function() ? entry.script->function()->nargs() : 0;
     for (size_t j = 0; j < nargs; j++) {
       StackTypeSet* argTypes = jitScript->argTypes(sweep, script, j);
       MOZ_ASSERT(argTypes->isSubset(&entry.argTypes[j]));
     }
 
     for (size_t j = 0; j < script->numBytecodeTypeSets(); j++) {
       MOZ_ASSERT(
           jitScript->typeArray(sweep)[j].isSubset(&entry.bytecodeTypes[j]));
@@ -1640,19 +1637,17 @@ void js::FinishDefinitePropertiesAnalysi
         constraints->frozenScript(i);
     JSScript* script = entry.script;
     JitScript* jitScript = script->jitScript();
 
     AutoSweepJitScript sweep(script);
     CheckDefinitePropertiesTypeSet(sweep, cx, entry.thisTypes,
                                    jitScript->thisTypes(sweep, script));
 
-    unsigned nargs = script->functionNonDelazifying()
-                         ? script->functionNonDelazifying()->nargs()
-                         : 0;
+    unsigned nargs = script->function() ? script->function()->nargs() : 0;
     for (size_t j = 0; j < nargs; j++) {
       StackTypeSet* argTypes = jitScript->argTypes(sweep, script, j);
       CheckDefinitePropertiesTypeSet(sweep, cx, &entry.argTypes[j], argTypes);
     }
 
     for (size_t j = 0; j < script->numBytecodeTypeSets(); j++) {
       CheckDefinitePropertiesTypeSet(sweep, cx, &entry.bytecodeTypes[j],
                                      &jitScript->typeArray(sweep)[j]);
@@ -3331,17 +3326,17 @@ bool js::AddClearDefiniteFunctionUsesInS
   // |script|, and add constraints to ensure that if the type sets' contents
   // change then the definite properties are cleared from the type.
   // This ensures that the inlining performed when the definite properties
   // analysis was done is stable. We only need to look at type sets which
   // contain a single object, as IonBuilder does not inline polymorphic sites
   // during the definite properties analysis.
 
   TypeSet::ObjectKey* calleeKey =
-      TypeSet::ObjectType(calleeScript->functionNonDelazifying()).objectKey();
+      TypeSet::ObjectType(calleeScript->function()).objectKey();
 
   AutoSweepJitScript sweep(script);
   JitScript* jitScript = script->jitScript();
   unsigned count = jitScript->numTypeSets();
   StackTypeSet* typeArray = jitScript->typeArray(sweep);
 
   for (unsigned i = 0; i < count; i++) {
     StackTypeSet* types = &typeArray[i];