Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart

Issue 864293004: Add a shrinking reduction for dead continuation parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 cont = access(node.continuation); 161 String name = access(node.continuation);
162 if (node.isRecursive) name = 'rec $name';
162 String args = node.arguments.map(access).join(' '); 163 String args = node.arguments.map(access).join(' ');
163 String op = 164 return '$indentation($InvokeContinuation $name ($args))';
164 node.isRecursive ? 'InvokeContinuation*' : 'InvokeContinuation';
165 return '$indentation($op $cont ($args))';
166 } 165 }
167 166
168 String visitBranch(Branch node) { 167 String visitBranch(Branch node) {
169 String condition = visit(node.condition); 168 String condition = visit(node.condition);
170 String trueCont = access(node.trueContinuation); 169 String trueCont = access(node.trueContinuation);
171 String falseCont = access(node.falseContinuation); 170 String falseCont = access(node.falseContinuation);
172 return '$indentation(Branch $condition $trueCont $falseCont)'; 171 return '$indentation(Branch $condition $trueCont $falseCont)';
173 } 172 }
174 173
175 String visitConstant(Constant node) { 174 String visitConstant(Constant node) {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 void setReturnContinuation(Continuation node) { 366 void setReturnContinuation(Continuation node) {
368 assert(!_names.containsKey(node) || _names[node] == 'return'); 367 assert(!_names.containsKey(node) || _names[node] == 'return');
369 _names[node] = 'return'; 368 _names[node] = 'return';
370 } 369 }
371 370
372 String getName(Node node) { 371 String getName(Node node) {
373 assert(_names.containsKey(node)); 372 assert(_names.containsKey(node));
374 return _names[node]; 373 return _names[node];
375 } 374 }
376 } 375 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698