Revision: 8753
Author:   [email protected]
Date:     Thu Jul 28 02:19:57 2011
Log:      Simplifications and cleanup of range analysis code.

Landing two patches contributed by Andy Wingo:

http://codereview.chromium.org/7514040/ and

http://codereview.chromium.org/7516001/
Review URL: http://codereview.chromium.org/7520022
http://code.google.com/p/v8/source/detail?r=8753

Modified:
 /branches/bleeding_edge/src/hydrogen-instructions.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Mon Jul 25 06:28:35 2011 +++ /branches/bleeding_edge/src/hydrogen-instructions.cc Thu Jul 28 02:19:57 2011
@@ -481,7 +481,6 @@

 void HValue::AddNewRange(Range* r) {
   if (!HasRange()) ComputeInitialRange();
-  if (!HasRange()) range_ = new Range();
   ASSERT(HasRange());
   r->StackUpon(range_);
   range_ = r;
@@ -862,27 +861,22 @@


 Range* HValue::InferRange() {
-  if (representation().IsTagged()) {
-    // Tagged values are always in int32 range when converted to integer,
-    // but they can contain -0.
+  if (representation().IsInteger32 ()) {
+    // Untagged integer32 cannot be -0.
+    return new Range ();
+  } else {
+ // Tagged values, untagged doubles, and values with unknown representation
+    // 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_) {
-    Range* result = new Range(int32_value_, int32_value_);
-    result->set_can_be_minus_zero(false);
-    return result;
+    return new Range(int32_value_, int32_value_);
   }
   return HValue::InferRange();
 }
@@ -891,8 +885,7 @@
 Range* HPhi::InferRange() {
   if (representation().IsInteger32()) {
     if (block()->IsLoopHeader()) {
-      Range* range = new Range(kMinInt, kMaxInt);
-      return range;
+      return new Range();
     } else {
       Range* range = OperandAt(0)->range()->Copy();
       for (int i = 1; i < OperandCount(); ++i) {

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to