OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library tree_ir_tracer; | 5 library tree_ir_tracer; |
6 | 6 |
7 import 'dart:async' show EventSink; | 7 import 'dart:async' show EventSink; |
8 import '../tracer.dart'; | 8 import '../tracer.dart'; |
9 import 'tree_ir_nodes.dart'; | 9 import 'tree_ir_nodes.dart'; |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 visitThrow(Throw node) { | 81 visitThrow(Throw node) { |
82 _addStatement(node); | 82 _addStatement(node); |
83 } | 83 } |
84 | 84 |
85 visitRethrow(Rethrow node) { | 85 visitRethrow(Rethrow node) { |
86 _addStatement(node); | 86 _addStatement(node); |
87 } | 87 } |
88 | 88 |
| 89 visitUnreachable(Unreachable node) { |
| 90 _addStatement(node); |
| 91 } |
| 92 |
89 visitBreak(Break node) { | 93 visitBreak(Break node) { |
90 _addStatement(node); | 94 _addStatement(node); |
91 blocks.last.addEdgeTo(breakTargets[node.target]); | 95 blocks.last.addEdgeTo(breakTargets[node.target]); |
92 } | 96 } |
93 | 97 |
94 visitContinue(Continue node) { | 98 visitContinue(Continue node) { |
95 _addStatement(node); | 99 _addStatement(node); |
96 blocks.last.addEdgeTo(continueTargets[node.target]); | 100 blocks.last.addEdgeTo(continueTargets[node.target]); |
97 } | 101 } |
98 | 102 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 } | 258 } |
255 | 259 |
256 visitThrow(Throw node) { | 260 visitThrow(Throw node) { |
257 printStatement(null, "throw ${expr(node.value)}"); | 261 printStatement(null, "throw ${expr(node.value)}"); |
258 } | 262 } |
259 | 263 |
260 visitRethrow(Rethrow node) { | 264 visitRethrow(Rethrow node) { |
261 printStatement(null, "rethrow"); | 265 printStatement(null, "rethrow"); |
262 } | 266 } |
263 | 267 |
| 268 visitUnreachable(Unreachable node) { |
| 269 printStatement(null, "unreachable"); |
| 270 } |
| 271 |
264 visitBreak(Break node) { | 272 visitBreak(Break node) { |
265 printStatement(null, "break ${collector.breakTargets[node.target].name}"); | 273 printStatement(null, "break ${collector.breakTargets[node.target].name}"); |
266 } | 274 } |
267 | 275 |
268 visitContinue(Continue node) { | 276 visitContinue(Continue node) { |
269 printStatement(null, | 277 printStatement(null, |
270 "continue ${collector.continueTargets[node.target].name}"); | 278 "continue ${collector.continueTargets[node.target].name}"); |
271 } | 279 } |
272 | 280 |
273 visitIf(If node) { | 281 visitIf(If node) { |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 String prefix = v.element == null ? 'v' : '${v.element.name}_'; | 529 String prefix = v.element == null ? 'v' : '${v.element.name}_'; |
522 while (name == null || _usedNames.contains(name)) { | 530 while (name == null || _usedNames.contains(name)) { |
523 name = "$prefix${_counter++}"; | 531 name = "$prefix${_counter++}"; |
524 } | 532 } |
525 _names[v] = name; | 533 _names[v] = name; |
526 _usedNames.add(name); | 534 _usedNames.add(name); |
527 } | 535 } |
528 return name; | 536 return name; |
529 } | 537 } |
530 } | 538 } |
OLD | NEW |