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

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

Issue 2938853004: Rename ClosureClassMaps to ClosureDataLookup (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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/dump_info.dart ('k') | pkg/compiler/lib/src/inferrer/builder_kernel.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 if (initializer == null) { 908 if (initializer == null) {
909 // Eagerly bailout, because computing the closure data only 909 // Eagerly bailout, because computing the closure data only
910 // works for functions and field assignments. 910 // works for functions and field assignments.
911 return types.nullType; 911 return types.nullType;
912 } 912 }
913 } 913 }
914 // Update the locals that are boxed in [locals]. These locals will 914 // Update the locals that are boxed in [locals]. These locals will
915 // be handled specially, in that we are computing their LUB at 915 // be handled specially, in that we are computing their LUB at
916 // each update, and reading them yields the type that was found in a 916 // each update, and reading them yields the type that was found in a
917 // previous analysis of [outermostElement]. 917 // previous analysis of [outermostElement].
918 ClosureRepresentationInfo closureData = compiler.closureToClassMapper 918 ClosureRepresentationInfo closureData = compiler.closureDataLookup
919 .getClosureRepresentationInfo(analyzedElement); 919 .getClosureRepresentationInfo(analyzedElement);
920 closureData.forEachCapturedVariable((variable, field) { 920 closureData.forEachCapturedVariable((variable, field) {
921 locals.setCaptured(variable, field); 921 locals.setCaptured(variable, field);
922 }); 922 });
923 closureData.forEachBoxedVariable((variable, field) { 923 closureData.forEachBoxedVariable((variable, field) {
924 locals.setCapturedAndBoxed(variable, field); 924 locals.setCapturedAndBoxed(variable, field);
925 }); 925 });
926 if (analyzedElement.isField) { 926 if (analyzedElement.isField) {
927 return visit(initializer); 927 return visit(initializer);
928 } 928 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 new LocalsHandler.from(locals, node, useOtherTryBlock: false); 1093 new LocalsHandler.from(locals, node, useOtherTryBlock: false);
1094 ElementGraphBuilder visitor = new ElementGraphBuilder( 1094 ElementGraphBuilder visitor = new ElementGraphBuilder(
1095 element, element.resolvedAst, compiler, inferrer, closureLocals); 1095 element, element.resolvedAst, compiler, inferrer, closureLocals);
1096 visitor.run(); 1096 visitor.run();
1097 inferrer.recordReturnType(element, visitor.returnType); 1097 inferrer.recordReturnType(element, visitor.returnType);
1098 1098
1099 // Record the types of captured non-boxed variables. Types of 1099 // Record the types of captured non-boxed variables. Types of
1100 // these variables may already be there, because of an analysis of 1100 // these variables may already be there, because of an analysis of
1101 // a previous closure. 1101 // a previous closure.
1102 ClosureRepresentationInfo nestedClosureData = 1102 ClosureRepresentationInfo nestedClosureData =
1103 compiler.closureToClassMapper.getClosureRepresentationInfo(element); 1103 compiler.closureDataLookup.getClosureRepresentationInfo(element);
1104 nestedClosureData.forEachCapturedVariable((variable, field) { 1104 nestedClosureData.forEachCapturedVariable((variable, field) {
1105 if (!nestedClosureData.isVariableBoxed(variable)) { 1105 if (!nestedClosureData.isVariableBoxed(variable)) {
1106 if (variable == nestedClosureData.thisLocal) { 1106 if (variable == nestedClosureData.thisLocal) {
1107 inferrer.recordType(field, thisType); 1107 inferrer.recordType(field, thisType);
1108 } 1108 }
1109 // The type is null for type parameters. 1109 // The type is null for type parameters.
1110 if (locals.locals[variable] == null) return; 1110 if (locals.locals[variable] == null) return;
1111 inferrer.recordType(field, locals.locals[variable]); 1111 inferrer.recordType(field, locals.locals[variable]);
1112 } 1112 }
1113 capturedVariables.add(variable); 1113 capturedVariables.add(variable);
(...skipping 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after
2951 Selector moveNextSelector = Selectors.moveNext; 2951 Selector moveNextSelector = Selectors.moveNext;
2952 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node); 2952 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node);
2953 2953
2954 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector, 2954 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector,
2955 iteratorMask, expressionType, new ArgumentsTypes.empty()); 2955 iteratorMask, expressionType, new ArgumentsTypes.empty());
2956 2956
2957 return handleForInLoop(node, iteratorType, currentSelector, currentMask, 2957 return handleForInLoop(node, iteratorType, currentSelector, currentMask,
2958 moveNextSelector, moveNextMask); 2958 moveNextSelector, moveNextMask);
2959 } 2959 }
2960 } 2960 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dump_info.dart ('k') | pkg/compiler/lib/src/inferrer/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698