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

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

Issue 756383004: Refactored treatment of closure variables in dart2js CPS. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comments Created 6 years 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 part of dart2js.optimizers; 5 part of dart2js.optimizers;
6 6
7 /** 7 /**
8 * [[ShrinkingReducer]] applies shrinking reductions to CPS terms as described 8 * [[ShrinkingReducer]] applies shrinking reductions to CPS terms as described
9 * in 'Compiling with Continuations, Continued' by Andrew Kennedy. 9 * in 'Compiling with Continuations, Continued' by Andrew Kennedy.
10 */ 10 */
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 303
304 /// Traverses the CPS term and sets node.parent for each visited node. 304 /// Traverses the CPS term and sets node.parent for each visited node.
305 class ParentVisitor extends RecursiveVisitor { 305 class ParentVisitor extends RecursiveVisitor {
306 306
307 processFieldDefinition(FieldDefinition node) { 307 processFieldDefinition(FieldDefinition node) {
308 node.body.parent = node; 308 node.body.parent = node;
309 } 309 }
310 310
311 processFunctionDefinition(FunctionDefinition node) { 311 processFunctionDefinition(FunctionDefinition node) {
312 node.body.parent = node; 312 node.body.parent = node;
313 node.parameters.forEach((Parameter p) => p.parent = node); 313 node.parameters.forEach((Definition p) => p.parent = node);
314 } 314 }
315 315
316 // Expressions. 316 // Expressions.
317 317
318 processLetPrim(LetPrim node) { 318 processLetPrim(LetPrim node) {
319 node.primitive.parent = node; 319 node.primitive.parent = node;
320 node.body.parent = node; 320 node.body.parent = node;
321 } 321 }
322 322
323 processLetCont(LetCont node) { 323 processLetCont(LetCont node) {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 } 450 }
451 451
452 String toString() => "$kind: $node"; 452 String toString() => "$kind: $node";
453 } 453 }
454 454
455 /// A dummy class used solely to mark nodes as deleted once they are removed 455 /// A dummy class used solely to mark nodes as deleted once they are removed
456 /// from a term. 456 /// from a term.
457 class _DeletedNode extends Node { 457 class _DeletedNode extends Node {
458 accept(_) => null; 458 accept(_) => null;
459 } 459 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698