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

Unified Diff: pkg/compiler/lib/src/ssa/loop_handler.dart

Issue 2936693002: Reapply "Separate out loop closure information." (Closed)
Patch Set: call with ast.node instead of ir.Node until we update that path. Created 3 years, 6 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/ssa/locals_handler.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/loop_handler.dart
diff --git a/pkg/compiler/lib/src/ssa/loop_handler.dart b/pkg/compiler/lib/src/ssa/loop_handler.dart
index 6e7ad540b2594492c0e9f7f5327ea04623d86d52..c312d670f73beb57f59dc11fef58d6e4555adcaf 100644
--- a/pkg/compiler/lib/src/ssa/loop_handler.dart
+++ b/pkg/compiler/lib/src/ssa/loop_handler.dart
@@ -7,6 +7,7 @@ import 'package:kernel/ast.dart' as ir;
import '../elements/elements.dart' show JumpTarget, LabelDefinition;
import '../io/source_information.dart';
import '../tree/tree.dart' as ast;
+import '../closure.dart' show LoopClosureRepresentationInfo;
import 'builder.dart';
import 'builder_kernel.dart';
@@ -27,8 +28,8 @@ abstract class LoopHandler<T> {
/// For while loops, [initialize] and [update] are null.
/// The [condition] function must return a boolean result.
/// None of the functions must leave anything on the stack.
- void handleLoop(T loop, void initialize(), HInstruction condition(),
- void update(), void body()) {
+ void handleLoop(T loop, LoopClosureRepresentationInfo loopClosureInfo,
+ void initialize(), HInstruction condition(), void update(), void body()) {
// Generate:
// <initializer>
// loop-entry:
@@ -38,7 +39,7 @@ abstract class LoopHandler<T> {
// goto loop-entry;
// loop-exit:
- builder.localsHandler.startLoop(getNode(loop));
+ builder.localsHandler.startLoop(loopClosureInfo);
// The initializer.
SubExpression initializerGraph = null;
@@ -73,7 +74,7 @@ abstract class LoopHandler<T> {
conditionEndBlock.addSuccessor(beginBodyBlock);
builder.open(beginBodyBlock);
- builder.localsHandler.enterLoopBody(getNode(loop));
+ builder.localsHandler.enterLoopBody(loopClosureInfo);
body();
SubGraph bodyGraph = new SubGraph(beginBodyBlock, builder.lastOpenedBlock);
@@ -122,7 +123,7 @@ abstract class LoopHandler<T> {
updateBlock);
}
- builder.localsHandler.enterLoopUpdates(getNode(loop));
+ builder.localsHandler.enterLoopUpdates(loopClosureInfo);
update();
@@ -287,9 +288,6 @@ abstract class LoopHandler<T> {
/// Returns the jump target defined by [node].
JumpTarget getTargetDefinition(T node);
- /// Returns the corresponding AST node for [node].
- ast.Node getNode(T node);
-
/// Determine what kind of loop [node] represents.
///
/// The result is one of the kinds defined in [HLoopBlockInformation].
@@ -321,9 +319,6 @@ class SsaLoopHandler extends LoopHandler<ast.Node> {
return builder.elements.getTargetDefinition(node);
}
- @override
- ast.Node getNode(ast.Node node) => node;
-
@override
int loopKind(ast.Node node) => node.accept(const _SsaLoopTypeVisitor());
@@ -363,9 +358,6 @@ class KernelLoopHandler extends LoopHandler<ir.TreeNode> {
JumpHandler createJumpHandler(ir.TreeNode node, {bool isLoopJump}) =>
builder.createJumpHandler(node, isLoopJump: isLoopJump);
- @override
- ast.Node getNode(ir.TreeNode node) => astAdapter.getNode(node);
-
@override
JumpTarget getTargetDefinition(ir.TreeNode node) =>
astAdapter.getJumpTarget(node);
« no previous file with comments | « pkg/compiler/lib/src/ssa/locals_handler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698