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 hide Function; |
9 import '../tracer.dart'; | 9 import '../tracer.dart'; |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 visitLetPrim(cps_ir.LetPrim node) { | 104 visitLetPrim(cps_ir.LetPrim node) { |
105 String id = names.name(node.primitive); | 105 String id = names.name(node.primitive); |
106 printStmt(id, "LetPrim $id = ${formatPrimitive(node.primitive)}"); | 106 printStmt(id, "LetPrim $id = ${formatPrimitive(node.primitive)}"); |
107 visit(node.body); | 107 visit(node.body); |
108 } | 108 } |
109 | 109 |
110 visitLetCont(cps_ir.LetCont node) { | 110 visitLetCont(cps_ir.LetCont node) { |
111 if (IR_TRACE_LET_CONT) { | 111 if (IR_TRACE_LET_CONT) { |
112 String dummy = names.name(node); | 112 String dummy = names.name(node); |
113 String ids = node.continuations.map(names.name).join(', '); | 113 |
| 114 String nameContinuation(cps_ir.Continuation cont) { |
| 115 String name = names.name(cont); |
| 116 return cont.isRecursive ? '$name*' : name; |
| 117 } |
| 118 |
| 119 String ids = node.continuations.map(nameContinuation).join(', '); |
114 printStmt(dummy, "LetCont $ids"); | 120 printStmt(dummy, "LetCont $ids"); |
115 } | 121 } |
116 visit(node.body); | 122 visit(node.body); |
117 } | 123 } |
118 | 124 |
119 visitLetHandler(cps_ir.LetHandler node) { | 125 visitLetHandler(cps_ir.LetHandler node) { |
120 if (IR_TRACE_LET_CONT) { | 126 if (IR_TRACE_LET_CONT) { |
121 String dummy = names.name(node); | 127 String dummy = names.name(node); |
122 String id = names.name(node.handler); | 128 String id = names.name(node.handler); |
123 printStmt(dummy, "LetHandler $id = <$id>"); | 129 printStmt(dummy, "LetHandler $id = <$id>"); |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 unexpectedNode(node); | 665 unexpectedNode(node); |
660 } | 666 } |
661 | 667 |
662 @override | 668 @override |
663 visitForeignCode(cps_ir.ForeignCode node) { | 669 visitForeignCode(cps_ir.ForeignCode node) { |
664 if (node.continuation != null) { | 670 if (node.continuation != null) { |
665 addEdgeToContinuation(node.continuation); | 671 addEdgeToContinuation(node.continuation); |
666 } | 672 } |
667 } | 673 } |
668 } | 674 } |
OLD | NEW |