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

Side by Side Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 10574046: Remove static fields in the namer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 if (node.builtin) { 425 if (node.builtin) {
426 return foldBuiltinEqualsCheck(node); 426 return foldBuiltinEqualsCheck(node);
427 } 427 }
428 428
429 if (left.isConstant() && right.isConstant()) { 429 if (left.isConstant() && right.isConstant()) {
430 return super.visitEquals(node); 430 return super.visitEquals(node);
431 } 431 }
432 432
433 if (left.propagatedType.isExact()) { 433 if (left.propagatedType.isExact()) {
434 HBoundedType type = left.propagatedType; 434 HBoundedType type = left.propagatedType;
435 Element element = type.lookupMember(Namer.OPERATOR_EQUALS); 435 Element element = type.lookupMember(Elements.OPERATOR_EQUALS);
436 if (element !== null) { 436 if (element !== null) {
437 // If the left-hand side is guaranteed to be a non-primitive 437 // If the left-hand side is guaranteed to be a non-primitive
438 // type and and it defines operator==, we emit a call to that 438 // type and and it defines operator==, we emit a call to that
439 // operator. 439 // operator.
440 return super.visitEquals(node); 440 return super.visitEquals(node);
441 } else if (right.isConstantNull()) { 441 } else if (right.isConstantNull()) {
442 return graph.addConstantBool(false); 442 return graph.addConstantBool(false);
443 } else { 443 } else {
444 // We can just emit an identity check because the type does 444 // We can just emit an identity check because the type does
445 // not implement operator=. 445 // not implement operator=.
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 } 1229 }
1230 break; 1230 break;
1231 default: 1231 default:
1232 assert(false); 1232 assert(false);
1233 break; 1233 break;
1234 } 1234 }
1235 } 1235 }
1236 } 1236 }
1237 } 1237 }
1238 } 1238 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698