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

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

Issue 1018403002: Revert "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;
490 int index = 0; 489 int index = 0;
491 node.parameters.forEach((Definition parameter) { 490 node.parameters.forEach((Definition parameter) {
492 parameter.parent = node; 491 parameter.parent = node;
493 if (parameter is Parameter) parameter.parentIndex = index++; 492 if (parameter is Parameter) parameter.parentIndex = index++;
494 }); 493 });
495 } 494 }
496 495
497 processRunnableBody(RunnableBody node) { 496 processRunnableBody(RunnableBody node) {
498 node.returnContinuation.parent = node; 497 node.returnContinuation.parent = node;
499 node.body.parent = node; 498 node.body.parent = node;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 } 708 }
710 709
711 String toString() => "$kind: $node"; 710 String toString() => "$kind: $node";
712 } 711 }
713 712
714 /// A dummy class used solely to mark nodes as deleted once they are removed 713 /// A dummy class used solely to mark nodes as deleted once they are removed
715 /// from a term. 714 /// from a term.
716 class _DeletedNode extends Node { 715 class _DeletedNode extends Node {
717 accept(_) => null; 716 accept(_) => null;
718 } 717 }
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