| OLD | NEW |
| 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 import '../compiler.dart' show Compiler; | 5 import '../compiler.dart' show Compiler; |
| 6 import '../constants/values.dart'; | 6 import '../constants/values.dart'; |
| 7 import '../elements/elements.dart'; | 7 import '../elements/elements.dart'; |
| 8 import '../js_backend/js_backend.dart'; | 8 import '../js_backend/js_backend.dart'; |
| 9 import '../types/types.dart'; | 9 import '../types/types.dart'; |
| 10 import '../universe/selector.dart' show Selector; | 10 import '../universe/selector.dart' show Selector; |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 /** | 284 /** |
| 285 * Remove [HTypeConversion] instructions from the graph in '--trust-primitives' | 285 * Remove [HTypeConversion] instructions from the graph in '--trust-primitives' |
| 286 * mode. | 286 * mode. |
| 287 */ | 287 */ |
| 288 class SsaTrustedCheckRemover extends HBaseVisitor { | 288 class SsaTrustedCheckRemover extends HBaseVisitor { |
| 289 | 289 |
| 290 Compiler compiler; | 290 Compiler compiler; |
| 291 SsaTrustedCheckRemover(this.compiler); | 291 SsaTrustedCheckRemover(this.compiler); |
| 292 | 292 |
| 293 void visitGraph(HGraph graph) { | 293 void visitGraph(HGraph graph) { |
| 294 if (!compiler.trustPrimitives) return; | 294 if (!compiler.options.trustPrimitives) return; |
| 295 visitDominatorTree(graph); | 295 visitDominatorTree(graph); |
| 296 } | 296 } |
| 297 | 297 |
| 298 void visitBasicBlock(HBasicBlock block) { | 298 void visitBasicBlock(HBasicBlock block) { |
| 299 HInstruction instruction = block.first; | 299 HInstruction instruction = block.first; |
| 300 while (instruction != null) { | 300 while (instruction != null) { |
| 301 HInstruction next = instruction.next; | 301 HInstruction next = instruction.next; |
| 302 instruction.accept(this); | 302 instruction.accept(this); |
| 303 instruction = next; | 303 instruction = next; |
| 304 } | 304 } |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 } | 766 } |
| 767 | 767 |
| 768 // If [thenInput] is defined in the first predecessor, then it is only used | 768 // If [thenInput] is defined in the first predecessor, then it is only used |
| 769 // by [phi] and can be generated at use site. | 769 // by [phi] and can be generated at use site. |
| 770 if (identical(thenInput.block, end.predecessors[0])) { | 770 if (identical(thenInput.block, end.predecessors[0])) { |
| 771 assert(thenInput.usedBy.length == 1); | 771 assert(thenInput.usedBy.length == 1); |
| 772 markAsGenerateAtUseSite(thenInput); | 772 markAsGenerateAtUseSite(thenInput); |
| 773 } | 773 } |
| 774 } | 774 } |
| 775 } | 775 } |
| OLD | NEW |