| 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_nodes_sexpr; | 5 library dart2js.ir_nodes_sexpr; |
| 6 | 6 |
| 7 import '../constants/values.dart'; | 7 import '../constants/values.dart'; |
| 8 import '../universe/call_structure.dart' show CallStructure; |
| 8 import '../util/util.dart'; | 9 import '../util/util.dart'; |
| 9 import 'cps_ir_nodes.dart'; | 10 import 'cps_ir_nodes.dart'; |
| 10 import '../universe/call_structure.dart' show CallStructure; | |
| 11 | 11 |
| 12 /// A [Decorator] is a function used by [SExpressionStringifier] to augment the | 12 /// A [Decorator] is a function used by [SExpressionStringifier] to augment the |
| 13 /// output produced for a node or reference. It can be provided to the | 13 /// output produced for a node or reference. It can be provided to the |
| 14 /// constructor. | 14 /// constructor. |
| 15 typedef String Decorator(node, String s); | 15 typedef String Decorator(node, String s); |
| 16 | 16 |
| 17 /// Generate a Lisp-like S-expression representation of an IR node as a string. | 17 /// Generate a Lisp-like S-expression representation of an IR node as a string. |
| 18 class SExpressionStringifier extends Indentation implements Visitor<String> { | 18 class SExpressionStringifier extends Indentation implements Visitor<String> { |
| 19 final _Namer namer = new _Namer(); | 19 final _Namer namer = new _Namer(); |
| 20 | 20 |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 void setReturnContinuation(Continuation node) { | 565 void setReturnContinuation(Continuation node) { |
| 566 assert(!_names.containsKey(node) || _names[node] == 'return'); | 566 assert(!_names.containsKey(node) || _names[node] == 'return'); |
| 567 _names[node] = 'return'; | 567 _names[node] = 'return'; |
| 568 } | 568 } |
| 569 | 569 |
| 570 String getName(Node node) { | 570 String getName(Node node) { |
| 571 if (!_names.containsKey(node)) return 'MISSING_NAME'; | 571 if (!_names.containsKey(node)) return 'MISSING_NAME'; |
| 572 return _names[node]; | 572 return _names[node]; |
| 573 } | 573 } |
| 574 } | 574 } |
| OLD | NEW |