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

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

Issue 10905211: Clean up operator names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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
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 abstract class OptimizationPhase { 5 abstract class 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 return foldBuiltinEqualsCheck(node); 448 return foldBuiltinEqualsCheck(node);
449 } 449 }
450 450
451 if (left.isConstant() && right.isConstant()) { 451 if (left.isConstant() && right.isConstant()) {
452 return super.visitEquals(node); 452 return super.visitEquals(node);
453 } 453 }
454 454
455 HType leftType = types[left]; 455 HType leftType = types[left];
456 if (leftType.isExact()) { 456 if (leftType.isExact()) {
457 HBoundedType type = leftType; 457 HBoundedType type = leftType;
458 Element element = type.lookupMember(Elements.OPERATOR_EQUALS); 458 Element element = type.lookupMember(const SourceString('=='));
459 if (element !== null) { 459 if (element !== null) {
460 // If the left-hand side is guaranteed to be a non-primitive 460 // If the left-hand side is guaranteed to be a non-primitive
461 // type and and it defines operator==, we emit a call to that 461 // type and and it defines operator==, we emit a call to that
462 // operator. 462 // operator.
463 return super.visitEquals(node); 463 return super.visitEquals(node);
464 } else if (right.isConstantNull()) { 464 } else if (right.isConstantNull()) {
465 return graph.addConstantBool(false, constantSystem); 465 return graph.addConstantBool(false, constantSystem);
466 } else { 466 } else {
467 // We can just emit an identity check because the type does 467 // We can just emit an identity check because the type does
468 // not implement operator=. 468 // not implement operator=.
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 } 1337 }
1338 1338
1339 // For other fields having setters in the generative constructor body, set 1339 // For other fields having setters in the generative constructor body, set
1340 // the type to UNKNOWN to avoid relying on the type set in the initializer 1340 // the type to UNKNOWN to avoid relying on the type set in the initializer
1341 // list. 1341 // list.
1342 allSetters.forEach((Element element) { 1342 allSetters.forEach((Element element) {
1343 backend.registerFieldConstructor(element, HType.UNKNOWN); 1343 backend.registerFieldConstructor(element, HType.UNKNOWN);
1344 }); 1344 });
1345 } 1345 }
1346 } 1346 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698