| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 ssa.tracer; | 5 library ssa.tracer; |
| 6 | 6 |
| 7 import 'dart:async' show EventSink; | 7 import '../../compiler_new.dart' show OutputSink; |
| 8 | |
| 9 import '../diagnostics/invariant.dart' show DEBUG_MODE; | 8 import '../diagnostics/invariant.dart' show DEBUG_MODE; |
| 10 import '../js_backend/namer.dart' show Namer; | 9 import '../js_backend/namer.dart' show Namer; |
| 11 import '../tracer.dart'; | 10 import '../tracer.dart'; |
| 12 import '../world.dart' show ClosedWorld; | 11 import '../world.dart' show ClosedWorld; |
| 13 import 'nodes.dart'; | 12 import 'nodes.dart'; |
| 14 | 13 |
| 15 /** | 14 /** |
| 16 * Outputs SSA code in a format readable by Hydra IR. | 15 * Outputs SSA code in a format readable by Hydra IR. |
| 17 * Tracing is disabled by default, see ../tracer.dart for how | 16 * Tracing is disabled by default, see ../tracer.dart for how |
| 18 * to enable it. | 17 * to enable it. |
| 19 */ | 18 */ |
| 20 class HTracer extends HGraphVisitor with TracerUtil { | 19 class HTracer extends HGraphVisitor with TracerUtil { |
| 21 final ClosedWorld closedWorld; | 20 final ClosedWorld closedWorld; |
| 22 final Namer namer; | 21 final Namer namer; |
| 23 final EventSink<String> output; | 22 final OutputSink output; |
| 24 | 23 |
| 25 HTracer(this.output, this.closedWorld, this.namer); | 24 HTracer(this.output, this.closedWorld, this.namer); |
| 26 | 25 |
| 27 void traceGraph(String name, HGraph graph) { | 26 void traceGraph(String name, HGraph graph) { |
| 28 DEBUG_MODE = true; | 27 DEBUG_MODE = true; |
| 29 tag("cfg", () { | 28 tag("cfg", () { |
| 30 printProperty("name", name); | 29 printProperty("name", name); |
| 31 visitDominatorTree(graph); | 30 visitDominatorTree(graph); |
| 32 }); | 31 }); |
| 33 } | 32 } |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 } | 559 } |
| 561 | 560 |
| 562 String visitAwait(HAwait node) { | 561 String visitAwait(HAwait node) { |
| 563 return "Await: ${temporaryId(node.inputs[0])}"; | 562 return "Await: ${temporaryId(node.inputs[0])}"; |
| 564 } | 563 } |
| 565 | 564 |
| 566 String visitYield(HYield node) { | 565 String visitYield(HYield node) { |
| 567 return "Yield${node.hasStar ? "*" : ""}: ${temporaryId(node.inputs[0])}"; | 566 return "Yield${node.hasStar ? "*" : ""}: ${temporaryId(node.inputs[0])}"; |
| 568 } | 567 } |
| 569 } | 568 } |
| OLD | NEW |