Commit af87218f authored by titzer@chromium.org's avatar titzer@chromium.org

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
parent d5d7b1d9
......@@ -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;
}
};
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment