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

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

Issue 2928063002: Separate out ClosureAnalysisInfo to separate interfaces between what (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
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 57aabba6381bd44df6869b672aa2e354317cf68a..761584f47651ee71626af34fe16095a890c44172 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -1376,8 +1376,6 @@ class SsaBuilder extends ast.Visitor
}
bodyCallInputs.add(newObject);
ast.Node node = constructorResolvedAst.node;
- ClosureClassMap parameterClosureData =
- closureToClassMapper.getMemberMap(constructor);
FunctionSignature functionSignature = body.functionSignature;
// Provide the parameters to the generative constructor body.
@@ -1392,9 +1390,10 @@ class SsaBuilder 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 = parameterClosureData.capturingScopes[node];
- if (scopeData != null) {
- bodyCallInputs.add(localsHandler.readLocal(scopeData.boxElement));
+ ClosureAnalysisInfo scopeData =
+ closureToClassMapper.getClosureAnalysisInfo(node);
+ if (scopeData.requiresBox()) {
+ bodyCallInputs.add(localsHandler.readLocal(scopeData.context));
}
// Type variables arguments must come after the box (if there is one).
@@ -1480,11 +1479,11 @@ class SsaBuilder extends ast.Visitor
// because that is where the type guards will also be inserted.
// This way we ensure that a type guard will dominate the type
// check.
- ClosureScope scopeData = localsHandler.closureData.capturingScopes[node];
signature.orderedForEachParameter((ParameterElement parameterElement) {
if (element.isGenerativeConstructorBody) {
- if (scopeData != null &&
- scopeData.isCapturedVariable(parameterElement)) {
+ if (closureToClassMapper
+ .getClosureAnalysisInfo(node)
+ .isCaptured(parameterElement)) {
// The parameter will be a field in the box passed as the
// last parameter. So no need to have it.
return;

Powered by Google App Engine
This is Rietveld 408576698