| 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/universe.dart' show Selector, CallStructure; | 10 import '../universe/call_structure.dart' show |
| 11 CallStructure; |
| 12 import '../universe/selector.dart' show |
| 13 Selector; |
| 11 | 14 |
| 12 /// A [Decorator] is a function used by [SExpressionStringifier] to augment the | 15 /// 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 | 16 /// output produced for a node or reference. It can be provided to the |
| 14 /// constructor. | 17 /// constructor. |
| 15 typedef String Decorator(node, String s); | 18 typedef String Decorator(node, String s); |
| 16 | 19 |
| 17 /// Generate a Lisp-like S-expression representation of an IR node as a string. | 20 /// Generate a Lisp-like S-expression representation of an IR node as a string. |
| 18 class SExpressionStringifier extends Indentation implements Visitor<String> { | 21 class SExpressionStringifier extends Indentation implements Visitor<String> { |
| 19 final _Namer namer = new _Namer(); | 22 final _Namer namer = new _Namer(); |
| 20 | 23 |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 void setReturnContinuation(Continuation node) { | 478 void setReturnContinuation(Continuation node) { |
| 476 assert(!_names.containsKey(node) || _names[node] == 'return'); | 479 assert(!_names.containsKey(node) || _names[node] == 'return'); |
| 477 _names[node] = 'return'; | 480 _names[node] = 'return'; |
| 478 } | 481 } |
| 479 | 482 |
| 480 String getName(Node node) { | 483 String getName(Node node) { |
| 481 if (!_names.containsKey(node)) return 'MISSING_NAME'; | 484 if (!_names.containsKey(node)) return 'MISSING_NAME'; |
| 482 return _names[node]; | 485 return _names[node]; |
| 483 } | 486 } |
| 484 } | 487 } |
| OLD | NEW |