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

Unified Diff: pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart

Issue 1068243002: Overhaul tree IR visitor and rename IR classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
diff --git a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
index fa60b5598482d3edd9bfa71c83ba30313ed6d34d..445838e36c2c33c2ae1edb7c82f63059b8e499e1 100644
--- a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
+++ b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
@@ -8,7 +8,7 @@ part of dart2js.cps_ir.optimizers;
* [ShrinkingReducer] applies shrinking reductions to CPS terms as described
* in 'Compiling with Continuations, Continued' by Andrew Kennedy.
*/
-class ShrinkingReducer extends PassMixin {
+class ShrinkingReducer extends Pass {
String get passName => 'Shrinking reductions';
Set<_ReductionTask> _worklist;
@@ -17,7 +17,9 @@ class ShrinkingReducer extends PassMixin {
/// Applies shrinking reductions to root, mutating root in the process.
@override
- void rewriteExecutableDefinition(ExecutableDefinition root) {
+ void rewrite(RootNode root) {
+ if (root.isEmpty) return;
+
_worklist = new Set<_ReductionTask>();
_RedexVisitor redexVisitor = new _RedexVisitor(_worklist);
@@ -464,7 +466,7 @@ class _RemovalVisitor extends RecursiveVisitor {
Continuation cont = reference.definition;
Node parent = cont.parent;
// The parent might be the deleted sentinel, or it might be a
- // RunnableBody if the continuation is the return continuation.
+ // Body if the continuation is the return continuation.
if (parent is LetCont) {
if (cont.isRecursive && cont.hasAtMostOneUse) {
// Convert recursive to nonrecursive continuations. If the
@@ -494,7 +496,7 @@ class ParentVisitor extends RecursiveVisitor {
});
}
- processRunnableBody(RunnableBody node) {
+ processBody(Body node) {
node.returnContinuation.parent = node;
node.body.parent = node;
}
@@ -516,7 +518,7 @@ class ParentVisitor extends RecursiveVisitor {
}
processSuperInitializer(SuperInitializer node) {
- node.arguments.forEach((RunnableBody argument) => argument.parent = node);
+ node.arguments.forEach((Body argument) => argument.parent = node);
}
processLetPrim(LetPrim node) {

Powered by Google App Engine
This is Rietveld 408576698