Bug 1073033 part 2.2 - Update callee uses, extract information form the calleeTemplate. r=shu

This commit is contained in:
Nicolas B. Pierron 2014-12-19 15:28:29 +01:00
Родитель f2bcdf6014
Коммит 43cb54f723
6 изменённых файлов: 16 добавлений и 15 удалений

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

@ -669,7 +669,7 @@ class InlineFrameIterator
// Read arguments, which only function frames have.
if (isFunctionFrame()) {
unsigned nactual = numActualArgs();
unsigned nformal = callee()->nargs();
unsigned nformal = calleeTemplate()->nargs();
// Get the non overflown arguments, which are taken from the inlined
// frame, because it will have the updated value when JSOP_SETARG is

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

@ -395,7 +395,7 @@ CloseLiveIterator(JSContext *cx, const InlineFrameIterator &frame, uint32_t loca
SnapshotIterator si = frame.snapshotIterator();
// Skip stack slots until we reach the iterator object.
uint32_t base = CountArgSlots(frame.script(), frame.maybeCallee()) + frame.script()->nfixed();
uint32_t base = CountArgSlots(frame.script(), frame.maybeCalleeTemplate()) + frame.script()->nfixed();
uint32_t skipSlots = base + localSlot - 1;
for (unsigned i = 0; i < skipSlots; i++)
@ -2560,6 +2560,8 @@ JitFrameIterator::dumpBaseline() const
void
InlineFrameIterator::dump() const
{
MaybeReadFallback fallback(UndefinedValue());
if (more())
fprintf(stderr, " JS frame (inlined)\n");
else
@ -2570,7 +2572,7 @@ InlineFrameIterator::dump() const
isFunction = true;
fprintf(stderr, " callee fun: ");
#ifdef DEBUG
js_DumpObject(callee());
js_DumpObject(callee(fallback));
#else
fprintf(stderr, "?\n");
#endif
@ -2589,7 +2591,6 @@ InlineFrameIterator::dump() const
}
SnapshotIterator si = snapshotIterator();
MaybeReadFallback fallback(UndefinedValue());
fprintf(stderr, " slots: %u\n", si.numAllocations() - 1);
for (unsigned i = 0; i < si.numAllocations() - 1; i++) {
if (isFunction) {
@ -2597,15 +2598,15 @@ InlineFrameIterator::dump() const
fprintf(stderr, " scope chain: ");
else if (i == 1)
fprintf(stderr, " this: ");
else if (i - 2 < callee()->nargs())
else if (i - 2 < calleeTemplate()->nargs())
fprintf(stderr, " formal (arg %d): ", i - 2);
else {
if (i - 2 == callee()->nargs() && numActualArgs() > callee()->nargs()) {
DumpOp d(callee()->nargs());
if (i - 2 == calleeTemplate()->nargs() && numActualArgs() > calleeTemplate()->nargs()) {
DumpOp d(calleeTemplate()->nargs());
unaliasedForEachActual(GetJSContextFromJitCode(), d, ReadFrame_Overflown, fallback);
}
fprintf(stderr, " slot %d: ", int(i - 2 - callee()->nargs()));
fprintf(stderr, " slot %d: ", int(i - 2 - calleeTemplate()->nargs()));
}
} else
fprintf(stderr, " slot %u: ", i);

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

@ -48,7 +48,7 @@ RematerializedFrame::RematerializedFrame(JSContext *cx, uint8_t *top, unsigned n
/* static */ RematerializedFrame *
RematerializedFrame::New(JSContext *cx, uint8_t *top, InlineFrameIterator &iter)
{
unsigned numFormals = iter.isFunctionFrame() ? iter.callee()->nargs() : 0;
unsigned numFormals = iter.isFunctionFrame() ? iter.calleeTemplate()->nargs() : 0;
unsigned argSlots = Max(numFormals, iter.numActualArgs());
size_t numBytes = sizeof(RematerializedFrame) +
(argSlots + iter.script()->nfixed()) * sizeof(Value) -

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

@ -1809,7 +1809,7 @@ DecompileExpressionFromStack(JSContext *cx, int spindex, int skipStackHits, Hand
AutoCompartment ac(cx, &script->global());
jsbytecode *valuepc = frameIter.pc();
RootedFunction fun(cx, frameIter.isFunctionFrame()
? frameIter.callee()
? frameIter.calleeTemplate()
: nullptr);
MOZ_ASSERT(script->containsPC(valuepc));
@ -1889,8 +1889,8 @@ DecompileArgumentFromStack(JSContext *cx, int formalIndex, char **res)
AutoCompartment ac(cx, &script->global());
jsbytecode *current = frameIter.pc();
RootedFunction fun(cx, frameIter.isFunctionFrame()
? frameIter.callee()
: nullptr);
? frameIter.calleeTemplate()
: nullptr);
MOZ_ASSERT(script->containsPC(current));

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

@ -133,7 +133,7 @@ struct CopyScriptFrameIterArgs
/* Define formals which are not part of the actuals. */
unsigned numActuals = iter_.numActualArgs();
unsigned numFormals = iter_.callee()->nargs();
unsigned numFormals = iter_.calleeTemplate()->nargs();
MOZ_ASSERT(numActuals <= totalArgs);
MOZ_ASSERT(numFormals <= totalArgs);
MOZ_ASSERT(Max(numActuals, numFormals) == totalArgs);

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

@ -864,7 +864,7 @@ FrameIter::functionDisplayAtom() const
break;
case INTERP:
case JIT:
return callee()->displayAtom();
return calleeTemplate()->displayAtom();
case ASMJS:
return data_.asmJSFrames_.functionDisplayAtom();
}
@ -1186,7 +1186,7 @@ FrameIter::scopeChain(JSContext *cx) const
CallObject &
FrameIter::callObj(JSContext *cx) const
{
MOZ_ASSERT(callee()->isHeavyweight());
MOZ_ASSERT(calleeTemplate()->isHeavyweight());
JSObject *pobj = scopeChain(cx);
while (!pobj->is<CallObject>())