Bug 1234845 part 5 - Rename isNonEvalFunctionFrame to isFunctionFrame and use the script instead of flags. r=luke

This commit is contained in:
Jan de Mooij 2016-01-18 10:22:01 +01:00
Родитель b5364082de
Коммит fbc825f0b8
26 изменённых файлов: 75 добавлений и 86 удалений

Просмотреть файл

@ -270,7 +270,7 @@ EvalKernel(JSContext* cx, const CallArgs& args, EvalType evalType, AbstractFrame
EvalScriptGuard esg(cx);
if (evalType == DIRECT_EVAL && caller.isNonEvalFunctionFrame())
if (evalType == DIRECT_EVAL && caller.isFunctionFrame())
esg.lookupInEvalCache(linearStr, callerScript, pc);
if (!esg.foundScript()) {

Просмотреть файл

@ -1607,7 +1607,7 @@ ShellObjectMetadataCallback(JSContext* cx, JSObject*)
RootedId id(cx);
RootedValue callee(cx);
for (NonBuiltinScriptFrameIter iter(cx); !iter.done(); ++iter) {
if (iter.isNonEvalFunctionFrame() && iter.compartment() == cx->compartment()) {
if (iter.isFunctionFrame() && iter.compartment() == cx->compartment()) {
id = INT_TO_JSID(stackIndex);
RootedObject callee(cx, iter.callee(cx));
if (!JS_DefinePropertyById(cx, stack, id, callee, 0,

Просмотреть файл

@ -263,7 +263,7 @@ jit::EnsureHasScopeObjects(JSContext* cx, AbstractFramePtr fp)
// Ion does not compile eval scripts.
MOZ_ASSERT(!fp.isEvalFrame());
if (fp.isNonEvalFunctionFrame() &&
if (fp.isFunctionFrame() &&
fp.callee()->needsCallObject() &&
!fp.hasCallObj())
{

Просмотреть файл

@ -1723,7 +1723,7 @@ CopyFromRematerializedFrame(JSContext* cx, JitActivation* act, uint8_t* fp, size
frame->setScopeChain(rematFrame->scopeChain());
if (frame->isNonEvalFunctionFrame())
if (frame->isFunctionFrame())
frame->thisArgument() = rematFrame->thisArgument();
for (unsigned i = 0; i < frame->numActualArgs(); i++)

Просмотреть файл

@ -33,7 +33,7 @@ BaselineFrame::trace(JSTracer* trc, JitFrameIterator& frameIterator)
replaceCalleeToken(MarkCalleeToken(trc, calleeToken()));
// Mark |this|, actual and formal args.
if (isNonEvalFunctionFrame()) {
if (isFunctionFrame()) {
TraceRoot(trc, &thisArgument(), "baseline-this");
unsigned numArgs = js::Max(numActualArgs(), numFormalArgs());
@ -126,7 +126,7 @@ BaselineFrame::initStrictEvalScopeObjects(JSContext* cx)
bool
BaselineFrame::initFunctionScopeObjects(JSContext* cx)
{
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
MOZ_ASSERT(callee()->needsCallObject());
CallObject* callobj = CallObject::createForFunction(cx, this);

Просмотреть файл

@ -206,7 +206,7 @@ class BaselineFrame
return script()->functionNonDelazifying()->nargs();
}
Value& thisArgument() const {
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
return *(Value*)(reinterpret_cast<const uint8_t*>(this) +
BaselineFrame::Size() +
offsetOfThis());
@ -230,7 +230,7 @@ class BaselineFrame
Value newTarget() const {
if (isEvalFrame())
return *evalNewTargetAddress();
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
if (callee()->isArrow())
return callee()->getExtendedSlot(FunctionExtended::ARROW_NEWTARGET_SLOT);
if (isConstructing()) {
@ -406,8 +406,8 @@ class BaselineFrame
bool isNonStrictDirectEvalFrame() const {
return isNonStrictEvalFrame() && isNonGlobalEvalFrame();
}
bool isNonEvalFunctionFrame() const {
return CalleeTokenIsFunction(calleeToken()) && !isEvalFrame();
bool isFunctionFrame() const {
return CalleeTokenIsFunction(calleeToken());
}
bool isDebuggerEvalFrame() const {
return false;

Просмотреть файл

@ -64,7 +64,7 @@ EnsureCanEnterIon(JSContext* cx, ICWarmUpCounter_Fallback* stub, BaselineFrame*
MOZ_ASSERT(LoopEntryCanIonOsr(pc));
JitSpew(JitSpew_BaselineOSR, " Compile at loop entry!");
stat = CanEnterAtBranch(cx, script, frame, pc);
} else if (frame->isNonEvalFunctionFrame()) {
} else if (frame->isFunctionFrame()) {
JitSpew(JitSpew_BaselineOSR, " Compile function from top for later entry!");
stat = CompileFunctionForBaseline(cx, script, frame);
} else {

Просмотреть файл

@ -84,7 +84,7 @@ CheckFrame(InterpreterFrame* fp)
return false;
}
if (fp->isNonEvalFunctionFrame() && fp->numActualArgs() > BASELINE_MAX_ARGS_LENGTH) {
if (fp->isFunctionFrame() && fp->numActualArgs() > BASELINE_MAX_ARGS_LENGTH) {
// Fall back to the interpreter to avoid running out of stack space.
JitSpew(JitSpew_BaselineAbort, "Too many arguments (%u)", fp->numActualArgs());
return false;
@ -201,7 +201,7 @@ jit::EnterBaselineAtBranch(JSContext* cx, InterpreterFrame* fp, jsbytecode* pc)
AutoValueVector vals(cx);
RootedValue thisv(cx);
if (fp->isNonEvalFunctionFrame()) {
if (fp->isFunctionFrame()) {
data.constructing = fp->isConstructing();
data.numActualArgs = fp->numActualArgs();
data.maxArgc = Max(fp->numActualArgs(), fp->numFormalArgs()) + 1; // +1 = include |this|

Просмотреть файл

@ -2308,7 +2308,7 @@ CheckFrame(JSContext* cx, BaselineFrame* frame)
MOZ_ASSERT(!frame->isEvalFrame());
// This check is to not overrun the stack.
if (frame->isNonEvalFunctionFrame()) {
if (frame->isFunctionFrame()) {
if (TooManyActualArguments(frame->numActualArgs())) {
TrackAndSpewIonAbort(cx, frame->script(), "too many actual arguments");
return false;
@ -2634,7 +2634,7 @@ jit::CompileFunctionForBaseline(JSContext* cx, HandleScript script, BaselineFram
MOZ_ASSERT(frame->callee()->nonLazyScript()->canIonCompile());
MOZ_ASSERT(!frame->callee()->nonLazyScript()->isIonCompilingOffThread());
MOZ_ASSERT(!frame->callee()->nonLazyScript()->hasIonScript());
MOZ_ASSERT(frame->isNonEvalFunctionFrame());
MOZ_ASSERT(frame->isFunctionFrame());
// Mark as forbidden if frame can't be handled.
if (!CheckFrame(cx, frame)) {

Просмотреть файл

@ -75,7 +75,7 @@ jit::NewBaselineFrameInspector(TempAllocator* temp, BaselineFrame* frame, Compil
// during compilation could capture nursery pointers, so the values' types
// are recorded instead.
if (frame->isNonEvalFunctionFrame())
if (frame->isFunctionFrame())
inspector->thisType = TypeSet::GetMaybeUntrackedValueType(frame->thisArgument());
if (frame->scopeChain()->isSingleton())

Просмотреть файл

@ -142,8 +142,8 @@ RematerializedFrame::pushOnScopeChain(ScopeObject& scope)
bool
RematerializedFrame::initFunctionScopeObjects(JSContext* cx)
{
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(fun()->needsCallObject());
MOZ_ASSERT(isFunctionFrame());
MOZ_ASSERT(callee()->needsCallObject());
CallObject* callobj = CallObject::createForFunction(cx, this);
if (!callobj)
return false;

Просмотреть файл

@ -124,7 +124,7 @@ class RematerializedFrame
bool initFunctionScopeObjects(JSContext* cx);
bool hasCallObj() const {
MOZ_ASSERT(fun()->needsCallObject());
MOZ_ASSERT(callee()->needsCallObject());
return hasCallObj_;
}
CallObject& callObj() const;
@ -144,21 +144,10 @@ class RematerializedFrame
bool isGlobalOrModuleFrame() const {
return !isFunctionFrame();
}
bool isNonEvalFunctionFrame() const {
// Ion doesn't support eval frames.
return isFunctionFrame();
}
JSScript* script() const {
return script_;
}
JSFunction* fun() const {
MOZ_ASSERT(isFunctionFrame());
return script_->functionNonDelazifying();
}
JSFunction* maybeFun() const {
return isFunctionFrame() ? fun() : nullptr;
}
JSFunction* callee() const {
MOZ_ASSERT(isFunctionFrame());
return callee_;
@ -183,7 +172,7 @@ class RematerializedFrame
}
unsigned numFormalArgs() const {
return maybeFun() ? fun()->nargs() : 0;
return isFunctionFrame() ? callee()->nargs() : 0;
}
unsigned numActualArgs() const {
return numActualArgs_;

Просмотреть файл

@ -4732,7 +4732,7 @@ DoTypeMonitorFallback(JSContext* cx, BaselineFrame* frame, ICTypeMonitor_Fallbac
// In derived class constructors (including nested arrows/eval), the
// |this| argument or GETALIASEDVAR can return the magic TDZ value.
MOZ_ASSERT(value.isMagic(JS_UNINITIALIZED_LEXICAL));
MOZ_ASSERT(frame->isNonEvalFunctionFrame() || frame->isEvalFrame());
MOZ_ASSERT(frame->isFunctionFrame() || frame->isEvalFrame());
MOZ_ASSERT(stub->monitorsThis() ||
*GetNextPc(pc) == JSOP_CHECKTHIS ||
*GetNextPc(pc) == JSOP_CHECKRETURN);

Просмотреть файл

@ -691,7 +691,7 @@ DebugEpilogue(JSContext* cx, BaselineFrame* frame, jsbytecode* pc, bool ok)
JSScript* script = frame->script();
frame->setOverridePc(script->lastPC());
if (frame->isNonEvalFunctionFrame()) {
if (frame->isFunctionFrame()) {
MOZ_ASSERT_IF(ok, frame->hasReturnValue());
DebugScopes::onPopCall(frame, cx);
} else if (frame->isStrictEvalFrame()) {

Просмотреть файл

@ -401,7 +401,7 @@ js::GetOutermostEnclosingFunctionOfScriptedCaller(JSContext* cx)
if (iter.done())
return nullptr;
if (!iter.isNonEvalFunctionFrame())
if (!iter.isFunctionFrame())
return nullptr;
RootedFunction curr(cx, iter.callee(cx));
@ -725,7 +725,7 @@ FormatFrame(JSContext* cx, const ScriptFrameIter& iter, char* buf, int num,
RootedValue thisVal(cx);
if (iter.hasUsableAbstractFramePtr() &&
iter.isNonEvalFunctionFrame() &&
iter.isFunctionFrame() &&
fun && !fun->isArrow() && !fun->isDerivedClassConstructor())
{
if (!GetFunctionThis(cx, iter.abstractFramePtr(), &thisVal))

Просмотреть файл

@ -96,7 +96,7 @@ AdvanceToActiveCallLinear(JSContext* cx, NonBuiltinScriptFrameIter& iter, Handle
MOZ_ASSERT(!fun->isBuiltin());
for (; !iter.done(); ++iter) {
if (!iter.isNonEvalFunctionFrame())
if (!iter.isFunctionFrame())
continue;
if (iter.matchCallee(cx, fun))
return true;
@ -255,7 +255,7 @@ CallerGetterImpl(JSContext* cx, const CallArgs& args)
while (!iter.done() && iter.isEvalFrame())
++iter;
if (iter.done() || !iter.isNonEvalFunctionFrame()) {
if (iter.done() || !iter.isFunctionFrame()) {
args.rval().setNull();
return true;
}
@ -324,7 +324,7 @@ CallerSetterImpl(JSContext* cx, const CallArgs& args)
while (!iter.done() && iter.isEvalFrame())
++iter;
if (iter.done() || !iter.isNonEvalFunctionFrame())
if (iter.done() || !iter.isFunctionFrame())
return true;
RootedObject caller(cx, iter.callee(cx));

Просмотреть файл

@ -3598,7 +3598,7 @@ js::DumpInterpreterFrame(JSContext* cx, InterpreterFrame* start)
else
fprintf(stderr, "InterpreterFrame at %p\n", (void*) i.interpFrame());
if (i.isNonEvalFunctionFrame()) {
if (i.isFunctionFrame()) {
fprintf(stderr, "callee fun: ");
RootedValue v(cx);
JSObject* fun = i.callee(cx);
@ -3617,7 +3617,7 @@ js::DumpInterpreterFrame(JSContext* cx, InterpreterFrame* start)
fprintf(stderr, " current op: %s\n", CodeName[*pc]);
MaybeDumpObject("staticScope", i.script()->getStaticBlockScope(pc));
}
if (i.isNonEvalFunctionFrame())
if (i.isFunctionFrame())
MaybeDumpValue("this", i.thisArgument(cx));
if (!i.isJit()) {
fprintf(stderr, " rval: ");

Просмотреть файл

@ -4189,7 +4189,7 @@ JSScript::argumentsOptimizationFailed(JSContext* cx, HandleScript script)
if (i.isIon())
continue;
AbstractFramePtr frame = i.abstractFramePtr();
if (frame.isNonEvalFunctionFrame() && frame.script() == script) {
if (frame.isFunctionFrame() && frame.script() == script) {
/* We crash on OOM since cleaning up here would be complicated. */
AutoEnterOOMUnsafeRegion oomUnsafe;
ArgumentsObject* argsobj = ArgumentsObject::createExpected(cx, frame);

Просмотреть файл

@ -6291,7 +6291,7 @@ DebuggerFrame_getType(JSContext* cx, unsigned argc, Value* vp)
type = cx->names().eval;
else if (frame.isGlobalFrame())
type = cx->names().global;
else if (frame.isNonEvalFunctionFrame())
else if (frame.isFunctionFrame())
type = cx->names().call;
else if (frame.isModuleFrame())
type = cx->names().module;
@ -6343,7 +6343,7 @@ static bool
DebuggerFrame_getCallee(JSContext* cx, unsigned argc, Value* vp)
{
THIS_FRAME(cx, argc, vp, "get callee", args, thisobj, frame);
RootedValue calleev(cx, frame.isNonEvalFunctionFrame() ? frame.calleev() : NullValue());
RootedValue calleev(cx, frame.isFunctionFrame() ? frame.calleev() : NullValue());
if (!Debugger::fromChildJSObject(thisobj)->wrapDebuggeeValue(cx, &calleev))
return false;
args.rval().set(calleev);
@ -6362,7 +6362,7 @@ static bool
DebuggerFrame_getConstructing(JSContext* cx, unsigned argc, Value* vp)
{
THIS_FRAME_ITER(cx, argc, vp, "get constructing", args, thisobj, _, iter);
args.rval().setBoolean(iter.isNonEvalFunctionFrame() && iter.isConstructing());
args.rval().setBoolean(iter.isFunctionFrame() && iter.isConstructing());
return true;
}
@ -6532,7 +6532,7 @@ DebuggerFrame_getScript(JSContext* cx, unsigned argc, Value* vp)
Debugger* debug = Debugger::fromChildJSObject(thisobj);
RootedObject scriptObject(cx);
if (frame.isNonEvalFunctionFrame()) {
if (frame.isFunctionFrame()) {
RootedFunction callee(cx, frame.callee());
if (callee->isInterpreted()) {
RootedScript script(cx, callee->nonLazyScript());

Просмотреть файл

@ -138,7 +138,7 @@ js::BoxNonStrictThis(JSContext* cx, const CallReceiver& call)
bool
js::GetFunctionThis(JSContext* cx, AbstractFramePtr frame, MutableHandleValue res)
{
MOZ_ASSERT(frame.isNonEvalFunctionFrame());
MOZ_ASSERT(frame.isFunctionFrame());
MOZ_ASSERT(!frame.callee()->isArrow());
if (frame.thisArgument().isObject() ||
@ -3354,7 +3354,7 @@ CASE(JSOP_LAMBDA_ARROW)
END_CASE(JSOP_LAMBDA_ARROW)
CASE(JSOP_CALLEE)
MOZ_ASSERT(REGS.fp()->isNonEvalFunctionFrame());
MOZ_ASSERT(REGS.fp()->isFunctionFrame());
PUSH_COPY(REGS.fp()->calleev());
END_CASE(JSOP_CALLEE)
@ -3706,7 +3706,7 @@ END_CASE(JSOP_GENERATOR)
CASE(JSOP_INITIALYIELD)
{
MOZ_ASSERT(!cx->isExceptionPending());
MOZ_ASSERT(REGS.fp()->isNonEvalFunctionFrame());
MOZ_ASSERT(REGS.fp()->isFunctionFrame());
ReservedRooted<JSObject*> obj(&rootObject0, &REGS.sp[-1].toObject());
POP_RETURN_VALUE();
MOZ_ASSERT(REGS.stackDepth() == 0);
@ -3718,7 +3718,7 @@ CASE(JSOP_INITIALYIELD)
CASE(JSOP_YIELD)
{
MOZ_ASSERT(!cx->isExceptionPending());
MOZ_ASSERT(REGS.fp()->isNonEvalFunctionFrame());
MOZ_ASSERT(REGS.fp()->isFunctionFrame());
ReservedRooted<JSObject*> obj(&rootObject0, &REGS.sp[-1].toObject());
if (!GeneratorObject::normalSuspend(cx, obj, REGS.fp(), REGS.pc,
REGS.spForStackDepth(0), REGS.stackDepth() - 2))

Просмотреть файл

@ -1132,7 +1132,7 @@ SavedStacks::insertFrames(JSContext* cx, FrameIter& iter, MutableHandleSavedFram
if (maxFrameCount == 0)
parentIsInCache = iter.hasCachedSavedFrame();
auto displayAtom = iter.isNonEvalFunctionFrame() ? iter.functionDisplayAtom() : nullptr;
auto displayAtom = iter.isFunctionFrame() ? iter.functionDisplayAtom() : nullptr;
if (!stackChain->emplaceBack(location.source(),
location.line(),
location.column(),

Просмотреть файл

@ -251,7 +251,7 @@ CallObject::createForFunction(JSContext* cx, HandleObject enclosing, HandleFunct
CallObject*
CallObject::createForFunction(JSContext* cx, AbstractFramePtr frame)
{
MOZ_ASSERT(frame.isNonEvalFunctionFrame());
MOZ_ASSERT(frame.isFunctionFrame());
assertSameCompartment(cx, frame);
RootedObject scopeChain(cx, frame.scopeChain());
@ -1411,7 +1411,7 @@ ScopeIter::settle()
{
// Check for trying to iterate a function frame before the prologue has
// created the CallObject, in which case we have to skip.
if (frame_ && frame_.isNonEvalFunctionFrame() && frame_.callee()->needsCallObject() &&
if (frame_ && frame_.isFunctionFrame() && frame_.callee()->needsCallObject() &&
!frame_.hasCallObj())
{
MOZ_ASSERT(ssi_.type() == StaticScopeIter<CanGC>::Function);
@ -2722,7 +2722,7 @@ DebugScopes::updateLiveScopes(JSContext* cx)
if (frame.scopeChain()->compartment() != cx->compartment())
continue;
if (frame.isNonEvalFunctionFrame() && frame.callee()->isGenerator())
if (frame.isFunctionFrame() && frame.callee()->isGenerator())
continue;
if (!frame.isDebuggee())
@ -2907,7 +2907,7 @@ GetDebugScopeForMissing(JSContext* cx, const ScopeIter& si)
// For example, |let ({} = "") { yield evalInFrame("foo"); }|.
MOZ_ASSERT_IF(si.staticBlock().numVariables() > 0 &&
si.withinInitialFrame() &&
si.initialFrame().isNonEvalFunctionFrame(),
si.initialFrame().isFunctionFrame(),
!si.initialFrame().callee()->isGenerator());
Rooted<StaticBlockObject*> staticBlock(cx, &si.staticBlock());

Просмотреть файл

@ -633,7 +633,7 @@ intrinsic_ActiveFunction(JSContext* cx, unsigned argc, Value* vp)
MOZ_ASSERT(args.length() == 0);
ScriptFrameIter iter(cx);
MOZ_ASSERT(iter.isNonEvalFunctionFrame());
MOZ_ASSERT(iter.isFunctionFrame());
args.rval().setObject(*iter.callee(cx));
return true;
}

Просмотреть файл

@ -44,7 +44,7 @@ IsCacheableNonGlobalScope(JSObject* obj)
inline HandleObject
InterpreterFrame::scopeChain() const
{
MOZ_ASSERT_IF(!(flags_ & HAS_SCOPECHAIN), isNonEvalFunctionFrame());
MOZ_ASSERT_IF(!(flags_ & HAS_SCOPECHAIN), isFunctionFrame());
if (!(flags_ & HAS_SCOPECHAIN)) {
scopeChain_ = callee().environment();
flags_ |= HAS_SCOPECHAIN;
@ -82,7 +82,7 @@ InterpreterFrame::initCallFrame(JSContext* cx, InterpreterFrame* prev, jsbytecod
MOZ_ASSERT(callee.nonLazyScript() == script);
/* Initialize stack frame members. */
flags_ = FUNCTION | HAS_SCOPECHAIN | flagsArg;
flags_ = HAS_SCOPECHAIN | flagsArg;
argv_ = argv;
script_ = script;
nactual_ = nactual;
@ -662,7 +662,7 @@ AbstractFramePtr::unsetIsDebuggee()
inline bool
AbstractFramePtr::hasArgs() const {
return isNonEvalFunctionFrame();
return isFunctionFrame();
}
inline JSScript*
@ -696,13 +696,13 @@ AbstractFramePtr::calleev() const
}
inline bool
AbstractFramePtr::isNonEvalFunctionFrame() const
AbstractFramePtr::isFunctionFrame() const
{
if (isInterpreterFrame())
return asInterpreterFrame()->isNonEvalFunctionFrame();
return asInterpreterFrame()->isFunctionFrame();
if (isBaselineFrame())
return asBaselineFrame()->isNonEvalFunctionFrame();
return asRematerializedFrame()->isNonEvalFunctionFrame();
return asBaselineFrame()->isFunctionFrame();
return asRematerializedFrame()->isFunctionFrame();
}
inline bool

Просмотреть файл

@ -220,7 +220,7 @@ InterpreterFrame::prologue(JSContext* cx)
if (isModuleFrame())
return probes::EnterScript(cx, script, nullptr, this);
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
if (callee().needsCallObject() && !initFunctionScopeObjects(cx))
return false;
@ -274,7 +274,7 @@ InterpreterFrame::epilogue(JSContext* cx)
if (isModuleFrame())
return;
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
if (callee().needsCallObject()) {
MOZ_ASSERT_IF(hasCallObj() && !callee().isGenerator(),
@ -299,7 +299,7 @@ bool
InterpreterFrame::checkReturn(JSContext* cx, HandleValue thisv)
{
MOZ_ASSERT(script()->isDerivedClassConstructor());
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
MOZ_ASSERT(callee().isClassConstructor());
HandleValue retVal = returnValue();
@ -879,17 +879,17 @@ FrameIter::isEvalFrame() const
}
bool
FrameIter::isNonEvalFunctionFrame() const
FrameIter::isFunctionFrame() const
{
MOZ_ASSERT(!done());
switch (data_.state_) {
case DONE:
break;
case INTERP:
return interpFrame()->isNonEvalFunctionFrame();
return interpFrame()->isFunctionFrame();
case JIT:
if (data_.jitFrames_.isBaselineJS())
return data_.jitFrames_.baselineFrame()->isNonEvalFunctionFrame();
return data_.jitFrames_.baselineFrame()->isFunctionFrame();
return script()->functionNonDelazifying();
case WASM:
return true;
@ -900,7 +900,7 @@ FrameIter::isNonEvalFunctionFrame() const
JSAtom*
FrameIter::functionDisplayAtom() const
{
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
switch (data_.state_) {
case DONE:
@ -1106,7 +1106,7 @@ FrameIter::calleeTemplate() const
case WASM:
break;
case INTERP:
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
return &interpFrame()->callee();
case JIT:
if (data_.jitFrames_.isBaselineJS())
@ -1176,7 +1176,7 @@ FrameIter::numActualArgs() const
case WASM:
break;
case INTERP:
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
return interpFrame()->numActualArgs();
case JIT:
if (data_.jitFrames_.isIonScripted())
@ -1246,7 +1246,7 @@ FrameIter::argsObj() const
Value
FrameIter::thisArgument(JSContext* cx) const
{
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
switch (data_.state_) {
case DONE:
@ -1417,7 +1417,7 @@ ActivationEntryMonitor::ActivationEntryMonitor(JSContext* cx, InterpreterFrame*
if (entryMonitor_) {
RootedValue stack(cx, asyncStack(cx));
RootedString asyncCause(cx, cx->runtime()->asyncCauseForNewActivations);
if (entryFrame->isNonEvalFunctionFrame())
if (entryFrame->isFunctionFrame())
entryMonitor_->Entry(cx, &entryFrame->callee(), stack, asyncCause);
else
entryMonitor_->Entry(cx, entryFrame->script(), stack, asyncCause);

Просмотреть файл

@ -217,7 +217,7 @@ class AbstractFramePtr
inline Value newTarget() const;
inline bool isNonEvalFunctionFrame() const;
inline bool isFunctionFrame() const;
inline bool isNonStrictDirectEvalFrame() const;
inline bool isStrictEvalFrame() const;
@ -292,7 +292,7 @@ class InterpreterFrame
enum Flags : uint32_t {
/* Primary frame type */
GLOBAL_OR_MODULE = 0x1, /* frame pushed for a global script */
FUNCTION = 0x2, /* frame pushed for a scripted call */
/* (0x2 and 0x4 are unused) */
/* Frame subtypes */
EVAL = 0x8, /* frame pushed for eval() or debugger eval */
@ -491,8 +491,8 @@ class InterpreterFrame
return flags_ & EVAL;
}
bool isNonEvalFunctionFrame() const {
return (flags_ & (FUNCTION | EVAL)) == FUNCTION;
bool isFunctionFrame() const {
return script_->functionNonDelazifying();
}
inline bool isStrictEvalFrame() const {
@ -551,7 +551,7 @@ class InterpreterFrame
inline Value& unaliasedLocal(uint32_t i);
bool hasArgs() const { return isNonEvalFunctionFrame(); }
bool hasArgs() const { return isFunctionFrame(); }
inline Value& unaliasedFormal(unsigned i, MaybeCheckAliasing = CHECK_ALIASING);
inline Value& unaliasedActual(unsigned i, MaybeCheckAliasing = CHECK_ALIASING);
template <class Op> inline void unaliasedForEachActual(Op op);
@ -661,7 +661,7 @@ class InterpreterFrame
* return the original, unboxed Value.
*/
Value& thisArgument() const {
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
return argv()[-1];
}
@ -673,12 +673,12 @@ class InterpreterFrame
*/
JSFunction& callee() const {
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
return calleev().toObject().as<JSFunction>();
}
const Value& calleev() const {
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
return argv()[-2];
}
@ -693,7 +693,7 @@ class InterpreterFrame
if (isEvalFrame())
return ((Value*)this)[-2];
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
if (callee().isArrow())
return callee().getExtendedSlot(FunctionExtended::ARROW_NEWTARGET_SLOT);
@ -747,7 +747,7 @@ class InterpreterFrame
void resumeGeneratorFrame(JSObject* scopeChain) {
MOZ_ASSERT(script()->isGenerator());
MOZ_ASSERT(isNonEvalFunctionFrame());
MOZ_ASSERT(isFunctionFrame());
flags_ |= HAS_CALL_OBJ | HAS_SCOPECHAIN;
scopeChain_ = scopeChain;
}
@ -1843,8 +1843,8 @@ class FrameIter
bool isGlobalOrModuleFrame() const;
bool isEvalFrame() const;
bool isNonEvalFunctionFrame() const;
bool hasArgs() const { return isNonEvalFunctionFrame(); }
bool isFunctionFrame() const;
bool hasArgs() const { return isFunctionFrame(); }
// These two methods may not be called with asm frames.
inline bool hasCachedSavedFrame() const;
@ -1878,7 +1878,7 @@ class FrameIter
JSFunction* callee(JSContext* cx) const;
JSFunction* maybeCallee(JSContext* cx) const {
return isNonEvalFunctionFrame() ? callee(cx) : nullptr;
return isFunctionFrame() ? callee(cx) : nullptr;
}
bool matchCallee(JSContext* cx, HandleFunction fun) const;