| Index: src/arm/lithium-arm.cc
|
| diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
|
| index 998b73b62e9242a6dd2393a919f199f2af5c1859..0c83ac63b533f0eaf1ba4a3a8294eceaf6906b0e 100644
|
| --- a/src/arm/lithium-arm.cc
|
| +++ b/src/arm/lithium-arm.cc
|
| @@ -991,10 +991,10 @@ LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
|
| LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
|
| HValue* value = instr->value();
|
| if (value->EmitAtUses()) {
|
| - HBasicBlock* successor = HConstant::cast(value)->BooleanValue()
|
| - ? instr->FirstSuccessor()
|
| - : instr->SecondSuccessor();
|
| - return new(zone()) LGoto(successor->block_id());
|
| + ASSERT(value->IsConstant());
|
| + ASSERT(!value->representation().IsDouble());
|
| + return ElideControlInstruction(instr,
|
| + HConstant::cast(value)->BooleanValue());
|
| }
|
|
|
| LBranch* result = new(zone()) LBranch(UseRegister(value));
|
| @@ -1727,6 +1727,13 @@ LInstruction* LChunkBuilder::DoCompareNumericAndBranch(
|
|
|
| LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch(
|
| HCompareObjectEqAndBranch* instr) {
|
| + if (instr->left()->IsConstant() && instr->right()->IsConstant()) {
|
| + bool comparison_result =
|
| + HConstant::cast(instr->left())->SameConstantObject(
|
| + HConstant::cast(instr->right()));
|
| + return ElideControlInstruction(instr, comparison_result);
|
| + }
|
| +
|
| LOperand* left = UseRegisterAtStart(instr->left());
|
| LOperand* right = UseRegisterAtStart(instr->right());
|
| return new(zone()) LCmpObjectEqAndBranch(left, right);
|
|
|