Bug 1107937 - Followup: bring RematerializedFrame::hasCallObj implementation in line with Interpreter and BaselineFrame's. (r=jandem)

This commit is contained in:
Shu-yu Guo 2014-12-15 18:21:09 -08:00
Родитель 4c99f79150
Коммит a960719926
4 изменённых файлов: 17 добавлений и 10 удалений

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

@ -587,7 +587,7 @@ class InlineFrameIterator
private:
void findNextFrame();
JSObject *computeScopeChain(Value scopeChainValue) const;
JSObject *computeScopeChain(Value scopeChainValue, bool *hasCallObj = nullptr) const;
public:
InlineFrameIterator(ThreadSafeContext *cx, const JitFrameIterator *iter);
@ -619,7 +619,7 @@ class InlineFrameIterator
template <class ArgOp, class LocalOp>
void readFrameArgsAndLocals(ThreadSafeContext *cx, ArgOp &argOp, LocalOp &localOp,
JSObject **scopeChain, Value *rval,
JSObject **scopeChain, bool *hasCallObj, Value *rval,
ArgumentsObject **argsObj, Value *thisv,
ReadFrameArgsBehavior behavior,
MaybeReadFallback &fallback) const
@ -631,7 +631,7 @@ class InlineFrameIterator
s.readCommonFrameSlots(&scopeChainValue, rval);
if (scopeChain)
*scopeChain = computeScopeChain(scopeChainValue);
*scopeChain = computeScopeChain(scopeChainValue, hasCallObj);
// Read arguments, which only function frames have.
if (isFunctionFrame()) {
@ -700,7 +700,8 @@ class InlineFrameIterator
MaybeReadFallback &fallback) const
{
Nop nop;
readFrameArgsAndLocals(cx, op, nop, nullptr, nullptr, nullptr, nullptr, behavior, fallback);
readFrameArgsAndLocals(cx, op, nop, nullptr, nullptr, nullptr,
nullptr, nullptr, behavior, fallback);
}
JSScript *script() const {

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

@ -2345,10 +2345,13 @@ InlineFrameIterator::findNextFrame()
}
JSObject *
InlineFrameIterator::computeScopeChain(Value scopeChainValue) const
InlineFrameIterator::computeScopeChain(Value scopeChainValue, bool *hasCallObj) const
{
if (scopeChainValue.isObject())
if (scopeChainValue.isObject()) {
if (hasCallObj)
*hasCallObj = isFunctionFrame() && callee()->isHeavyweight();
return &scopeChainValue.toObject();
}
// Note we can hit this case even for heavyweight functions, in case we
// are walking the frame during the function prologue, before the scope

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

@ -40,7 +40,7 @@ RematerializedFrame::RematerializedFrame(JSContext *cx, uint8_t *top, unsigned n
{
CopyValueToRematerializedFrame op(slots_);
MaybeReadFallback fallback(MagicValue(JS_OPTIMIZED_OUT));
iter.readFrameArgsAndLocals(cx, op, op, &scopeChain_, &returnValue_,
iter.readFrameArgsAndLocals(cx, op, op, &scopeChain_, &hasCallObj_, &returnValue_,
&argsObj_, &thisValue_, ReadFrame_Actuals,
fallback);
}
@ -139,6 +139,7 @@ RematerializedFrame::initFunctionScopeObjects(JSContext *cx)
if (!callobj)
return false;
pushOnScopeChain(*callobj);
hasCallObj_ = true;
return true;
}

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

@ -29,6 +29,9 @@ class RematerializedFrame
// Propagated to the Baseline frame once this is popped.
bool isDebuggee_;
// Has a call object been pushed?
bool hasCallObj_;
// The fp of the top frame associated with this possibly inlined frame.
uint8_t *top_;
@ -107,9 +110,8 @@ class RematerializedFrame
bool initFunctionScopeObjects(JSContext *cx);
bool hasCallObj() const {
return maybeFun() &&
fun()->isHeavyweight() &&
scopeChain()->is<CallObject>();
MOZ_ASSERT(fun()->isHeavyweight());
return hasCallObj_;
}
CallObject &callObj() const;