Reviewers: Toon Verwaest,

Description:
Improve alias analysis for HConstants (and fix small snafu in MustAlias).

BUG=

Please review this at https://codereview.chromium.org/24107003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+6, -2 lines):
  M src/hydrogen-alias-analysis.h


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) {


--
--
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