| 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 dart2js.ir_tracer; | 5 library dart2js.ir_tracer; |
| 6 | 6 |
| 7 import 'dart:async' show EventSink; | 7 import 'dart:async' show EventSink; |
| 8 import 'cps_ir_nodes.dart' as cps_ir hide Function; | 8 import 'cps_ir_nodes.dart' as cps_ir; |
| 9 import '../tracer.dart'; | 9 import '../tracer.dart'; |
| 10 | 10 |
| 11 /** | 11 /** |
| 12 * If true, show LetCont expressions in output. | 12 * If true, show LetCont expressions in output. |
| 13 */ | 13 */ |
| 14 const bool IR_TRACE_LET_CONT = false; | 14 const bool IR_TRACE_LET_CONT = false; |
| 15 | 15 |
| 16 class IRTracer extends TracerUtil implements cps_ir.Visitor { | 16 class IRTracer extends TracerUtil implements cps_ir.Visitor { |
| 17 EventSink<String> output; | 17 EventSink<String> output; |
| 18 | 18 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 112 } |
| 113 | 113 |
| 114 visitLetCont(cps_ir.LetCont node) { | 114 visitLetCont(cps_ir.LetCont node) { |
| 115 if (IR_TRACE_LET_CONT) { | 115 if (IR_TRACE_LET_CONT) { |
| 116 String dummy = names.name(node); | 116 String dummy = names.name(node); |
| 117 | 117 |
| 118 String nameContinuation(cps_ir.Continuation cont) { | 118 String nameContinuation(cps_ir.Continuation cont) { |
| 119 String name = names.name(cont); | 119 String name = names.name(cont); |
| 120 return cont.isRecursive ? '$name*' : name; | 120 return cont.isRecursive ? '$name*' : name; |
| 121 } | 121 } |
| 122 | 122 |
| 123 String ids = node.continuations.map(nameContinuation).join(', '); | 123 String ids = node.continuations.map(nameContinuation).join(', '); |
| 124 printStmt(dummy, "LetCont $ids"); | 124 printStmt(dummy, "LetCont $ids"); |
| 125 } | 125 } |
| 126 visit(node.body); | 126 visit(node.body); |
| 127 } | 127 } |
| 128 | 128 |
| 129 visitLetHandler(cps_ir.LetHandler node) { | 129 visitLetHandler(cps_ir.LetHandler node) { |
| 130 if (IR_TRACE_LET_CONT) { | 130 if (IR_TRACE_LET_CONT) { |
| 131 String dummy = names.name(node); | 131 String dummy = names.name(node); |
| 132 String id = names.name(node.handler); | 132 String id = names.name(node.handler); |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 | 675 |
| 676 @override | 676 @override |
| 677 visitAwait(cps_ir.Await node) { | 677 visitAwait(cps_ir.Await node) { |
| 678 unexpectedNode(node); | 678 unexpectedNode(node); |
| 679 } | 679 } |
| 680 | 680 |
| 681 visitRefinement(cps_ir.Refinement node) { | 681 visitRefinement(cps_ir.Refinement node) { |
| 682 unexpectedNode(node); | 682 unexpectedNode(node); |
| 683 } | 683 } |
| 684 } | 684 } |
| OLD | NEW |