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); return use(mir);
} }
LAllocation
LIRGeneratorShared::useOrConstantAtStart(MDefinition *mir)
{
if (mir->isConstant())
return LAllocation(mir->toConstant()->vp());
return useAtStart(mir);
}
LAllocation LAllocation
LIRGeneratorShared::useRegisterOrConstant(MDefinition *mir) LIRGeneratorShared::useRegisterOrConstant(MDefinition *mir)
{ {

View File

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

View File

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