| Index: src/x64/lithium-x64.cc
|
| diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
|
| index 0cc06e3c3fe6328095d97d5422a42a06f6989998..0af2ce4fc46fb7e71c36b81eec8dbc26fc96eac2 100644
|
| --- a/src/x64/lithium-x64.cc
|
| +++ b/src/x64/lithium-x64.cc
|
| @@ -1417,15 +1417,22 @@ LInstruction* LChunkBuilder::DoCompareIDAndBranch(
|
| if (r.IsInteger32()) {
|
| ASSERT(instr->left()->representation().IsInteger32());
|
| ASSERT(instr->right()->representation().IsInteger32());
|
| - LOperand* left = UseRegisterAtStart(instr->left());
|
| + LOperand* left = UseRegisterOrConstantAtStart(instr->left());
|
| LOperand* right = UseOrConstantAtStart(instr->right());
|
| return new LCmpIDAndBranch(left, right);
|
| } else {
|
| ASSERT(r.IsDouble());
|
| ASSERT(instr->left()->representation().IsDouble());
|
| ASSERT(instr->right()->representation().IsDouble());
|
| - LOperand* left = UseRegisterAtStart(instr->left());
|
| - LOperand* right = UseRegisterAtStart(instr->right());
|
| + LOperand* left;
|
| + LOperand* right;
|
| + if (instr->left()->IsConstant() && instr->right()->IsConstant()) {
|
| + left = UseRegisterOrConstantAtStart(instr->left());
|
| + right = UseRegisterOrConstantAtStart(instr->right());
|
| + } else {
|
| + left = UseRegisterAtStart(instr->left());
|
| + right = UseRegisterAtStart(instr->right());
|
| + }
|
| return new LCmpIDAndBranch(left, right);
|
| }
|
| }
|
|
|