зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1176288 - Part 3: Rename CompareV to CompareBitwise, r=jandem
This commit is contained in:
Родитель
b2276425b6
Коммит
ff1dba82cc
|
@ -6832,7 +6832,7 @@ IonBuilder::compareTryBitwise(bool* emitted, JSOp op, MDefinition* left, MDefini
|
|||
}
|
||||
|
||||
MCompare* ins = MCompare::New(alloc(), left, right, op);
|
||||
ins->setCompareType(MCompare::Compare_Value);
|
||||
ins->setCompareType(MCompare::Compare_Bitwise);
|
||||
ins->cacheOperandMightEmulateUndefined(constraints());
|
||||
|
||||
current->add(ins);
|
||||
|
|
|
@ -799,10 +799,11 @@ LIRGenerator::visitTest(MTest* test)
|
|||
}
|
||||
|
||||
// Compare values.
|
||||
if (comp->compareType() == MCompare::Compare_Value) {
|
||||
LCompareVAndBranch* lir = new(alloc()) LCompareVAndBranch(comp, ifTrue, ifFalse);
|
||||
useBoxAtStart(lir, LCompareVAndBranch::LhsInput, left);
|
||||
useBoxAtStart(lir, LCompareVAndBranch::RhsInput, right);
|
||||
if (comp->compareType() == MCompare::Compare_Bitwise) {
|
||||
LCompareBitwiseAndBranch* lir =
|
||||
new(alloc()) LCompareBitwiseAndBranch(comp, ifTrue, ifFalse);
|
||||
useBoxAtStart(lir, LCompareBitwiseAndBranch::LhsInput, left);
|
||||
useBoxAtStart(lir, LCompareBitwiseAndBranch::RhsInput, right);
|
||||
add(lir, test);
|
||||
return;
|
||||
}
|
||||
|
@ -1023,10 +1024,10 @@ LIRGenerator::visitCompare(MCompare* comp)
|
|||
}
|
||||
|
||||
// Compare values.
|
||||
if (comp->compareType() == MCompare::Compare_Value) {
|
||||
LCompareV* lir = new(alloc()) LCompareV();
|
||||
useBoxAtStart(lir, LCompareV::LhsInput, left);
|
||||
useBoxAtStart(lir, LCompareV::RhsInput, right);
|
||||
if (comp->compareType() == MCompare::Compare_Bitwise) {
|
||||
LCompareBitwise* lir = new(alloc()) LCompareBitwise();
|
||||
useBoxAtStart(lir, LCompareBitwise::LhsInput, left);
|
||||
useBoxAtStart(lir, LCompareBitwise::RhsInput, right);
|
||||
define(lir, comp);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -2730,7 +2730,7 @@ MCompare::inputType()
|
|||
case Compare_Object:
|
||||
return MIRType_Object;
|
||||
case Compare_Unknown:
|
||||
case Compare_Value:
|
||||
case Compare_Bitwise:
|
||||
return MIRType_Value;
|
||||
default:
|
||||
MOZ_CRASH("No known conversion");
|
||||
|
@ -3377,7 +3377,7 @@ MCompare::tryFoldEqualOperands(bool* result)
|
|||
compareType_ == Compare_Double || compareType_ == Compare_DoubleMaybeCoerceLHS ||
|
||||
compareType_ == Compare_DoubleMaybeCoerceRHS || compareType_ == Compare_Float32 ||
|
||||
compareType_ == Compare_String || compareType_ == Compare_StrictString ||
|
||||
compareType_ == Compare_Object || compareType_ == Compare_Value);
|
||||
compareType_ == Compare_Object || compareType_ == Compare_Bitwise);
|
||||
|
||||
if (isDoubleComparison() || isFloat32Comparison()) {
|
||||
if (!operandsAreNeverNaN())
|
||||
|
|
|
@ -4170,7 +4170,7 @@ class MCompare
|
|||
Compare_Object,
|
||||
|
||||
// Compare 2 values bitwise
|
||||
Compare_Value,
|
||||
Compare_Bitwise,
|
||||
|
||||
// All other possible compares
|
||||
Compare_Unknown
|
||||
|
@ -4256,7 +4256,7 @@ class MCompare
|
|||
return AliasSet::None();
|
||||
if (compareType_ == Compare_Unknown)
|
||||
return AliasSet::Store(AliasSet::Any);
|
||||
MOZ_ASSERT(compareType_ <= Compare_Value);
|
||||
MOZ_ASSERT(compareType_ <= Compare_Bitwise);
|
||||
return AliasSet::None();
|
||||
}
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ RangeAnalysis::addBetaNodes()
|
|||
MCompare* compare = test->getOperand(0)->toCompare();
|
||||
|
||||
if (compare->compareType() == MCompare::Compare_Unknown ||
|
||||
compare->compareType() == MCompare::Compare_Value)
|
||||
compare->compareType() == MCompare::Compare_Bitwise)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ ComparePolicy::adjustInputs(TempAllocator& alloc, MInstruction* def)
|
|||
|
||||
// Box inputs to get value
|
||||
if (compare->compareType() == MCompare::Compare_Unknown ||
|
||||
compare->compareType() == MCompare::Compare_Value)
|
||||
compare->compareType() == MCompare::Compare_Bitwise)
|
||||
{
|
||||
return BoxInputsPolicy::staticAdjustInputs(alloc, def);
|
||||
}
|
||||
|
|
|
@ -1483,12 +1483,12 @@ CodeGeneratorARM::visitCompareBAndBranch(LCompareBAndBranch* lir)
|
|||
}
|
||||
|
||||
void
|
||||
CodeGeneratorARM::visitCompareV(LCompareV* lir)
|
||||
CodeGeneratorARM::visitCompareBitwise(LCompareBitwise* lir)
|
||||
{
|
||||
MCompare* mir = lir->mir();
|
||||
Assembler::Condition cond = JSOpToCondition(mir->compareType(), mir->jsop());
|
||||
const ValueOperand lhs = ToValue(lir, LCompareV::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareV::RhsInput);
|
||||
const ValueOperand lhs = ToValue(lir, LCompareBitwise::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwise::RhsInput);
|
||||
const Register output = ToRegister(lir->output());
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
|
||||
|
@ -1511,12 +1511,12 @@ CodeGeneratorARM::visitCompareV(LCompareV* lir)
|
|||
}
|
||||
|
||||
void
|
||||
CodeGeneratorARM::visitCompareVAndBranch(LCompareVAndBranch* lir)
|
||||
CodeGeneratorARM::visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir)
|
||||
{
|
||||
MCompare* mir = lir->cmpMir();
|
||||
Assembler::Condition cond = JSOpToCondition(mir->compareType(), mir->jsop());
|
||||
const ValueOperand lhs = ToValue(lir, LCompareVAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareVAndBranch::RhsInput);
|
||||
const ValueOperand lhs = ToValue(lir, LCompareBitwiseAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwiseAndBranch::RhsInput);
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
|
||||
mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE);
|
||||
|
|
|
@ -135,8 +135,8 @@ class CodeGeneratorARM : public CodeGeneratorShared
|
|||
virtual void visitCompareFAndBranch(LCompareFAndBranch* comp);
|
||||
virtual void visitCompareB(LCompareB* lir);
|
||||
virtual void visitCompareBAndBranch(LCompareBAndBranch* lir);
|
||||
virtual void visitCompareV(LCompareV* lir);
|
||||
virtual void visitCompareVAndBranch(LCompareVAndBranch* lir);
|
||||
virtual void visitCompareBitwise(LCompareBitwise* lir);
|
||||
virtual void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir);
|
||||
virtual void visitBitAndAndBranch(LBitAndAndBranch* baab);
|
||||
virtual void visitAsmJSUInt32ToDouble(LAsmJSUInt32ToDouble* lir);
|
||||
virtual void visitAsmJSUInt32ToFloat32(LAsmJSUInt32ToFloat32* lir);
|
||||
|
|
|
@ -494,15 +494,15 @@ CodeGeneratorARM64::visitCompareBAndBranch(LCompareBAndBranch* lir)
|
|||
}
|
||||
|
||||
void
|
||||
CodeGeneratorARM64::visitCompareV(LCompareV* lir)
|
||||
CodeGeneratorARM64::visitCompareBitwise(LCompareBitwise* lir)
|
||||
{
|
||||
MOZ_CRASH("visitCompareV");
|
||||
MOZ_CRASH("visitCompareBitwise");
|
||||
}
|
||||
|
||||
void
|
||||
CodeGeneratorARM64::visitCompareVAndBranch(LCompareVAndBranch* lir)
|
||||
CodeGeneratorARM64::visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir)
|
||||
{
|
||||
MOZ_CRASH("visitCompareVAndBranch");
|
||||
MOZ_CRASH("visitCompareBitwiseAndBranch");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -142,8 +142,8 @@ class CodeGeneratorARM64 : public CodeGeneratorShared
|
|||
virtual void visitCompareFAndBranch(LCompareFAndBranch* comp);
|
||||
virtual void visitCompareB(LCompareB* lir);
|
||||
virtual void visitCompareBAndBranch(LCompareBAndBranch* lir);
|
||||
virtual void visitCompareV(LCompareV* lir);
|
||||
virtual void visitCompareVAndBranch(LCompareVAndBranch* lir);
|
||||
virtual void visitCompareBitwise(LCompareBitwise* lir);
|
||||
virtual void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir);
|
||||
virtual void visitBitAndAndBranch(LBitAndAndBranch* baab);
|
||||
virtual void visitAsmJSUInt32ToDouble(LAsmJSUInt32ToDouble* lir);
|
||||
virtual void visitAsmJSUInt32ToFloat32(LAsmJSUInt32ToFloat32* lir);
|
||||
|
|
|
@ -1599,12 +1599,12 @@ CodeGeneratorMIPS::visitCompareBAndBranch(LCompareBAndBranch* lir)
|
|||
}
|
||||
|
||||
void
|
||||
CodeGeneratorMIPS::visitCompareV(LCompareV* lir)
|
||||
CodeGeneratorMIPS::visitCompareBitwise(LCompareBitwise* lir)
|
||||
{
|
||||
MCompare* mir = lir->mir();
|
||||
Assembler::Condition cond = JSOpToCondition(mir->compareType(), mir->jsop());
|
||||
const ValueOperand lhs = ToValue(lir, LCompareV::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareV::RhsInput);
|
||||
const ValueOperand lhs = ToValue(lir, LCompareBitwise::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwise::RhsInput);
|
||||
const Register output = ToRegister(lir->output());
|
||||
|
||||
MOZ_ASSERT(IsEqualityOp(mir->jsop()));
|
||||
|
@ -1624,12 +1624,12 @@ CodeGeneratorMIPS::visitCompareV(LCompareV* lir)
|
|||
}
|
||||
|
||||
void
|
||||
CodeGeneratorMIPS::visitCompareVAndBranch(LCompareVAndBranch* lir)
|
||||
CodeGeneratorMIPS::visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir)
|
||||
{
|
||||
MCompare* mir = lir->cmpMir();
|
||||
Assembler::Condition cond = JSOpToCondition(mir->compareType(), mir->jsop());
|
||||
const ValueOperand lhs = ToValue(lir, LCompareVAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareVAndBranch::RhsInput);
|
||||
const ValueOperand lhs = ToValue(lir, LCompareBitwiseAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwiseAndBranch::RhsInput);
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
|
||||
mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE);
|
||||
|
|
|
@ -175,8 +175,8 @@ class CodeGeneratorMIPS : public CodeGeneratorShared
|
|||
virtual void visitCompareFAndBranch(LCompareFAndBranch* comp);
|
||||
virtual void visitCompareB(LCompareB* lir);
|
||||
virtual void visitCompareBAndBranch(LCompareBAndBranch* lir);
|
||||
virtual void visitCompareV(LCompareV* lir);
|
||||
virtual void visitCompareVAndBranch(LCompareVAndBranch* lir);
|
||||
virtual void visitCompareBitwise(LCompareBitwise* lir);
|
||||
virtual void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir);
|
||||
virtual void visitBitAndAndBranch(LBitAndAndBranch* lir);
|
||||
virtual void visitAsmJSUInt32ToDouble(LAsmJSUInt32ToDouble* lir);
|
||||
virtual void visitAsmJSUInt32ToFloat32(LAsmJSUInt32ToFloat32* lir);
|
||||
|
|
|
@ -2378,10 +2378,10 @@ class LCompareBAndBranch : public LControlInstructionHelper<2, BOX_PIECES + 1, 0
|
|||
}
|
||||
};
|
||||
|
||||
class LCompareV : public LInstructionHelper<1, 2 * BOX_PIECES, 0>
|
||||
class LCompareBitwise : public LInstructionHelper<1, 2 * BOX_PIECES, 0>
|
||||
{
|
||||
public:
|
||||
LIR_HEADER(CompareV)
|
||||
LIR_HEADER(CompareBitwise)
|
||||
|
||||
static const size_t LhsInput = 0;
|
||||
static const size_t RhsInput = BOX_PIECES;
|
||||
|
@ -2391,17 +2391,17 @@ class LCompareV : public LInstructionHelper<1, 2 * BOX_PIECES, 0>
|
|||
}
|
||||
};
|
||||
|
||||
class LCompareVAndBranch : public LControlInstructionHelper<2, 2 * BOX_PIECES, 0>
|
||||
class LCompareBitwiseAndBranch : public LControlInstructionHelper<2, 2 * BOX_PIECES, 0>
|
||||
{
|
||||
MCompare* cmpMir_;
|
||||
|
||||
public:
|
||||
LIR_HEADER(CompareVAndBranch)
|
||||
LIR_HEADER(CompareBitwiseAndBranch)
|
||||
|
||||
static const size_t LhsInput = 0;
|
||||
static const size_t RhsInput = BOX_PIECES;
|
||||
|
||||
LCompareVAndBranch(MCompare* cmpMir, MBasicBlock* ifTrue, MBasicBlock* ifFalse)
|
||||
LCompareBitwiseAndBranch(MCompare* cmpMir, MBasicBlock* ifTrue, MBasicBlock* ifFalse)
|
||||
: cmpMir_(cmpMir)
|
||||
{
|
||||
setSuccessor(0, ifTrue);
|
||||
|
|
|
@ -115,8 +115,8 @@
|
|||
_(CompareStrictS) \
|
||||
_(CompareB) \
|
||||
_(CompareBAndBranch) \
|
||||
_(CompareV) \
|
||||
_(CompareVAndBranch) \
|
||||
_(CompareBitwise) \
|
||||
_(CompareBitwiseAndBranch) \
|
||||
_(CompareVM) \
|
||||
_(BitAndAndBranch) \
|
||||
_(IsNullOrLikeUndefinedV) \
|
||||
|
|
|
@ -183,11 +183,11 @@ CodeGeneratorX64::visitCompareBAndBranch(LCompareBAndBranch* lir)
|
|||
}
|
||||
|
||||
void
|
||||
CodeGeneratorX64::visitCompareV(LCompareV* lir)
|
||||
CodeGeneratorX64::visitCompareBitwise(LCompareBitwise* lir)
|
||||
{
|
||||
MCompare* mir = lir->mir();
|
||||
const ValueOperand lhs = ToValue(lir, LCompareV::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareV::RhsInput);
|
||||
const ValueOperand lhs = ToValue(lir, LCompareBitwise::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwise::RhsInput);
|
||||
const Register output = ToRegister(lir->output());
|
||||
|
||||
MOZ_ASSERT(IsEqualityOp(mir->jsop()));
|
||||
|
@ -197,12 +197,12 @@ CodeGeneratorX64::visitCompareV(LCompareV* lir)
|
|||
}
|
||||
|
||||
void
|
||||
CodeGeneratorX64::visitCompareVAndBranch(LCompareVAndBranch* lir)
|
||||
CodeGeneratorX64::visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir)
|
||||
{
|
||||
MCompare* mir = lir->cmpMir();
|
||||
|
||||
const ValueOperand lhs = ToValue(lir, LCompareVAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareVAndBranch::RhsInput);
|
||||
const ValueOperand lhs = ToValue(lir, LCompareBitwiseAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwiseAndBranch::RhsInput);
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
|
||||
mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE);
|
||||
|
|
|
@ -40,8 +40,8 @@ class CodeGeneratorX64 : public CodeGeneratorX86Shared
|
|||
void visitUnbox(LUnbox* unbox);
|
||||
void visitCompareB(LCompareB* lir);
|
||||
void visitCompareBAndBranch(LCompareBAndBranch* lir);
|
||||
void visitCompareV(LCompareV* lir);
|
||||
void visitCompareVAndBranch(LCompareVAndBranch* lir);
|
||||
void visitCompareBitwise(LCompareBitwise* lir);
|
||||
void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir);
|
||||
void visitTruncateDToInt32(LTruncateDToInt32* ins);
|
||||
void visitTruncateFToInt32(LTruncateFToInt32* ins);
|
||||
void visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic* ins);
|
||||
|
|
|
@ -184,12 +184,12 @@ CodeGeneratorX86::visitCompareBAndBranch(LCompareBAndBranch* lir)
|
|||
}
|
||||
|
||||
void
|
||||
CodeGeneratorX86::visitCompareV(LCompareV* lir)
|
||||
CodeGeneratorX86::visitCompareBitwise(LCompareBitwise* lir)
|
||||
{
|
||||
MCompare* mir = lir->mir();
|
||||
Assembler::Condition cond = JSOpToCondition(mir->compareType(), mir->jsop());
|
||||
const ValueOperand lhs = ToValue(lir, LCompareV::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareV::RhsInput);
|
||||
const ValueOperand lhs = ToValue(lir, LCompareBitwise::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwise::RhsInput);
|
||||
const Register output = ToRegister(lir->output());
|
||||
|
||||
MOZ_ASSERT(IsEqualityOp(mir->jsop()));
|
||||
|
@ -211,12 +211,12 @@ CodeGeneratorX86::visitCompareV(LCompareV* lir)
|
|||
}
|
||||
|
||||
void
|
||||
CodeGeneratorX86::visitCompareVAndBranch(LCompareVAndBranch* lir)
|
||||
CodeGeneratorX86::visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir)
|
||||
{
|
||||
MCompare* mir = lir->cmpMir();
|
||||
Assembler::Condition cond = JSOpToCondition(mir->compareType(), mir->jsop());
|
||||
const ValueOperand lhs = ToValue(lir, LCompareVAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareVAndBranch::RhsInput);
|
||||
const ValueOperand lhs = ToValue(lir, LCompareBitwiseAndBranch::LhsInput);
|
||||
const ValueOperand rhs = ToValue(lir, LCompareBitwiseAndBranch::RhsInput);
|
||||
|
||||
MOZ_ASSERT(mir->jsop() == JSOP_EQ || mir->jsop() == JSOP_STRICTEQ ||
|
||||
mir->jsop() == JSOP_NE || mir->jsop() == JSOP_STRICTNE);
|
||||
|
|
|
@ -49,8 +49,8 @@ class CodeGeneratorX86 : public CodeGeneratorX86Shared
|
|||
void visitValue(LValue* value);
|
||||
void visitCompareB(LCompareB* lir);
|
||||
void visitCompareBAndBranch(LCompareBAndBranch* lir);
|
||||
void visitCompareV(LCompareV* lir);
|
||||
void visitCompareVAndBranch(LCompareVAndBranch* lir);
|
||||
void visitCompareBitwise(LCompareBitwise* lir);
|
||||
void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir);
|
||||
void visitAsmJSUInt32ToDouble(LAsmJSUInt32ToDouble* lir);
|
||||
void visitAsmJSUInt32ToFloat32(LAsmJSUInt32ToFloat32* lir);
|
||||
void visitTruncateDToInt32(LTruncateDToInt32* ins);
|
||||
|
|
|
@ -256,7 +256,7 @@ BEGIN_TEST(testJitRangeAnalysis_StrictCompareBeta)
|
|||
MCompare::CompareType nonNumerics[] = {
|
||||
MCompare::Compare_Unknown,
|
||||
MCompare::Compare_Object,
|
||||
MCompare::Compare_Value,
|
||||
MCompare::Compare_Bitwise,
|
||||
MCompare::Compare_String
|
||||
};
|
||||
for (size_t i = 0; i < mozilla::ArrayLength(nonNumerics); ++i) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче