| 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 import 'optimization/optimization.dart'; | 10 import 'optimization/optimization.dart'; |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 177 } |
| 178 | 178 |
| 179 visitSetField(SetField node) { | 179 visitSetField(SetField node) { |
| 180 _addStatement(node); | 180 _addStatement(node); |
| 181 visitStatement(node.next); | 181 visitStatement(node.next); |
| 182 } | 182 } |
| 183 | 183 |
| 184 } | 184 } |
| 185 | 185 |
| 186 class TreeTracer extends TracerUtil with StatementVisitor, PassMixin { | 186 class TreeTracer extends TracerUtil with StatementVisitor, PassMixin { |
| 187 // TODO(asgerf): Fix visitors so we don't have to use PassMixin here. |
| 188 String get passName => null; |
| 189 |
| 187 final EventSink<String> output; | 190 final EventSink<String> output; |
| 188 | 191 |
| 189 TreeTracer(this.output); | 192 TreeTracer(this.output); |
| 190 | 193 |
| 191 Names names; | 194 Names names; |
| 192 BlockCollector collector; | 195 BlockCollector collector; |
| 193 int statementCounter; | 196 int statementCounter; |
| 194 | 197 |
| 195 void traceGraph(String name, ExecutableDefinition node) { | 198 void traceGraph(String name, ExecutableDefinition node) { |
| 196 if (node is FunctionDefinition && node.isAbstract) return; | 199 if (node is FunctionDefinition && node.isAbstract) return; |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 String prefix = v.element == null ? 'v' : '${v.element.name}_'; | 512 String prefix = v.element == null ? 'v' : '${v.element.name}_'; |
| 510 while (name == null || _usedNames.contains(name)) { | 513 while (name == null || _usedNames.contains(name)) { |
| 511 name = "$prefix${_counter++}"; | 514 name = "$prefix${_counter++}"; |
| 512 } | 515 } |
| 513 _names[v] = name; | 516 _names[v] = name; |
| 514 _usedNames.add(name); | 517 _usedNames.add(name); |
| 515 } | 518 } |
| 516 return name; | 519 return name; |
| 517 } | 520 } |
| 518 } | 521 } |
| OLD | NEW |