| Index: pkg/compiler/lib/src/cps_ir/let_sinking.dart
|
| diff --git a/pkg/compiler/lib/src/cps_ir/let_sinking.dart b/pkg/compiler/lib/src/cps_ir/let_sinking.dart
|
| index c7f2c214d48c14cf6d16fe68e769c0ca124c8179..8844ae6632d86ef122500fbb6793b765fe449518 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/let_sinking.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/let_sinking.dart
|
| @@ -38,19 +38,22 @@ class LetSinker extends RecursiveVisitor implements Pass {
|
| visit(node.body);
|
| }
|
|
|
| - void visitLetPrim(LetPrim node) {
|
| - // Visit the body, wherein this primitive may be sunk to its use site.
|
| - visit(node.body);
|
| + @override
|
| + Expression traverseLetPrim(LetPrim node) {
|
| + pushAction(() {
|
| + if (node.primitive != null) {
|
| + // The primitive could not be sunk. Sink dependencies to this location.
|
| + visit(node.primitive);
|
| + } else {
|
| + // The primitive was sunk. Destroy the old LetPrim.
|
| + InteriorNode parent = node.parent;
|
| + parent.body = node.body;
|
| + node.body.parent = parent;
|
| + }
|
| + });
|
|
|
| - if (node.primitive != null) {
|
| - // The primitive could not be sunk. Sink dependencies to this location.
|
| - visit(node.primitive);
|
| - } else {
|
| - // The primitive was sunk. Destroy the old LetPrim.
|
| - InteriorNode parent = node.parent;
|
| - parent.body = node.body;
|
| - node.body.parent = parent;
|
| - }
|
| + // Visit the body, wherein this primitive may be sunk to its use site.
|
| + return node.body;
|
| }
|
|
|
| void processReference(Reference ref) {
|
|
|