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

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

Issue 2936683002: Revert "Separate out loop closure information." (Closed)
Patch Set: 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/builder.dart ('k') | pkg/compiler/lib/src/ssa/locals_handler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder_kernel.dart
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index e3e35021e52de0ac5dceee79dd329c49eb8bdf4a..05a110549e099d5b08286bd775cba6c1de8fe893 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -602,14 +602,10 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
ResolvedAst resolvedAst = astElement.resolvedAst;
localsHandler.closureData = newClosureData;
if (resolvedAst.kind == ResolvedAstKind.PARSED) {
- // TODO(efortuna): Take out the test below for null once we are no
- // longer dealing with the ClosureClassMap interface directly.
- if (newClosureData.capturingScopes[resolvedAst.node] != null) {
- localsHandler.enterScope(
- newClosureData.capturingScopes[resolvedAst.node],
- forGenerativeConstructorBody:
- astElement.isGenerativeConstructorBody);
- }
+ localsHandler.enterScope(
+ newClosureData.capturingScopes[resolvedAst.node],
+ forGenerativeConstructorBody:
+ astElement.isGenerativeConstructorBody);
}
}
inlinedFrom(astElement, () {
@@ -900,12 +896,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
}
loopHandler.handleLoop(
- forStatement,
- closureToClassMapper.getClosureRepresentationInfoForLoop(forStatement),
- buildInitializer,
- buildCondition,
- buildUpdate,
- buildBody);
+ forStatement, buildInitializer, buildCondition, buildUpdate, buildBody);
}
@override
@@ -1027,14 +1018,8 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
localsHandler.updateLocal(indexVariable, addInstruction);
}
- loopHandler.handleLoop(
- forInStatement,
- closureToClassMapper
- .getClosureRepresentationInfoForLoop(forInStatement),
- buildInitializer,
- buildCondition,
- buildUpdate,
- buildBody);
+ loopHandler.handleLoop(forInStatement, buildInitializer, buildCondition,
+ buildUpdate, buildBody);
}
_buildForInIterator(ir.ForInStatement forInStatement) {
@@ -1079,13 +1064,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
}
loopHandler.handleLoop(
- forInStatement,
- closureToClassMapper
- .getClosureRepresentationInfoForLoop(forInStatement),
- buildInitializer,
- buildCondition,
- () {},
- buildBody);
+ forInStatement, buildInitializer, buildCondition, () {}, buildBody);
}
void _buildAsyncForIn(ir.ForInStatement forInStatement) {
@@ -1125,14 +1104,8 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
// Creates a synthetic try/finally block in case anything async goes amiss.
TryCatchFinallyBuilder tryBuilder = new TryCatchFinallyBuilder(this);
// Build fake try body:
- loopHandler.handleLoop(
- forInStatement,
- closureToClassMapper
- .getClosureRepresentationInfoForLoop(forInStatement),
- buildInitializer,
- buildCondition,
- buildUpdate,
- buildBody);
+ loopHandler.handleLoop(forInStatement, buildInitializer, buildCondition,
+ buildUpdate, buildBody);
void finalizerFunction() {
_pushDynamicInvocation(forInStatement, null, [streamIterator],
@@ -1176,13 +1149,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
return popBoolified();
}
- loopHandler.handleLoop(
- whileStatement,
- closureToClassMapper
- .getClosureRepresentationInfoForLoop(whileStatement),
- () {},
- buildCondition,
- () {}, () {
+ loopHandler.handleLoop(whileStatement, () {}, buildCondition, () {}, () {
whileStatement.body.accept(this);
});
}
@@ -1192,8 +1159,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
// TODO(efortuna): I think this can be rewritten using
// LoopHandler.handleLoop with some tricks about when the "update" happens.
LocalsHandler savedLocals = new LocalsHandler.from(localsHandler);
- localsHandler.startLoop(
- closureToClassMapper.getClosureRepresentationInfoForLoop(doStatement));
+ localsHandler.startLoop(astAdapter.getNode(doStatement));
JumpHandler jumpHandler = loopHandler.beginLoopHeader(doStatement);
HLoopInformation loopInfo = current.loopInformation;
HBasicBlock loopEntryBlock = current;
@@ -1210,8 +1176,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
// Using a separate block is just a simple workaround.
bodyEntryBlock = openNewBlock();
}
- localsHandler.enterLoopBody(
- closureToClassMapper.getClosureRepresentationInfoForLoop(doStatement));
+ localsHandler.enterLoopBody(astAdapter.getNode(doStatement));
doStatement.body.accept(this);
// If there are no continues we could avoid the creation of the condition
@@ -1712,13 +1677,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
void buildLoop() {
loopHandler.handleLoop(
- switchStatement,
- closureToClassMapper
- .getClosureRepresentationInfoForLoop(switchStatement),
- () {},
- buildCondition,
- () {},
- buildSwitch);
+ switchStatement, () {}, buildCondition, () {}, buildSwitch);
}
if (hasDefault) {
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/locals_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698