Bug 1005113 - IonMonkey: Mark more LUses as AtStart on x86/x64. r=bhackett

This commit is contained in:
Dan Gohman 2014-05-29 20:20:52 -07:00
parent 776174b8c0
commit 9a3e13ac21
3 changed files with 15 additions and 6 deletions

View File

@ -292,6 +292,14 @@ LIRGeneratorShared::useOrConstant(MDefinition *mir)
return use(mir);
}
LAllocation
LIRGeneratorShared::useOrConstantAtStart(MDefinition *mir)
{
if (mir->isConstant())
return LAllocation(mir->toConstant()->vp());
return useAtStart(mir);
}
LAllocation
LIRGeneratorShared::useRegisterOrConstant(MDefinition *mir)
{

View File

@ -76,6 +76,7 @@ class LIRGeneratorShared : public MInstructionVisitorWithDefaults
inline LUse useFixed(MDefinition *mir, AnyRegister reg);
inline LUse useFixedAtStart(MDefinition *mir, Register reg);
inline LAllocation useOrConstant(MDefinition *mir);
inline LAllocation useOrConstantAtStart(MDefinition *mir);
// "Any" is architecture dependent, and will include registers and stack slots on X86,
// and only registers on ARM.
inline LAllocation useAny(MDefinition *mir);

View File

@ -36,7 +36,7 @@ LIRGeneratorX86Shared::visitGuardShape(MGuardShape *ins)
{
JS_ASSERT(ins->obj()->type() == MIRType_Object);
LGuardShape *guard = new(alloc()) LGuardShape(useRegister(ins->obj()));
LGuardShape *guard = new(alloc()) LGuardShape(useRegisterAtStart(ins->obj()));
if (!assignSnapshot(guard, ins->bailoutKind()))
return false;
if (!add(guard, ins))
@ -49,7 +49,7 @@ LIRGeneratorX86Shared::visitGuardObjectType(MGuardObjectType *ins)
{
JS_ASSERT(ins->obj()->type() == MIRType_Object);
LGuardObjectType *guard = new(alloc()) LGuardObjectType(useRegister(ins->obj()));
LGuardObjectType *guard = new(alloc()) LGuardObjectType(useRegisterAtStart(ins->obj()));
if (!assignSnapshot(guard))
return false;
if (!add(guard, ins))
@ -75,9 +75,9 @@ LIRGeneratorX86Shared::lowerForShift(LInstructionHelper<1, 2, 0> *ins, MDefiniti
// shift operator should be constant or in register ecx
// x86 can't shift a non-ecx register
if (rhs->isConstant())
ins->setOperand(1, useOrConstant(rhs));
ins->setOperand(1, useOrConstantAtStart(rhs));
else
ins->setOperand(1, useFixed(rhs, ecx));
ins->setOperand(1, lhs != rhs ? useFixed(rhs, ecx) : useFixedAtStart(rhs, ecx));
return defineReuseInput(ins, mir, 0);
}
@ -95,7 +95,7 @@ LIRGeneratorX86Shared::lowerForALU(LInstructionHelper<1, 2, 0> *ins, MDefinition
MDefinition *lhs, MDefinition *rhs)
{
ins->setOperand(0, useRegisterAtStart(lhs));
ins->setOperand(1, useOrConstant(rhs));
ins->setOperand(1, lhs != rhs ? useOrConstant(rhs) : useOrConstantAtStart(rhs));
return defineReuseInput(ins, mir, 0);
}
@ -103,7 +103,7 @@ bool
LIRGeneratorX86Shared::lowerForFPU(LInstructionHelper<1, 2, 0> *ins, MDefinition *mir, MDefinition *lhs, MDefinition *rhs)
{
ins->setOperand(0, useRegisterAtStart(lhs));
ins->setOperand(1, use(rhs));
ins->setOperand(1, lhs != rhs ? use(rhs) : useAtStart(rhs));
return defineReuseInput(ins, mir, 0);
}