Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index dbfe555c428c2fbb4c9f9748f79749fe4a98b696..15f4dabb4dba7b4366b1be9308c379e0510ef523 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -1512,17 +1512,8 @@ HInstruction* HForceRepresentation::New(Zone* zone, HValue* context, |
HValue* value, Representation representation) { |
if (FLAG_fold_constants && value->IsConstant()) { |
HConstant* c = HConstant::cast(value); |
- if (c->HasNumberValue()) { |
- double double_res = c->DoubleValue(); |
- if (representation.IsDouble()) { |
- return HConstant::New(zone, context, double_res); |
- |
- } else if (representation.CanContainDouble(double_res)) { |
- return HConstant::New(zone, context, |
- static_cast<int32_t>(double_res), |
- representation); |
- } |
- } |
+ c = c->CopyToRepresentation(representation, zone); |
+ if (c != NULL) return c; |
} |
return new(zone) HForceRepresentation(value, representation); |
} |