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

Unified Diff: src/hydrogen-instructions.cc

Issue 7566040: Revert "tighten invariants of HValue::InferRange" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 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 | test/mjsunit/math-floor.js » ('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 5bea55a77d844fd57cd2af9e2458eb457f476763..2be2a032574b6bf9af1f8560e19fe95d1694bab7 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -862,10 +862,19 @@ void HInstanceOf::PrintDataTo(StringStream* stream) {
Range* HValue::InferRange() {
- // Untagged integer32 cannot be -0, all other representations can.
- Range* result = new Range();
- result->set_can_be_minus_zero(!representation().IsInteger32());
- return result;
+ if (representation().IsTagged()) {
+ // Tagged values are always in int32 range when converted to integer,
+ // but they can contain -0.
+ Range* result = new Range();
+ result->set_can_be_minus_zero(true);
+ return result;
+ } else if (representation().IsNone()) {
+ return NULL;
+ } else {
+ // Untagged integer32 cannot be -0 and we don't compute ranges for
+ // untagged doubles.
+ return new Range();
+ }
}
« no previous file with comments | « no previous file | test/mjsunit/math-floor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698