Bug 904079 - Snapshots should not have emitted-at-uses operands. r=bhackett

--HG--
extra : rebase_source : 501011273e1276d1a178f79e4fcccbe97dd38f21
This commit is contained in:
Jan de Mooij 2013-08-13 17:11:41 +02:00
parent d8ab2d1b45
commit 89063cafd5
4 changed files with 39 additions and 6 deletions

View File

@ -0,0 +1,8 @@
function x() {
try {
do {
var { q , gen } = t;
} while(false);
} catch (e) {}
}
x();

View File

@ -988,15 +988,19 @@ CanEmitBitAndAtUses(MInstruction *ins)
if (ins->getOperand(0)->type() != MIRType_Int32 || ins->getOperand(1)->type() != MIRType_Int32)
return false;
MUseDefIterator iter(ins);
if (!iter)
MUseIterator iter(ins->usesBegin());
if (iter == ins->usesEnd())
return false;
if (!iter.def()->isTest())
MNode *node = iter->consumer();
if (!node->isDefinition())
return false;
if (!node->toDefinition()->isTest())
return false;
iter++;
return !iter;
return iter == ins->usesEnd();
}
bool

View File

@ -143,6 +143,9 @@ CodeGeneratorShared::encodeSlots(LSnapshot *snapshot, MResumePoint *resumePoint,
mir = mir->toPassArg()->getArgument();
JS_ASSERT(!mir->isPassArg());
if (mir->isBox())
mir = mir->toBox()->getOperand(0);
MIRType type = mir->isUnused()
? MIRType_Undefined
: mir->type();

View File

@ -82,9 +82,17 @@ LIRGeneratorShared::buildSnapshot(LInstruction *ins, MResumePoint *rp, BailoutKi
ins = ins->toPassArg()->getArgument();
JS_ASSERT(!ins->isPassArg());
if (ins->isBox())
ins = ins->toBox()->getOperand(0);
// Guards should never be eliminated.
JS_ASSERT_IF(ins->isUnused(), !ins->isGuard());
// Snapshot operands other than constants should never be
// emitted-at-uses. Try-catch support depends on there being no
// code between an instruction and the LOsiPoint that follows it.
JS_ASSERT_IF(!ins->isConstant(), !ins->isEmittedAtUses());
// The register allocation will fill these fields in with actual
// register/stack assignments. During code generation, we can restore
// interpreter state with the given information. Note that for
@ -97,8 +105,6 @@ LIRGeneratorShared::buildSnapshot(LInstruction *ins, MResumePoint *rp, BailoutKi
*type = LConstantIndex::Bogus();
*payload = use(ins, LUse::KEEPALIVE);
} else {
if (!ensureDefined(ins))
return NULL;
*type = useType(ins, LUse::KEEPALIVE);
*payload = usePayload(ins, LUse::KEEPALIVE);
}
@ -129,6 +135,18 @@ LIRGeneratorShared::buildSnapshot(LInstruction *ins, MResumePoint *rp, BailoutKi
if (def->isPassArg())
def = def->toPassArg()->getArgument();
JS_ASSERT(!def->isPassArg());
if (def->isBox())
def = def->toBox()->getOperand(0);
// Guards should never be eliminated.
JS_ASSERT_IF(def->isUnused(), !def->isGuard());
// Snapshot operands other than constants should never be
// emitted-at-uses. Try-catch support depends on there being no
// code between an instruction and the LOsiPoint that follows it.
JS_ASSERT_IF(!def->isConstant(), !def->isEmittedAtUses());
LAllocation *a = snapshot->getEntry(i);