Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index f746af54bd75d988c082802b459699666630c6a0..e227cea08bc681a2116eeb38742c91a12215a9d2 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -1761,9 +1761,12 @@ Range* HConstant::InferRange(Zone* zone) { |
Range* HPhi::InferRange(Zone* zone) { |
- if (representation().IsInteger32()) { |
+ Representation r = representation(); |
+ if (r.IsSmiOrInteger32()) { |
if (block()->IsLoopHeader()) { |
- Range* range = new(zone) Range(kMinInt, kMaxInt); |
+ Range* range = r.IsSmi() |
+ ? new(zone) Range(Smi::kMinValue, Smi::kMaxValue) |
+ : new(zone) Range(kMinInt, kMaxInt); |
return range; |
} else { |
Range* range = OperandAt(0)->range()->Copy(zone); |