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

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

Issue 1021813002: Redo "Use an explicit 'this' parameter instead of 'This' nodes." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 part of dart2js.cps_ir.optimizers; 5 part of dart2js.cps_ir.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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 } 479 }
480 } 480 }
481 } 481 }
482 } 482 }
483 } 483 }
484 484
485 /// Traverses the CPS term and sets node.parent for each visited node. 485 /// Traverses the CPS term and sets node.parent for each visited node.
486 class ParentVisitor extends RecursiveVisitor { 486 class ParentVisitor extends RecursiveVisitor {
487 processFunctionDefinition(FunctionDefinition node) { 487 processFunctionDefinition(FunctionDefinition node) {
488 node.body.parent = node; 488 node.body.parent = node;
489 if (node.thisParameter != null) node.thisParameter.parent = node;
489 int index = 0; 490 int index = 0;
490 node.parameters.forEach((Definition parameter) { 491 node.parameters.forEach((Definition parameter) {
491 parameter.parent = node; 492 parameter.parent = node;
492 if (parameter is Parameter) parameter.parentIndex = index++; 493 if (parameter is Parameter) parameter.parentIndex = index++;
493 }); 494 });
494 } 495 }
495 496
496 processRunnableBody(RunnableBody node) { 497 processRunnableBody(RunnableBody node) {
497 node.returnContinuation.parent = node; 498 node.returnContinuation.parent = node;
498 node.body.parent = node; 499 node.body.parent = node;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 } 709 }
709 710
710 String toString() => "$kind: $node"; 711 String toString() => "$kind: $node";
711 } 712 }
712 713
713 /// A dummy class used solely to mark nodes as deleted once they are removed 714 /// A dummy class used solely to mark nodes as deleted once they are removed
714 /// from a term. 715 /// from a term.
715 class _DeletedNode extends Node { 716 class _DeletedNode extends Node {
716 accept(_) => null; 717 accept(_) => null;
717 } 718 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698