Revision: 16732
Author:   [email protected]
Date:     Mon Sep 16 12:44:28 2013 UTC
Log:      Make HValue::ActualValue() traverse all idefs.

BUG=
[email protected]

Review URL: https://codereview.chromium.org/23691064
http://code.google.com/p/v8/source/detail?r=16732

Modified:
 /branches/bleeding_edge/src/hydrogen-alias-analysis.h
 /branches/bleeding_edge/src/hydrogen-instructions.h

=======================================
--- /branches/bleeding_edge/src/hydrogen-alias-analysis.h Wed Sep 11 12:59:07 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-alias-analysis.h Mon Sep 16 12:44:28 2013 UTC
@@ -88,15 +88,6 @@
   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;
-  }
 };


=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Fri Sep 13 12:02:50 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Mon Sep 16 12:44:28 2013 UTC
@@ -782,11 +782,15 @@
   // 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