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

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

Issue 1671073002: dart2js cps: Pull SetFields into field initializer arguments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Disable tracing of LetCont Created 4 years, 10 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_builder_task.dart ('k') | pkg/compiler/lib/src/cps_ir/optimizers.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/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 b0af0b99253e6a1fa3c2699e67f28acbc7820339..4395c00995b7a855765889c847b175a20726767c 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -2011,23 +2011,25 @@ abstract class BlockVisitor<T> {
/// Visits block-level nodes in lexical pre-order.
///
- /// The IR may be transformed during the traversal, but the currently
- /// visited node should not be removed, as its 'body' pointer is needed
- /// for the traversal.
+ /// Traversal continues at the original success for the current node, so:
+ /// - The current node can safely be removed.
+ /// - Nodes inserted immediately below the current node will not be seen.
+ /// - The body of the current node should not be moved/removed, as traversal
+ /// would otherwise continue into an orphaned or relocated node.
static void traverseInPreOrder(FunctionDefinition root, BlockVisitor v) {
List<Continuation> stack = <Continuation>[];
void walkBlock(InteriorNode block) {
v.visit(block);
Expression node = block.body;
- v.visit(node);
- while (node.next != null) {
+ while (node != null) {
if (node is LetCont) {
stack.addAll(node.continuations);
} else if (node is LetHandler) {
stack.add(node.handler);
}
- node = node.next;
+ Expression next = node.next;
v.visit(node);
+ node = next;
}
}
walkBlock(root);
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/compiler/lib/src/cps_ir/optimizers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698