| 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) {
|
|
|