Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: src/hydrogen-alias-analysis.h

Issue 24107003: Improve alias analysis for HConstants (and fix small snafu in MustAlias). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-alias-analysis.h
diff --git a/src/hydrogen-alias-analysis.h b/src/hydrogen-alias-analysis.h
index 447850123cd415174fc7885e6246262c3ecf4db8..73e116e63e171e9a4fd8e1478a53ff1bb45e8236 100644
--- a/src/hydrogen-alias-analysis.h
+++ b/src/hydrogen-alias-analysis.h
@@ -65,7 +65,11 @@ class HAliasAnalyzer : public ZoneObject {
if (a->IsConstant()) return kNoAlias;
}
- // TODO(titzer): return MustAlias for two equivalent constants.
+ // Constant objects can be distinguished statically.
+ if (a->IsConstant()) {
+ // TODO(titzer): DataEquals() is more efficient, but that's protected.
+ return a->Equals(b) ? kMustAlias : kNoAlias;
+ }
return kMayAlias;
}
@@ -78,7 +82,7 @@ class HAliasAnalyzer : public ZoneObject {
}
inline bool MustAlias(HValue* a, HValue* b) {
- return Query(a, b) == kMayAlias;
+ return Query(a, b) == kMustAlias;
}
inline bool NoAlias(HValue* a, HValue* b) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698