| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 void visitBasicBlock(HBasicBlock block) { | 276 void visitBasicBlock(HBasicBlock block) { |
| 277 HInstruction instruction = block.first; | 277 HInstruction instruction = block.first; |
| 278 while (instruction != null) { | 278 while (instruction != null) { |
| 279 HInstruction next = instruction.next; | 279 HInstruction next = instruction.next; |
| 280 instruction.accept(this); | 280 instruction.accept(this); |
| 281 instruction = next; | 281 instruction = next; |
| 282 } | 282 } |
| 283 } | 283 } |
| 284 | 284 |
| 285 void visitTypeKnown(HTypeKnown instruction) { | 285 void visitTypeKnown(HTypeKnown instruction) { |
| 286 for (HInstruction user in instruction.usedBy) { |
| 287 if (user is HTypeConversion) { |
| 288 user.inputType = instruction.instructionType; |
| 289 } |
| 290 } |
| 286 instruction.block.rewrite(instruction, instruction.checkedInput); | 291 instruction.block.rewrite(instruction, instruction.checkedInput); |
| 287 instruction.block.remove(instruction); | 292 instruction.block.remove(instruction); |
| 288 } | 293 } |
| 289 } | 294 } |
| 290 | 295 |
| 291 /** | 296 /** |
| 292 * Remove [HTypeConversion] instructions from the graph in '--trust-primitives' | 297 * Remove [HTypeConversion] instructions from the graph in '--trust-primitives' |
| 293 * mode. | 298 * mode. |
| 294 */ | 299 */ |
| 295 class SsaTrustedCheckRemover extends HBaseVisitor { | 300 class SsaTrustedCheckRemover extends HBaseVisitor { |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 } | 802 } |
| 798 | 803 |
| 799 // If [thenInput] is defined in the first predecessor, then it is only used | 804 // If [thenInput] is defined in the first predecessor, then it is only used |
| 800 // by [phi] and can be generated at use site. | 805 // by [phi] and can be generated at use site. |
| 801 if (identical(thenInput.block, end.predecessors[0])) { | 806 if (identical(thenInput.block, end.predecessors[0])) { |
| 802 assert(thenInput.usedBy.length == 1); | 807 assert(thenInput.usedBy.length == 1); |
| 803 markAsGenerateAtUseSite(thenInput); | 808 markAsGenerateAtUseSite(thenInput); |
| 804 } | 809 } |
| 805 } | 810 } |
| 806 } | 811 } |
| OLD | NEW |