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

Unified Diff: src/hydrogen-instructions.cc

Issue 7453024: Revert r8753. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 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-instructions.cc
===================================================================
--- src/hydrogen-instructions.cc (revision 8755)
+++ src/hydrogen-instructions.cc (working copy)
@@ -481,6 +481,7 @@
void HValue::AddNewRange(Range* r) {
if (!HasRange()) ComputeInitialRange();
+ if (!HasRange()) range_ = new Range();
ASSERT(HasRange());
r->StackUpon(range_);
range_ = r;
@@ -861,22 +862,27 @@
Range* HValue::InferRange() {
- if (representation().IsInteger32()) {
- // Untagged integer32 cannot be -0.
- return new Range ();
- } else {
- // Tagged values, untagged doubles, and values with unknown representation
- // can contain -0.
+ 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();
}
}
Range* HConstant::InferRange() {
if (has_int32_value_) {
- return new Range(int32_value_, int32_value_);
+ Range* result = new Range(int32_value_, int32_value_);
+ result->set_can_be_minus_zero(false);
+ return result;
}
return HValue::InferRange();
}
@@ -885,7 +891,8 @@
Range* HPhi::InferRange() {
if (representation().IsInteger32()) {
if (block()->IsLoopHeader()) {
- return new Range();
+ Range* range = new Range(kMinInt, kMaxInt);
+ return range;
} else {
Range* range = OperandAt(0)->range()->Copy();
for (int i = 1; i < OperandCount(); ++i) {
« 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