| Index: src/hydrogen-instructions.cc
|
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
|
| index 15456c6146202820d27136149e8495c1c5d4f31b..d2f16f46acc132945412acfba9a3c3fde73f80f3 100644
|
| --- a/src/hydrogen-instructions.cc
|
| +++ b/src/hydrogen-instructions.cc
|
| @@ -1574,7 +1574,15 @@ HValue* HUnaryMathOperation::Canonicalize() {
|
|
|
| // If the input is integer32 then we replace the round instruction
|
| // with its input.
|
| - if (val->representation().IsSmiOrInteger32()) return val;
|
| + if (val->representation().IsSmiOrInteger32()) {
|
| + if (!val->representation().Equals(representation())) {
|
| + HChange* result = new(block()->zone()) HChange(
|
| + val, representation(), false, false, false);
|
| + result->InsertBefore(this);
|
| + return result;
|
| + }
|
| + return val;
|
| + }
|
| }
|
|
|
| if (op() == kMathFloor) {
|
| @@ -1583,7 +1591,15 @@ HValue* HUnaryMathOperation::Canonicalize() {
|
|
|
| // If the input is integer32 then we replace the floor instruction
|
| // with its input.
|
| - if (val->representation().IsSmiOrInteger32()) return val;
|
| + if (val->representation().IsSmiOrInteger32()) {
|
| + if (!val->representation().Equals(representation())) {
|
| + HChange* result = new(block()->zone()) HChange(
|
| + val, representation(), false, false, false);
|
| + result->InsertBefore(this);
|
| + return result;
|
| + }
|
| + return val;
|
| + }
|
|
|
| if (val->IsDiv() && (val->UseCount() == 1)) {
|
| HDiv* hdiv = HDiv::cast(val);
|
|
|