diff --git a/js/src/debugger/Debugger.cpp b/js/src/debugger/Debugger.cpp index cf80e3b7be81..b962e4c79976 100644 --- a/js/src/debugger/Debugger.cpp +++ b/js/src/debugger/Debugger.cpp @@ -2559,8 +2559,8 @@ ResumeMode DebugAPI::onSingleStep(JSContext* cx, MutableHandleValue vp) { // it had better be suspended. MOZ_ASSERT(genObj.isSuspended()); - if (!genObj.callee().isInterpretedLazy() && - genObj.callee().nonLazyScript() == trappingScript && + if (genObj.callee().hasScript() && + genObj.callee().baseScript() == trappingScript && !frameObj.getReservedSlot(DebuggerFrame::ONSTEP_HANDLER_SLOT) .isUndefined()) { suspendedStepperCount++; diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index fb143f4774d9..3ecaf3309bdb 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -2176,7 +2176,7 @@ JSFunction* AllocNewFunction(JSContext* cx, } if (data.isSelfHosting) { fun->setIsSelfHostedBuiltin(); - MOZ_ASSERT(!fun->isInterpretedLazy()); + MOZ_ASSERT(fun->hasScript()); } return fun; } @@ -2610,7 +2610,7 @@ bool Parser::skipLazyInnerFunction( } funbox->initFromLazyFunction(fun); - MOZ_ASSERT(fun->lazyScript()->hasEnclosingLazyScript()); + MOZ_ASSERT(fun->baseScript()->hasEnclosingLazyScript()); PropagateTransitiveParseFlags(funbox, pc_->sc()); diff --git a/js/src/jit/CompileInfo.h b/js/src/jit/CompileInfo.h index 5334b115bbcb..28b2152fe79e 100644 --- a/js/src/jit/CompileInfo.h +++ b/js/src/jit/CompileInfo.h @@ -194,7 +194,7 @@ class CompileInfo { // 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()->function(); + fun_ = fun_->baseScript()->function(); MOZ_ASSERT(fun_->isTenured()); } diff --git a/js/src/vm/EnvironmentObject.cpp b/js/src/vm/EnvironmentObject.cpp index 84e313d8652b..d6df2c33964d 100644 --- a/js/src/vm/EnvironmentObject.cpp +++ b/js/src/vm/EnvironmentObject.cpp @@ -1340,7 +1340,7 @@ void EnvironmentIter::settle() { env_->as() .callee() .maybeCanonicalFunction() - ->nonLazyScript()); + ->baseScript()); } else if (scope->is()) { MOZ_ASSERT(scope == &env_->as().scope()); } else if (scope->is()) { @@ -1832,7 +1832,7 @@ class DebugEnvironmentProxyHandler : public BaseProxyHandler { return isFunctionEnvironmentWithThis(env) && !env.as() .callee() - .nonLazyScript() + .baseScript() ->functionHasThisBinding(); } diff --git a/js/src/vm/JSFunction.cpp b/js/src/vm/JSFunction.cpp index 7b34cb7844ef..6d78f5e28b84 100644 --- a/js/src/vm/JSFunction.cpp +++ b/js/src/vm/JSFunction.cpp @@ -634,9 +634,9 @@ XDRResult js::XDRInterpretedFunction(XDRState* xdr, fun->setFlags(uint16_t(flagsword)); fun->initAtom(atom); if (firstword & IsLazy) { - MOZ_ASSERT(fun->lazyScript() == lazy); + MOZ_ASSERT(fun->baseScript() == lazy); } else { - MOZ_ASSERT(fun->nonLazyScript() == script); + MOZ_ASSERT(fun->baseScript() == script); MOZ_ASSERT(fun->nargs() == script->numArgs()); } @@ -1550,7 +1550,7 @@ static bool DelazifyCanonicalScriptedFunction(JSContext* cx, if (!frontend::CompileLazyBinASTFunction( cx, lazy, ss->binASTSource() + sourceStart, sourceLength)) { MOZ_ASSERT(fun->isInterpretedLazy()); - MOZ_ASSERT(fun->lazyScript() == lazy); + MOZ_ASSERT(fun->baseScript() == lazy); MOZ_ASSERT(!lazy->hasScript()); return false; } @@ -1575,7 +1575,7 @@ static bool DelazifyCanonicalScriptedFunction(JSContext* cx, // The frontend shouldn't fail after linking the function and the // non-lazy script together. MOZ_ASSERT(fun->isInterpretedLazy()); - MOZ_ASSERT(fun->lazyScript() == lazy); + MOZ_ASSERT(fun->baseScript() == lazy); MOZ_ASSERT(!lazy->hasScript()); return false; } @@ -1593,7 +1593,7 @@ static bool DelazifyCanonicalScriptedFunction(JSContext* cx, // The frontend shouldn't fail after linking the function and the // non-lazy script together. MOZ_ASSERT(fun->isInterpretedLazy()); - MOZ_ASSERT(fun->lazyScript() == lazy); + MOZ_ASSERT(fun->baseScript() == lazy); MOZ_ASSERT(!lazy->hasScript()); return false; } diff --git a/js/src/vm/JSFunction.h b/js/src/vm/JSFunction.h index ae3c56c95062..2684e24d820f 100644 --- a/js/src/vm/JSFunction.h +++ b/js/src/vm/JSFunction.h @@ -414,7 +414,7 @@ class JSFunction : public js::NativeObject { // FunctionBox::needsCallObjectRegardlessOfBindings(). MOZ_ASSERT_IF(baseScript()->funHasExtensibleScope() || baseScript()->needsHomeObject() || - nonLazyScript()->isDerivedClassConstructor() || + baseScript()->isDerivedClassConstructor() || isGenerator() || isAsync(), nonLazyScript()->bodyScope()->hasEnvironment()); @@ -503,7 +503,7 @@ class JSFunction : public js::NativeObject { return false; } - return nonLazyScript()->hasJitScript(); + return baseScript()->hasJitScript(); } bool hasJitEntry() const { return hasScript() || isInterpretedLazy() || isNativeWithJitEntry(); diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp index 56d7e107b686..29a257bbbf23 100644 --- a/js/src/vm/JSScript.cpp +++ b/js/src/vm/JSScript.cpp @@ -4997,7 +4997,7 @@ static JSObject* CloneScriptObject(JSContext* cx, PrivateScriptData* srcData, } } - Scope* enclosing = innerFun->nonLazyScript()->enclosingScope(); + Scope* enclosing = innerFun->enclosingScope(); uint32_t scopeIndex = FindScopeIndex(srcData->gcthings(), *enclosing); RootedScope enclosingClone(cx, &gcThings[scopeIndex].get().as()); return CloneInnerInterpretedFunction(cx, enclosingClone, innerFun, diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index 3c5168949d4e..a957f36c6b80 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -3099,8 +3099,7 @@ bool JSRuntime::cloneSelfHostedFunctionScript(JSContext* cx, // make sure there aren't any. MOZ_ASSERT(!sourceFun->isGenerator() && !sourceFun->isAsync()); MOZ_ASSERT(targetFun->isExtended()); - MOZ_ASSERT(targetFun->isInterpretedLazy()); - MOZ_ASSERT(targetFun->isSelfHostedBuiltin()); + MOZ_ASSERT(targetFun->hasSelfHostedLazyScript()); RootedScript sourceScript(cx, JSFunction::getOrCreateScript(cx, sourceFun)); if (!sourceScript) { @@ -3125,7 +3124,7 @@ bool JSRuntime::cloneSelfHostedFunctionScript(JSContext* cx, sourceObject)) { return false; } - MOZ_ASSERT(!targetFun->isInterpretedLazy()); + MOZ_ASSERT(targetFun->hasScript()); MOZ_ASSERT(sourceFun->nargs() == targetFun->nargs()); MOZ_ASSERT(sourceScript->hasRest() == targetFun->baseScript()->hasRest()); diff --git a/js/src/vm/Stack-inl.h b/js/src/vm/Stack-inl.h index af66fdced514..c4d23af69ea8 100644 --- a/js/src/vm/Stack-inl.h +++ b/js/src/vm/Stack-inl.h @@ -47,7 +47,7 @@ inline void InterpreterFrame::initCallFrame(InterpreterFrame* prev, JSScript* script, Value* argv, uint32_t nactual, MaybeConstruct constructing) { - MOZ_ASSERT(callee.nonLazyScript() == script); + MOZ_ASSERT(callee.baseScript() == script); /* Initialize stack frame members. */ flags_ = 0; @@ -219,7 +219,7 @@ MOZ_ALWAYS_INLINE InterpreterFrame* InterpreterStack::getCallFrame( MaybeConstruct constructing, Value** pargv) { JSFunction* fun = &args.callee().as(); - MOZ_ASSERT(fun->nonLazyScript() == script); + MOZ_ASSERT(fun->baseScript() == script); unsigned nformal = fun->nargs(); unsigned nvals = script->nslots(); @@ -261,7 +261,7 @@ MOZ_ALWAYS_INLINE bool InterpreterStack::pushInlineFrame( HandleScript script, MaybeConstruct constructing) { RootedFunction callee(cx, &args.callee().as()); MOZ_ASSERT(regs.sp == args.end()); - MOZ_ASSERT(callee->nonLazyScript() == script); + MOZ_ASSERT(callee->baseScript() == script); InterpreterFrame* prev = regs.fp(); jsbytecode* prevpc = regs.pc; diff --git a/js/src/vm/Xdr.cpp b/js/src/vm/Xdr.cpp index 2342124f3af7..c49e44762c01 100644 --- a/js/src/vm/Xdr.cpp +++ b/js/src/vm/Xdr.cpp @@ -291,10 +291,10 @@ XDRResult XDRState::codeFunction(MutableHandleFunction funp, funp.set(nullptr); } else if (getTreeKey(funp) != AutoXDRTree::noKey) { MOZ_ASSERT(sourceObject); - scope = funp->nonLazyScript()->enclosingScope(); + scope = funp->enclosingScope(); } else { MOZ_ASSERT(!sourceObject); - MOZ_ASSERT(funp->nonLazyScript()->enclosingScope()->is()); + MOZ_ASSERT(funp->enclosingScope()->is()); } MOZ_TRY(VersionCheck(this));