From 1610803b79e976f3e944d3d89c85bb2fc705a35a Mon Sep 17 00:00:00 2001 From: "titzer@chromium.org" Date: Wed, 11 Sep 2013 12:59:07 +0000 Subject: [PATCH] Improve alias analysis for HConstants (and fix small snafu in MustAlias). BUG= R=verwaest@chromium.org Review URL: https://codereview.chromium.org/24107003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16651 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/hydrogen-alias-analysis.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hydrogen-alias-analysis.h b/src/hydrogen-alias-analysis.h index 4478501..73e116e 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) { -- 2.7.4