Chromium Code Reviews| 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 fc639442a227812c311a8ddefdb2cca163151edf..3aa5bc9bf64e548bb6373543b869fece700db572 100644 |
| --- a/pkg/compiler/lib/src/cps_ir/loop_hierarchy.dart |
| +++ b/pkg/compiler/lib/src/cps_ir/loop_hierarchy.dart |
| @@ -7,21 +7,21 @@ library dart2js.cps_ir.loop_hierarchy; |
| import 'cps_ir_nodes.dart'; |
| /// Determines the effective nesting of loops. |
| -/// |
| +/// |
| /// The effective nesting of loops is different from the lexical nesting, since |
| -/// recursive continuations can generally contain all the code following |
| +/// recursive continuations can generally contain all the code following |
| /// after the loop in addition to the looping code itself. |
| -/// |
| +/// |
| /// For example, the 'else' branch below is not effectively part of the loop: |
| -/// |
| -/// let rec kont x = |
| -/// if (<loop condition>) |
| +/// |
| +/// let rec kont x = |
| +/// if (<loop condition>) |
| /// <loop body> |
| /// InvokeContinuation kont x' |
| -/// else |
| +/// else |
| /// <after loop> |
| /// return p.foo() |
| -/// |
| +/// |
| /// We use the term "loop" to mean recursive continuation. |
| /// The `null` value is used to represent a context not part of any loop. |
| class LoopHierarchy { |
| @@ -36,7 +36,7 @@ class LoopHierarchy { |
| int currentDepth = 0; |
| /// Computes the loop hierarchy for the given function. |
| - /// |
| + /// |
| /// Parent pointers must be computed for [node]. |
| LoopHierarchy(FunctionDefinition node) { |
| _processBlock(node.body, null); |
| @@ -47,21 +47,21 @@ class LoopHierarchy { |
| return cont.isRecursive ? cont : loopTarget[cont]; |
| } |
| - /// Returns the innermost loop which the given loop is part of, other |
| + /// Returns the innermost loop which the given continuation is part of, other |
| /// than itself. |
| - Continuation getEnclosingLoop(Continuation loop) { |
| - return loopTarget[loop]; |
| + Continuation getEnclosingLoop(Continuation cont) { |
| + return loopTarget[cont]; |
|
asgerf
2015/11/05 12:13:42
The only "change" here is that we may now ask for
|
| } |
| /// Marks the innermost loop as a subloop of the other loop. |
| - /// |
| + /// |
| /// Returns the innermost loop. |
| - /// |
| + /// |
| /// Both continuations, [c1] and [c2] may be null (i.e. no loop). |
| - /// |
| + /// |
| /// A loop is said to be a subloop of an enclosing loop if it can invoke |
| /// that loop recursively. This information is stored in [loopTarget]. |
| - /// |
| + /// |
| /// This method is only invoked with two distinct loops if there is a |
| /// point that can reach a recursive invocation of both loops. |
| /// This implies that one loop is nested in the other, because they must |
| @@ -83,7 +83,7 @@ class LoopHierarchy { |
| /// Analyzes the body of [cont] and returns the innermost loop |
| /// that can be invoked recursively from [cont] (other than [cont] itself). |
| - /// |
| + /// |
| /// [catchLoop] is the innermost loop that can be invoked recursively |
| /// from the current exception handler. |
| Continuation _processContinuation(Continuation cont, Continuation catchLoop) { |