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

This commit is contained in:
Dan Gohman 2014-05-28 20:12:06 -07:00
parent ebe975d874
commit 143a8064bc
3 changed files with 17 additions and 8 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);
}
@ -293,7 +293,7 @@ LIRGeneratorX86Shared::lowerTruncateDToInt32(MTruncateToInt32 *ins)
JS_ASSERT(opd->type() == MIRType_Double);
LDefinition maybeTemp = Assembler::HasSSE3() ? LDefinition::BogusTemp() : tempDouble();
return define(new(alloc()) LTruncateDToInt32(useRegister(opd), maybeTemp), ins);
return define(new(alloc()) LTruncateDToInt32(useRegisterAtStart(opd), maybeTemp), ins);
}
bool
@ -303,7 +303,7 @@ LIRGeneratorX86Shared::lowerTruncateFToInt32(MTruncateToInt32 *ins)
JS_ASSERT(opd->type() == MIRType_Float32);
LDefinition maybeTemp = Assembler::HasSSE3() ? LDefinition::BogusTemp() : tempFloat32();
return define(new(alloc()) LTruncateFToInt32(useRegister(opd), maybeTemp), ins);
return define(new(alloc()) LTruncateFToInt32(useRegisterAtStart(opd), maybeTemp), ins);
}
bool