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

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

Issue 1458703007: dart2js cps: Refactor CallExpressions into Primitives. (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
Index: pkg/compiler/lib/src/cps_ir/loop_hierarchy.dart
diff --git a/pkg/compiler/lib/src/cps_ir/loop_hierarchy.dart b/pkg/compiler/lib/src/cps_ir/loop_hierarchy.dart
index 3aa5bc9bf64e548bb6373543b869fece700db572..525ef51faa539493494f34c8a6e94242d1e2a379 100644
--- a/pkg/compiler/lib/src/cps_ir/loop_hierarchy.dart
+++ b/pkg/compiler/lib/src/cps_ir/loop_hierarchy.dart
@@ -99,29 +99,13 @@ class LoopHierarchy {
return loopTarget[cont];
}
- bool _isCallContinuation(Continuation cont) {
- return cont.hasExactlyOneUse && cont.firstRef.parent is CallExpression;
- }
-
/// Analyzes a basic block and returns the innermost loop that
/// can be invoked recursively from that block.
Continuation _processBlock(Expression node, Continuation catchLoop) {
- List<Continuation> callContinuations = <Continuation>[];
for (; node is! TailExpression; node = node.next) {
if (node is LetCont) {
for (Continuation cont in node.continuations) {
- if (!_isCallContinuation(cont)) {
- // Process non-call continuations at the binding site, so they
- // their loop target is known at all use sites.
- _processContinuation(cont, catchLoop);
- } else {
- // To avoid deep recursion, do not analyze call continuations
- // recursively. This basic block traversal steps into the
- // call contiunation after visiting its use site. We store the
- // continuations in a list so we can set the loop target once
- // it is known.
- callContinuations.add(cont);
- }
+ _processContinuation(cont, catchLoop);
}
} else if (node is LetHandler) {
catchLoop = _processContinuation(node.handler, catchLoop);
@@ -141,13 +125,6 @@ class LoopHierarchy {
} else {
assert(node is Unreachable || node is Throw);
}
- target = _markInnerLoop(target, catchLoop);
- for (Continuation cont in callContinuations) {
- // Store the loop target on each call continuation in the basic block.
- // Because we walk over call continuations as part of the basic block
- // traversal, these do not get their loop target set otherwise.
- loopTarget[cont] = target;
- }
- return target;
+ return _markInnerLoop(target, catchLoop);
}
}

Powered by Google App Engine
This is Rietveld 408576698