| Index: src/x64/lithium-codegen-x64.cc
|
| diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
|
| index 364c3a1824ef671ee44dcd8f984d4be0363da993..49c58f2500f874a8226a2129c799df45b0e8d25a 100644
|
| --- a/src/x64/lithium-codegen-x64.cc
|
| +++ b/src/x64/lithium-codegen-x64.cc
|
| @@ -1699,7 +1699,7 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
|
| LOperand* right = instr->right();
|
| ASSERT(left->Equals(instr->result()));
|
| HMathMinMax::Operation operation = instr->hydrogen()->operation();
|
| - if (instr->hydrogen()->representation().IsInteger32()) {
|
| + if (instr->hydrogen()->representation().IsSmiOrInteger32()) {
|
| Label return_left;
|
| Condition condition = (operation == HMathMinMax::kMathMin)
|
| ? less_equal
|
| @@ -1713,12 +1713,20 @@ void LCodeGen::DoMathMinMax(LMathMinMax* instr) {
|
| __ movq(left_reg, right_imm);
|
| } else if (right->IsRegister()) {
|
| Register right_reg = ToRegister(right);
|
| - __ cmpl(left_reg, right_reg);
|
| + if (instr->hydrogen_value()->representation().IsSmi()) {
|
| + __ cmpq(left_reg, right_reg);
|
| + } else {
|
| + __ cmpl(left_reg, right_reg);
|
| + }
|
| __ j(condition, &return_left, Label::kNear);
|
| __ movq(left_reg, right_reg);
|
| } else {
|
| Operand right_op = ToOperand(right);
|
| - __ cmpl(left_reg, right_op);
|
| + if (instr->hydrogen_value()->representation().IsSmi()) {
|
| + __ cmpq(left_reg, right_op);
|
| + } else {
|
| + __ cmpl(left_reg, right_op);
|
| + }
|
| __ j(condition, &return_left, Label::kNear);
|
| __ movq(left_reg, right_op);
|
| }
|
|
|