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

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

Issue 10377166: Prepare to have more than one universe. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 } 535 }
536 } else if (expressionType.isArray()) { 536 } else if (expressionType.isArray()) {
537 if (element === compiler.listClass 537 if (element === compiler.listClass
538 || Elements.isListSupertype(element, compiler)) { 538 || Elements.isListSupertype(element, compiler)) {
539 return graph.addConstantBool(true); 539 return graph.addConstantBool(true);
540 } else { 540 } else {
541 return graph.addConstantBool(false); 541 return graph.addConstantBool(false);
542 } 542 }
543 // TODO(karlklose): remove the hasTypeArguments check. 543 // TODO(karlklose): remove the hasTypeArguments check.
544 } else if (expressionType.isUseful() 544 } else if (expressionType.isUseful()
545 && !compiler.universe.rti.hasTypeArguments(type)) { 545 && !compiler.codegenWorld.rti.hasTypeArguments(type)) {
546 Type receiverType = expressionType.computeType(compiler); 546 Type receiverType = expressionType.computeType(compiler);
547 if (receiverType !== null) { 547 if (receiverType !== null) {
548 if (compiler.types.isSubtype(receiverType, type)) { 548 if (compiler.types.isSubtype(receiverType, type)) {
549 return graph.addConstantBool(true); 549 return graph.addConstantBool(true);
550 } else if (expressionType.isExact()) { 550 } else if (expressionType.isExact()) {
551 return graph.addConstantBool(false); 551 return graph.addConstantBool(false);
552 } 552 }
553 } 553 }
554 } 554 }
555 return node; 555 return node;
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 // the if block terminates. So any use of the instruction 1117 // the if block terminates. So any use of the instruction
1118 // after the join block should be changed to the new 1118 // after the join block should be changed to the new
1119 // instruction. 1119 // instruction.
1120 changeUsesDominatedBy(ifUser.joinBlock, input, convertedType); 1120 changeUsesDominatedBy(ifUser.joinBlock, input, convertedType);
1121 } 1121 }
1122 // TODO(ngeoffray): Also change uses for the then block on a HType 1122 // TODO(ngeoffray): Also change uses for the then block on a HType
1123 // that knows it is not of a specific Type. 1123 // that knows it is not of a specific Type.
1124 } 1124 }
1125 } 1125 }
1126 } 1126 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/ssa/codegen.dart ('k') | dart/lib/compiler/implementation/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698