From: titzer@chromium.org Date: Mon, 16 Sep 2013 12:44:28 +0000 (+0000) Subject: Make HValue::ActualValue() traverse all idefs. X-Git-Tag: upstream/4.7.83~12486 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af87218fa08ac0bbe2fae1a7371b8c4c5a10a892;p=platform%2Fupstream%2Fv8.git Make HValue::ActualValue() traverse all idefs. BUG= R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/23691064 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16732 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/hydrogen-alias-analysis.h b/src/hydrogen-alias-analysis.h index 73e116e..21a5462 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; - } }; diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 7d3b879..4a502ba 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();