Reviewers: Michael Starzinger,

Description:
Make HValue::ActualValue() traverse all idefs.

BUG=

Please review this at https://codereview.chromium.org/23691064/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+8, -13 lines):
  M src/hydrogen-alias-analysis.h
  M src/hydrogen-instructions.h


Index: src/hydrogen-alias-analysis.h
diff --git a/src/hydrogen-alias-analysis.h b/src/hydrogen-alias-analysis.h
index 73e116e63e171e9a4fd8e1478a53ff1bb45e8236..21a54625ff8587a59532d26aa210a4423849f540 100644
--- a/src/hydrogen-alias-analysis.h
+++ b/src/hydrogen-alias-analysis.h
@@ -88,15 +88,6 @@ class HAliasAnalyzer : public ZoneObject {
   inline bool NoAlias(HValue* a, HValue* b) {
     return Query(a, b) == kNoAlias;
   }
-
-  // Returns the actual value of an instruction. In the case of a chain
-  // of informative definitions, return the root of the chain.
-  HValue* ActualValue(HValue* obj) {
-    while (obj->IsInformativeDefinition()) {  // Walk a chain of idefs.
-      obj = obj->RedefinedOperand();
-    }
-    return obj;
-  }
 };


Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 7d33141a4f61c150320d02aaceb2c74218506b66..732cabfeee2b2d6cbb56f8211ccb4a7ebd81f2cf 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -782,11 +782,15 @@ class HValue : public ZoneObject {
   // phase (so that live ranges will be shorter).
   virtual bool IsPurelyInformativeDefinition() { return false; }

-  // This method must always return the original HValue SSA definition
-  // (regardless of any iDef of this value).
+  // This method must always return the original HValue SSA definition,
+  // regardless of any chain of iDefs of this value.
   HValue* ActualValue() {
-    int index = RedefinedOperandIndex();
-    return index == kNoRedefinedOperand ? this : OperandAt(index);
+    HValue* value = this;
+    int index;
+ while ((index = value->RedefinedOperandIndex()) != kNoRedefinedOperand) {
+      value = value->OperandAt(index);
+    }
+    return value;
   }

   bool IsInteger32Constant();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to