| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 return '$indentation(InvokeConstructor $callName $args $cont)'; | 151 return '$indentation(InvokeConstructor $callName $args $cont)'; |
| 152 } | 152 } |
| 153 | 153 |
| 154 String visitConcatenateStrings(ConcatenateStrings node) { | 154 String visitConcatenateStrings(ConcatenateStrings node) { |
| 155 String cont = access(node.continuation); | 155 String cont = access(node.continuation); |
| 156 String args = node.arguments.map(access).join(' '); | 156 String args = node.arguments.map(access).join(' '); |
| 157 return '$indentation(ConcatenateStrings ($args) $cont)'; | 157 return '$indentation(ConcatenateStrings ($args) $cont)'; |
| 158 } | 158 } |
| 159 | 159 |
| 160 String visitInvokeContinuation(InvokeContinuation node) { | 160 String visitInvokeContinuation(InvokeContinuation node) { |
| 161 String name = access(node.continuation); | 161 String cont = access(node.continuation); |
| 162 if (node.isRecursive) name = 'rec $name'; | |
| 163 String args = node.arguments.map(access).join(' '); | 162 String args = node.arguments.map(access).join(' '); |
| 164 return '$indentation($InvokeContinuation $name ($args))'; | 163 String op = |
| 164 node.isRecursive ? 'InvokeContinuation*' : 'InvokeContinuation'; |
| 165 return '$indentation($op $cont ($args))'; |
| 165 } | 166 } |
| 166 | 167 |
| 167 String visitBranch(Branch node) { | 168 String visitBranch(Branch node) { |
| 168 String condition = visit(node.condition); | 169 String condition = visit(node.condition); |
| 169 String trueCont = access(node.trueContinuation); | 170 String trueCont = access(node.trueContinuation); |
| 170 String falseCont = access(node.falseContinuation); | 171 String falseCont = access(node.falseContinuation); |
| 171 return '$indentation(Branch $condition $trueCont $falseCont)'; | 172 return '$indentation(Branch $condition $trueCont $falseCont)'; |
| 172 } | 173 } |
| 173 | 174 |
| 174 String visitConstant(Constant node) { | 175 String visitConstant(Constant node) { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 void setReturnContinuation(Continuation node) { | 367 void setReturnContinuation(Continuation node) { |
| 367 assert(!_names.containsKey(node) || _names[node] == 'return'); | 368 assert(!_names.containsKey(node) || _names[node] == 'return'); |
| 368 _names[node] = 'return'; | 369 _names[node] = 'return'; |
| 369 } | 370 } |
| 370 | 371 |
| 371 String getName(Node node) { | 372 String getName(Node node) { |
| 372 assert(_names.containsKey(node)); | 373 assert(_names.containsKey(node)); |
| 373 return _names[node]; | 374 return _names[node]; |
| 374 } | 375 } |
| 375 } | 376 } |
| OLD | NEW |