Backed out changeset 28ca0dfe8d72

This commit is contained in:
Hannes Verschore 2017-01-11 11:17:23 +01:00
parent 900b14556f
commit 0cf1eda5de
3 changed files with 7 additions and 24 deletions

View File

@ -365,10 +365,9 @@ TryToSpecializeBinaryArithOp(ICStub** stubs,
uint32_t nstubs,
MIRType* result)
{
bool sawInt32 = false;
DebugOnly<bool> sawInt32 = false;
bool sawDouble = false;
bool sawOther = false;
bool sawString = false;
for (uint32_t i = 0; i < nstubs; i++) {
switch (stubs[i]->kind()) {
@ -384,11 +383,6 @@ TryToSpecializeBinaryArithOp(ICStub** stubs,
case ICStub::BinaryArith_DoubleWithInt32:
sawDouble = true;
break;
case ICStub::BinaryArith_StringConcat:
// Don't report true for BinaryArith_StringObjectConcat, since
// IonMonkey doesn't support MConcat with objects yet.
sawString = true;
break;
default:
sawOther = true;
break;
@ -398,13 +392,6 @@ TryToSpecializeBinaryArithOp(ICStub** stubs,
if (sawOther)
return false;
if (sawString) {
if (sawDouble || sawInt32)
return false;
*result = MIRType::String;
return true;
}
if (sawDouble) {
*result = MIRType::Double;
return true;

View File

@ -3313,16 +3313,9 @@ IonBuilder::binaryArithTrySpecializedOnBaselineInspector(bool* emitted, JSOp op,
return Ok();
}
MInstruction* ins;
if (specialization == MIRType::String) {
MOZ_ASSERT(op == JSOP_ADD);
ins = MConcat::New(alloc(), left, right);
} else {
MDefinition::Opcode def_op = JSOpToMDefinition(op);
MBinaryArithInstruction* arith = MBinaryArithInstruction::New(alloc(), def_op, left, right);
arith->setSpecialization(specialization);
ins = arith;
}
MDefinition::Opcode def_op = JSOpToMDefinition(op);
MBinaryArithInstruction* ins = MBinaryArithInstruction::New(alloc(), def_op, left, right);
ins->setSpecialization(specialization);
current->add(ins);
current->push(ins);

View File

@ -7212,6 +7212,9 @@ class MConcat
MConcat(MDefinition* left, MDefinition* right)
: MBinaryInstruction(left, right)
{
// At least one input should be definitely string
MOZ_ASSERT(left->type() == MIRType::String || right->type() == MIRType::String);
setMovable();
setResultType(MIRType::String);
}