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 | 10 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } | 196 } |
197 | 197 |
198 String visitBranch(Branch node) { | 198 String visitBranch(Branch node) { |
199 String condition = visit(node.condition); | 199 String condition = visit(node.condition); |
200 String trueCont = access(node.trueContinuation); | 200 String trueCont = access(node.trueContinuation); |
201 String falseCont = access(node.falseContinuation); | 201 String falseCont = access(node.falseContinuation); |
202 return '$indentation(Branch $condition $trueCont $falseCont)'; | 202 return '$indentation(Branch $condition $trueCont $falseCont)'; |
203 } | 203 } |
204 | 204 |
205 String visitConstant(Constant node) { | 205 String visitConstant(Constant node) { |
206 String value = | 206 String value = node.value.accept(new ConstantStringifier(), null); |
207 node.expression.value.accept(new ConstantStringifier(), null); | |
208 return '(Constant $value)'; | 207 return '(Constant $value)'; |
209 } | 208 } |
210 | 209 |
211 String visitCreateFunction(CreateFunction node) { | 210 String visitCreateFunction(CreateFunction node) { |
212 String function = | 211 String function = |
213 indentBlock(() => indentBlock(() => visit(node.definition))); | 212 indentBlock(() => indentBlock(() => visit(node.definition))); |
214 return '(CreateFunction\n$function)'; | 213 return '(CreateFunction\n$function)'; |
215 } | 214 } |
216 | 215 |
217 String visitContinuation(Continuation node) { | 216 String visitContinuation(Continuation node) { |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 void setReturnContinuation(Continuation node) { | 437 void setReturnContinuation(Continuation node) { |
439 assert(!_names.containsKey(node) || _names[node] == 'return'); | 438 assert(!_names.containsKey(node) || _names[node] == 'return'); |
440 _names[node] = 'return'; | 439 _names[node] = 'return'; |
441 } | 440 } |
442 | 441 |
443 String getName(Node node) { | 442 String getName(Node node) { |
444 if (!_names.containsKey(node)) return 'MISSING_NAME'; | 443 if (!_names.containsKey(node)) return 'MISSING_NAME'; |
445 return _names[node]; | 444 return _names[node]; |
446 } | 445 } |
447 } | 446 } |
OLD | NEW |