Bug 1042729 part 1 - Make resume point unique to each instruction. r=h4writer

This commit is contained in:
Nicolas B. Pierron 2014-08-21 20:47:03 +02:00
parent 933391c696
commit 3b1642e097
4 changed files with 27 additions and 8 deletions

View File

@ -703,7 +703,7 @@ IonBuilder::build()
// register/stack pressure.
MCheckOverRecursed *check = MCheckOverRecursed::New(alloc());
current->add(check);
check->setResumePoint(current->entryResumePoint());
check->setResumePoint(MResumePoint::Copy(alloc(), current->entryResumePoint()));
// Parameters have been checked to correspond to the typeset, now we unbox
// what we can in an infallible manner.
@ -738,7 +738,7 @@ IonBuilder::build()
for (uint32_t i = 0; i < info().endArgSlot(); i++) {
MInstruction *ins = current->getEntrySlot(i)->toInstruction();
if (ins->type() == MIRType_Value)
ins->setResumePoint(current->entryResumePoint());
ins->setResumePoint(MResumePoint::Copy(alloc(), current->entryResumePoint()));
}
// lazyArguments should never be accessed in |argsObjAliasesFormals| scripts.

View File

@ -2384,6 +2384,20 @@ MResumePoint::New(TempAllocator &alloc, MBasicBlock *block, jsbytecode *pc, MRes
return resume;
}
MResumePoint *
MResumePoint::Copy(TempAllocator &alloc, MResumePoint *src)
{
MResumePoint *resume = new(alloc) MResumePoint(src->block(), src->pc(),
src->caller(), src->mode());
// Copy the operands from the original resume point, and not from the
// current block stack.
if (!resume->operands_.init(alloc, src->stackDepth()))
return nullptr;
for (size_t i = 0; i < resume->stackDepth(); i++)
resume->initOperand(i, src->getOperand(i));
return resume;
}
MResumePoint::MResumePoint(MBasicBlock *block, jsbytecode *pc, MResumePoint *caller,
Mode mode)
: MNode(block),

View File

@ -10823,6 +10823,7 @@ class MResumePoint MOZ_FINAL : public MNode, public InlineForwardListNode<MResum
static MResumePoint *New(TempAllocator &alloc, MBasicBlock *block, jsbytecode *pc,
MResumePoint *parent, Mode mode,
const MDefinitionVector &operands);
static MResumePoint *Copy(TempAllocator &alloc, MResumePoint *src);
MNode::Kind kind() const {
return MNode::ResumePoint;

View File

@ -540,17 +540,18 @@ MBasicBlock::linkOsrValues(MStart *start)
for (uint32_t i = 0; i < stackDepth(); i++) {
MDefinition *def = slots_[i];
MInstruction *cloneRp = nullptr;
if (i == info().scopeChainSlot()) {
if (def->isOsrScopeChain())
def->toOsrScopeChain()->setResumePoint(res);
cloneRp = def->toOsrScopeChain();
} else if (i == info().returnValueSlot()) {
if (def->isOsrReturnValue())
def->toOsrReturnValue()->setResumePoint(res);
cloneRp = def->toOsrReturnValue();
} else if (info().hasArguments() && i == info().argsObjSlot()) {
JS_ASSERT(def->isConstant() || def->isOsrArgumentsObject());
JS_ASSERT_IF(def->isConstant(), def->toConstant()->value() == UndefinedValue());
if (def->isOsrArgumentsObject())
def->toOsrArgumentsObject()->setResumePoint(res);
cloneRp = def->toOsrArgumentsObject();
} else {
JS_ASSERT(def->isOsrValue() || def->isGetArgumentsObjectArg() || def->isConstant() ||
def->isParameter());
@ -560,12 +561,15 @@ MBasicBlock::linkOsrValues(MStart *start)
JS_ASSERT_IF(def->isConstant(), def->toConstant()->value() == UndefinedValue());
if (def->isOsrValue())
def->toOsrValue()->setResumePoint(res);
cloneRp = def->toOsrValue();
else if (def->isGetArgumentsObjectArg())
def->toGetArgumentsObjectArg()->setResumePoint(res);
cloneRp = def->toGetArgumentsObjectArg();
else if (def->isParameter())
def->toParameter()->setResumePoint(res);
cloneRp = def->toParameter();
}
if (cloneRp)
cloneRp->setResumePoint(MResumePoint::Copy(graph().alloc(), res));
}
}