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

Unified Diff: src/hydrogen.cc

Issue 21531003: Remove buggy ToNumber truncation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 6875f99bd7e5a765388f70b20b55a9567c8fae6d..7ec65df28ddcf9d3d6866473dbfb5226f0359475 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -7679,26 +7679,6 @@ HValue* HGraphBuilder::TruncateToNumber(HValue* value, Handle<Type>* expected) {
*expected = handle(Type::Number(), isolate());
return AddInstruction(number.value);
}
- return value;
- }
-
- Handle<Type> expected_type = *expected;
- Representation rep = Representation::FromType(expected_type);
- if (!rep.IsTagged()) return value;
-
- // If our type feedback suggests that we can non-observably truncate to number
- // we introduce the appropriate check here. This avoids 'value' having a
- // tagged representation later on.
- if (expected_type->Is(Type::Oddball())) {
- // TODO(olivf) The BinaryOpStub only records undefined. It might pay off to
- // also record booleans and convert them to 0/1 here.
- IfBuilder if_nan(this);
- if_nan.If<HCompareObjectEqAndBranch>(value,
- graph()->GetConstantUndefined());
- if_nan.Then();
- if_nan.ElseDeopt();
- if_nan.End();
- return Add<HConstant>(OS::nan_value());
}
return value;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698