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

Unified Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 10698079: Revert all the changes to equals operator. Causing buildbot trouble. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | « lib/compiler/implementation/ssa/nodes.dart ('k') | tests/co19/co19-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/optimize.dart
diff --git a/lib/compiler/implementation/ssa/optimize.dart b/lib/compiler/implementation/ssa/optimize.dart
index 664b62bd63cdcce93493fbe7bad40f8518d6e4bf..3d67053bbedc0dd1db47536eff3eb6c13ad5f2c9 100644
--- a/lib/compiler/implementation/ssa/optimize.dart
+++ b/lib/compiler/implementation/ssa/optimize.dart
@@ -460,6 +460,28 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase {
if (right.isConstantNull()) {
if (left.propagatedType.isPrimitive()) {
return graph.addConstantBool(false);
+ } else {
+ // TODO(floitsch): cache interceptors.
+ Interceptors interceptors = backend.builder.interceptors;
+ Element equalsElement = interceptors.getEqualsInterceptor();
+ // If we have a different element than [equalsElement], we
+ // don't need to optimize this instruction to use another
+ // element: we know the element is either eqNull or eqNullB.
+ if (node.element === equalsElement) {
+ Element targetElement = interceptors.getEqualsNullInterceptor();
+ bool onlyUsedInBoolify = allUsersAreBoolifies(node);
+ if (onlyUsedInBoolify) {
+ targetElement = interceptors.getBoolifiedVersionOf(targetElement);
+ }
+ HStatic target = new HStatic(targetElement);
+ node.block.addBefore(node, target);
+ HEquals result = new HEquals(target, node.left, node.right);
+ if (onlyUsedInBoolify) {
+ result.usesBoolifiedInterceptor = true;
+ result.propagatedType = HType.BOOLEAN;
+ }
+ return result;
+ }
}
}
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698