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

Side by Side Diff: pkg/compiler/lib/src/inferrer/builder.dart

Issue 3002953002: Split getClosureRepresentationInfo into MemberEntity and (ir/ast) nodes (Closed)
Patch Set: Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library simple_types_inferrer; 5 library simple_types_inferrer;
6 6
7 import '../closure.dart' show ClosureRepresentationInfo; 7 import '../closure.dart' show ClosureRepresentationInfo;
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/names.dart' show Identifiers, Selectors; 9 import '../common/names.dart' show Identifiers, Selectors;
10 import '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 // works for functions and field assignments. 916 // works for functions and field assignments.
917 return types.nullType; 917 return types.nullType;
918 } 918 }
919 } 919 }
920 // Update the locals that are boxed in [locals]. These locals will 920 // Update the locals that are boxed in [locals]. These locals will
921 // be handled specially, in that we are computing their LUB at 921 // be handled specially, in that we are computing their LUB at
922 // each update, and reading them yields the type that was found in a 922 // each update, and reading them yields the type that was found in a
923 // previous analysis of [outermostElement]. 923 // previous analysis of [outermostElement].
924 ClosureRepresentationInfo closureData = compiler 924 ClosureRepresentationInfo closureData = compiler
925 .backendStrategy.closureDataLookup 925 .backendStrategy.closureDataLookup
926 .getClosureRepresentationInfo(analyzedElement); 926 .getMemberRepresentationInfo(analyzedElement);
927 closureData.forEachCapturedVariable((variable, field) { 927 closureData.forEachCapturedVariable((variable, field) {
928 locals.setCaptured(variable, field); 928 locals.setCaptured(variable, field);
929 }); 929 });
930 closureData.forEachBoxedVariable((variable, field) { 930 closureData.forEachBoxedVariable((variable, field) {
931 locals.setCapturedAndBoxed(variable, field); 931 locals.setCapturedAndBoxed(variable, field);
932 }); 932 });
933 if (analyzedElement.isField) { 933 if (analyzedElement.isField) {
934 return visit(initializer); 934 return visit(initializer);
935 } 935 }
936 936
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 ElementGraphBuilder visitor = new ElementGraphBuilder( 1113 ElementGraphBuilder visitor = new ElementGraphBuilder(
1114 element.callMethod, compiler, inferrer, closureLocals); 1114 element.callMethod, compiler, inferrer, closureLocals);
1115 visitor.run(); 1115 visitor.run();
1116 inferrer.recordReturnType(element.callMethod, visitor.returnType); 1116 inferrer.recordReturnType(element.callMethod, visitor.returnType);
1117 1117
1118 // Record the types of captured non-boxed variables. Types of 1118 // Record the types of captured non-boxed variables. Types of
1119 // these variables may already be there, because of an analysis of 1119 // these variables may already be there, because of an analysis of
1120 // a previous closure. 1120 // a previous closure.
1121 ClosureRepresentationInfo nestedClosureData = compiler 1121 ClosureRepresentationInfo nestedClosureData = compiler
1122 .backendStrategy.closureDataLookup 1122 .backendStrategy.closureDataLookup
1123 .getClosureRepresentationInfo(element); 1123 .getClosureRepresentationInfo(node);
1124 nestedClosureData.forEachCapturedVariable((variable, field) { 1124 nestedClosureData.forEachCapturedVariable((variable, field) {
1125 if (!nestedClosureData.isVariableBoxed(variable)) { 1125 if (!nestedClosureData.isVariableBoxed(variable)) {
1126 if (variable == nestedClosureData.thisLocal) { 1126 if (variable == nestedClosureData.thisLocal) {
1127 inferrer.recordTypeOfField(field, thisType); 1127 inferrer.recordTypeOfField(field, thisType);
1128 } 1128 }
1129 // The type is null for type parameters. 1129 // The type is null for type parameters.
1130 if (locals.locals[variable] == null) return; 1130 if (locals.locals[variable] == null) return;
1131 inferrer.recordTypeOfField(field, locals.locals[variable]); 1131 inferrer.recordTypeOfField(field, locals.locals[variable]);
1132 } 1132 }
1133 capturedVariables.add(variable); 1133 capturedVariables.add(variable);
(...skipping 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after
2984 node, 2984 node,
2985 iteratorSelector, 2985 iteratorSelector,
2986 iteratorMask, 2986 iteratorMask,
2987 expressionType, 2987 expressionType,
2988 new ArgumentsTypes.empty()); 2988 new ArgumentsTypes.empty());
2989 2989
2990 return handleForInLoop(node, iteratorType, currentSelector, currentMask, 2990 return handleForInLoop(node, iteratorType, currentSelector, currentMask,
2991 moveNextSelector, moveNextMask); 2991 moveNextSelector, moveNextMask);
2992 } 2992 }
2993 } 2993 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698