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; | 8 import 'cps_ir_nodes.dart' as cps_ir; |
9 import '../tracer.dart'; | 9 import '../tracer.dart'; |
10 | 10 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 visitUnreachable(cps_ir.Unreachable node) { | 185 visitUnreachable(cps_ir.Unreachable node) { |
186 String dummy = names.name(node); | 186 String dummy = names.name(node); |
187 printStmt(dummy, 'Unreachable'); | 187 printStmt(dummy, 'Unreachable'); |
188 } | 188 } |
189 | 189 |
190 visitLiteralList(cps_ir.LiteralList node) { | 190 visitLiteralList(cps_ir.LiteralList node) { |
191 String values = node.values.map(formatReference).join(', '); | 191 String values = node.values.map(formatReference).join(', '); |
192 return "LiteralList ($values)"; | 192 return "LiteralList ($values)"; |
193 } | 193 } |
194 | 194 |
195 visitLiteralMap(cps_ir.LiteralMap node) { | |
196 List<String> entries = new List<String>(); | |
197 for (cps_ir.LiteralMapEntry entry in node.entries) { | |
198 String key = formatReference(entry.key); | |
199 String value = formatReference(entry.value); | |
200 entries.add("$key: $value"); | |
201 } | |
202 return "LiteralMap (${entries.join(', ')})"; | |
203 } | |
204 | |
205 visitTypeCast(cps_ir.TypeCast node) { | 195 visitTypeCast(cps_ir.TypeCast node) { |
206 String value = formatReference(node.value); | 196 String value = formatReference(node.value); |
207 String args = node.typeArguments.map(formatReference).join(', '); | 197 String args = node.typeArguments.map(formatReference).join(', '); |
208 return "TypeCast ($value ${node.dartType} ($args))"; | 198 return "TypeCast ($value ${node.dartType} ($args))"; |
209 } | 199 } |
210 | 200 |
211 visitInvokeContinuation(cps_ir.InvokeContinuation node) { | 201 visitInvokeContinuation(cps_ir.InvokeContinuation node) { |
212 String dummy = names.name(node); | 202 String dummy = names.name(node); |
213 String kont = formatReference(node.continuation); | 203 String kont = formatReference(node.continuation); |
214 String args = node.arguments.map(formatReference).join(', '); | 204 String args = node.arguments.map(formatReference).join(', '); |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 // Primitives and conditions are not visited when searching for blocks. | 561 // Primitives and conditions are not visited when searching for blocks. |
572 unexpectedNode(cps_ir.Node node) { | 562 unexpectedNode(cps_ir.Node node) { |
573 throw "The IR tracer's block collector reached an unexpected IR " | 563 throw "The IR tracer's block collector reached an unexpected IR " |
574 "instruction: $node"; | 564 "instruction: $node"; |
575 } | 565 } |
576 | 566 |
577 visitLiteralList(cps_ir.LiteralList node) { | 567 visitLiteralList(cps_ir.LiteralList node) { |
578 unexpectedNode(node); | 568 unexpectedNode(node); |
579 } | 569 } |
580 | 570 |
581 visitLiteralMap(cps_ir.LiteralMap node) { | |
582 unexpectedNode(node); | |
583 } | |
584 | |
585 visitConstant(cps_ir.Constant node) { | 571 visitConstant(cps_ir.Constant node) { |
586 unexpectedNode(node); | 572 unexpectedNode(node); |
587 } | 573 } |
588 | 574 |
589 visitGetMutable(cps_ir.GetMutable node) { | 575 visitGetMutable(cps_ir.GetMutable node) { |
590 unexpectedNode(node); | 576 unexpectedNode(node); |
591 } | 577 } |
592 | 578 |
593 visitParameter(cps_ir.Parameter node) { | 579 visitParameter(cps_ir.Parameter node) { |
594 unexpectedNode(node); | 580 unexpectedNode(node); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 } | 677 } |
692 | 678 |
693 visitBoundsCheck(cps_ir.BoundsCheck node) { | 679 visitBoundsCheck(cps_ir.BoundsCheck node) { |
694 unexpectedNode(node); | 680 unexpectedNode(node); |
695 } | 681 } |
696 | 682 |
697 visitNullCheck(cps_ir.NullCheck node) { | 683 visitNullCheck(cps_ir.NullCheck node) { |
698 unexpectedNode(node); | 684 unexpectedNode(node); |
699 } | 685 } |
700 } | 686 } |
OLD | NEW |