Bug 983709 part 1 - Don't mark shift instructions as commutative. r=h4writer

This commit is contained in:
Jan de Mooij 2014-03-21 15:48:27 +01:00
Родитель ec4e90fb7e
Коммит a359e5e7c8
2 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -1258,20 +1258,20 @@ MBinaryBitwiseInstruction::foldUnnecessaryBitop()
void
MBinaryBitwiseInstruction::infer(BaselineInspector *, jsbytecode *)
{
if (getOperand(0)->mightBeType(MIRType_Object) || getOperand(1)->mightBeType(MIRType_Object)) {
if (getOperand(0)->mightBeType(MIRType_Object) || getOperand(1)->mightBeType(MIRType_Object))
specialization_ = MIRType_None;
} else {
specialization_ = MIRType_Int32;
setCommutative();
}
else
specializeAsInt32();
}
void
MBinaryBitwiseInstruction::specializeForAsmJS()
MBinaryBitwiseInstruction::specializeAsInt32()
{
specialization_ = MIRType_Int32;
JS_ASSERT(type() == MIRType_Int32);
setCommutative();
if (isBitOr() || isBitAnd() || isBitXor())
setCommutative();
}
void
@ -2155,7 +2155,7 @@ MBitAnd *
MBitAnd::NewAsmJS(TempAllocator &alloc, MDefinition *left, MDefinition *right)
{
MBitAnd *ins = new(alloc) MBitAnd(left, right);
ins->specializeForAsmJS();
ins->specializeAsInt32();
return ins;
}
@ -2169,7 +2169,7 @@ MBitOr *
MBitOr::NewAsmJS(TempAllocator &alloc, MDefinition *left, MDefinition *right)
{
MBitOr *ins = new(alloc) MBitOr(left, right);
ins->specializeForAsmJS();
ins->specializeAsInt32();
return ins;
}
@ -2183,7 +2183,7 @@ MBitXor *
MBitXor::NewAsmJS(TempAllocator &alloc, MDefinition *left, MDefinition *right)
{
MBitXor *ins = new(alloc) MBitXor(left, right);
ins->specializeForAsmJS();
ins->specializeAsInt32();
return ins;
}
@ -2197,7 +2197,7 @@ MLsh *
MLsh::NewAsmJS(TempAllocator &alloc, MDefinition *left, MDefinition *right)
{
MLsh *ins = new(alloc) MLsh(left, right);
ins->specializeForAsmJS();
ins->specializeAsInt32();
return ins;
}
@ -2211,7 +2211,7 @@ MRsh *
MRsh::NewAsmJS(TempAllocator &alloc, MDefinition *left, MDefinition *right)
{
MRsh *ins = new(alloc) MRsh(left, right);
ins->specializeForAsmJS();
ins->specializeAsInt32();
return ins;
}
@ -2225,7 +2225,7 @@ MUrsh *
MUrsh::NewAsmJS(TempAllocator &alloc, MDefinition *left, MDefinition *right)
{
MUrsh *ins = new(alloc) MUrsh(left, right);
ins->specializeForAsmJS();
ins->specializeAsInt32();
// Since Ion has no UInt32 type, we use Int32 and we have a special
// exception to the type rules: we can return values in

Просмотреть файл

@ -3271,7 +3271,7 @@ class MBinaryBitwiseInstruction
setMovable();
}
void specializeForAsmJS();
void specializeAsInt32();
public:
TypePolicy *typePolicy() {