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

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

Issue 1251083002: dart2js cps: Avoid deep recursion using trampolines and basic blocks. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 5 years, 5 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
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/mutable_ssa.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/mutable_ssa.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698