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

Side by Side 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, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | tests/co19/co19-leg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 interface OptimizationPhase { 5 interface OptimizationPhase {
6 String get name(); 6 String get name();
7 void visitGraph(HGraph graph); 7 void visitGraph(HGraph graph);
8 } 8 }
9 9
10 class SsaOptimizerTask extends CompilerTask { 10 class SsaOptimizerTask extends CompilerTask {
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 } else { 453 } else {
454 // We can just emit an identity check because the type does 454 // We can just emit an identity check because the type does
455 // not implement operator=. 455 // not implement operator=.
456 return foldBuiltinEqualsCheck(node); 456 return foldBuiltinEqualsCheck(node);
457 } 457 }
458 } 458 }
459 459
460 if (right.isConstantNull()) { 460 if (right.isConstantNull()) {
461 if (left.propagatedType.isPrimitive()) { 461 if (left.propagatedType.isPrimitive()) {
462 return graph.addConstantBool(false); 462 return graph.addConstantBool(false);
463 } else {
464 // TODO(floitsch): cache interceptors.
465 Interceptors interceptors = backend.builder.interceptors;
466 Element equalsElement = interceptors.getEqualsInterceptor();
467 // If we have a different element than [equalsElement], we
468 // don't need to optimize this instruction to use another
469 // element: we know the element is either eqNull or eqNullB.
470 if (node.element === equalsElement) {
471 Element targetElement = interceptors.getEqualsNullInterceptor();
472 bool onlyUsedInBoolify = allUsersAreBoolifies(node);
473 if (onlyUsedInBoolify) {
474 targetElement = interceptors.getBoolifiedVersionOf(targetElement);
475 }
476 HStatic target = new HStatic(targetElement);
477 node.block.addBefore(node, target);
478 HEquals result = new HEquals(target, node.left, node.right);
479 if (onlyUsedInBoolify) {
480 result.usesBoolifiedInterceptor = true;
481 result.propagatedType = HType.BOOLEAN;
482 }
483 return result;
484 }
463 } 485 }
464 } 486 }
465 487
466 // All other cases are dealt with by the [visitRelational] and 488 // All other cases are dealt with by the [visitRelational] and
467 // [visitInvokeBinary], which are visited by invoking the [super]'s 489 // [visitInvokeBinary], which are visited by invoking the [super]'s
468 // visit method. 490 // visit method.
469 return super.visitEquals(node); 491 return super.visitEquals(node);
470 } 492 }
471 493
472 HInstruction visitTypeGuard(HTypeGuard node) { 494 HInstruction visitTypeGuard(HTypeGuard node) {
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 break; 1267 break;
1246 default: 1268 default:
1247 assert(false); 1269 assert(false);
1248 break; 1270 break;
1249 } 1271 }
1250 } 1272 }
1251 } 1273 }
1252 } 1274 }
1253 1275
1254 } 1276 }
OLDNEW
« 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