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

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

Issue 1427643009: dart2js cps: Fix bug in trampoline visitor. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
index 1df27b6739fb4e551e378f0aa142018eb6f18a1e..9c56c480ae815a023748b54acf05c05ec7d02c53 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -2067,7 +2067,9 @@ class TrampolineRecursiveVisitor extends DeepRecursiveVisitor {
if (cont.isReturnContinuation) {
traverseContinuation(cont);
} else {
- _trampoline(traverseContinuation(cont));
+ int initialHeight = _stack.length;
+ Expression body = traverseContinuation(cont);
+ _trampoline(body, initialHeight: initialHeight);
}
}
@@ -2107,8 +2109,8 @@ class TrampolineRecursiveVisitor extends DeepRecursiveVisitor {
return node.body;
}
- void _trampoline(Expression node) {
- int initialHeight = _stack.length;
+ void _trampoline(Expression node, {int initialHeight}) {
+ initialHeight = initialHeight ?? _stack.length;
_processBlock(node);
while (_stack.length > initialHeight) {
StackAction callback = _stack.removeLast();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698