Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index b75bec0f5ec58ad1c3543b67615b2695a2b11eec..5065d4ce390e877904b1b68d5c5c6b6ba9849c03 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -1511,17 +1511,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); |
} |