Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Unified Diff: src/hydrogen-instructions.cc

Issue 535093002: Version 3.28.71.7 (merged r23397) (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.28
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/property-details.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698