| 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 '../util/util.dart'; | 8 import '../util/util.dart'; |
| 9 import 'cps_ir_nodes.dart'; | 9 import 'cps_ir_nodes.dart'; |
| 10 import '../universe/call_structure.dart' show | 10 import '../universe/call_structure.dart' show |
| 11 CallStructure; | 11 CallStructure; |
| 12 import '../universe/selector.dart' show | |
| 13 Selector; | |
| 14 | 12 |
| 15 /// A [Decorator] is a function used by [SExpressionStringifier] to augment the | 13 /// A [Decorator] is a function used by [SExpressionStringifier] to augment the |
| 16 /// output produced for a node or reference. It can be provided to the | 14 /// output produced for a node or reference. It can be provided to the |
| 17 /// constructor. | 15 /// constructor. |
| 18 typedef String Decorator(node, String s); | 16 typedef String Decorator(node, String s); |
| 19 | 17 |
| 20 /// Generate a Lisp-like S-expression representation of an IR node as a string. | 18 /// Generate a Lisp-like S-expression representation of an IR node as a string. |
| 21 class SExpressionStringifier extends Indentation implements Visitor<String> { | 19 class SExpressionStringifier extends Indentation implements Visitor<String> { |
| 22 final _Namer namer = new _Namer(); | 20 final _Namer namer = new _Namer(); |
| 23 | 21 |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 void setReturnContinuation(Continuation node) { | 491 void setReturnContinuation(Continuation node) { |
| 494 assert(!_names.containsKey(node) || _names[node] == 'return'); | 492 assert(!_names.containsKey(node) || _names[node] == 'return'); |
| 495 _names[node] = 'return'; | 493 _names[node] = 'return'; |
| 496 } | 494 } |
| 497 | 495 |
| 498 String getName(Node node) { | 496 String getName(Node node) { |
| 499 if (!_names.containsKey(node)) return 'MISSING_NAME'; | 497 if (!_names.containsKey(node)) return 'MISSING_NAME'; |
| 500 return _names[node]; | 498 return _names[node]; |
| 501 } | 499 } |
| 502 } | 500 } |
| OLD | NEW |