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

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

Issue 2975573002: Lookup getClosureScope by member instead of node (Closed)
Patch Set: Cleanup Created 3 years, 5 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/js_model/closure.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.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.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 04c7eb08c4ddfa4aec47a96ddb39a393285a81dd..3f7d67f38789aeba090631bcec39572c22e349ca 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -1011,8 +1011,7 @@ class SsaAstGraphBuilder extends ast.Visitor
ScopeInfo newScopeInfo = closureDataLookup.getScopeInfo(callee);
localsHandler.scopeInfo = newScopeInfo;
if (resolvedAst.kind == ResolvedAstKind.PARSED) {
- localsHandler.enterScope(
- closureDataLookup.getClosureScope(resolvedAst.node),
+ localsHandler.enterScope(closureDataLookup.getClosureScope(callee),
forGenerativeConstructorBody: callee.isGenerativeConstructorBody);
}
buildInitializers(callee, constructorResolvedAsts, fieldValues);
@@ -1352,7 +1351,6 @@ class SsaAstGraphBuilder extends ast.Visitor
bodyCallInputs.add(interceptor);
}
bodyCallInputs.add(newObject);
- ast.Node node = constructorResolvedAst.node;
FunctionSignature functionSignature = body.functionSignature;
// Provide the parameters to the generative constructor body.
@@ -1368,7 +1366,7 @@ class SsaAstGraphBuilder extends ast.Visitor
// If there are locals that escape (ie mutated in closures), we
// pass the box to the constructor.
// The box must be passed before any type variable.
- ClosureScope scopeData = closureDataLookup.getClosureScope(node);
+ ClosureScope scopeData = closureDataLookup.getClosureScope(constructor);
if (scopeData.requiresContextBox) {
bodyCallInputs.add(localsHandler.readLocal(scopeData.context));
}
@@ -1429,7 +1427,7 @@ class SsaAstGraphBuilder extends ast.Visitor
localsHandler.startFunction(
element,
closureDataLookup.getScopeInfo(element),
- closureDataLookup.getClosureScope(node),
+ closureDataLookup.getClosureScope(element),
parameters,
isGenerativeConstructorBody: element.isGenerativeConstructorBody);
close(new HGoto()).addSuccessor(block);
@@ -1463,7 +1461,7 @@ class SsaAstGraphBuilder extends ast.Visitor
ParameterElement parameterElement = _parameterElement;
if (element.isGenerativeConstructorBody) {
if (closureDataLookup
- .getClosureScope(node)
+ .getClosureScope(element)
.isBoxed(parameterElement)) {
// The parameter will be a field in the box passed as the
// last parameter. So no need to have it.
« no previous file with comments | « pkg/compiler/lib/src/js_model/closure.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698