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

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

Issue 2860733002: Remove ClosedWorld.allFunctions (Closed)
Patch Set: Created 3 years, 7 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 ClosureClassMap; 7 import '../closure.dart' show ClosureClassMap;
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 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 ArgumentsTypes arguments = new ArgumentsTypes([rhsType], null); 1981 ArgumentsTypes arguments = new ArgumentsTypes([rhsType], null);
1982 if (Elements.isMalformed(element)) { 1982 if (Elements.isMalformed(element)) {
1983 // Code will always throw. 1983 // Code will always throw.
1984 } else if (Elements.isStaticOrTopLevelField(element)) { 1984 } else if (Elements.isStaticOrTopLevelField(element)) {
1985 handleStaticSend(node, setterSelector, setterMask, element, arguments); 1985 handleStaticSend(node, setterSelector, setterMask, element, arguments);
1986 } else if (Elements.isUnresolved(element) || element.isSetter) { 1986 } else if (Elements.isUnresolved(element) || element.isSetter) {
1987 if (analyzedElement.isGenerativeConstructor && 1987 if (analyzedElement.isGenerativeConstructor &&
1988 (node.asSendSet() != null) && 1988 (node.asSendSet() != null) &&
1989 (node.asSendSet().receiver != null) && 1989 (node.asSendSet().receiver != null) &&
1990 node.asSendSet().receiver.isThis()) { 1990 node.asSendSet().receiver.isThis()) {
1991 Iterable<MemberEntity> targets = closedWorld.allFunctions.filter( 1991 Iterable<MemberEntity> targets = closedWorld.locateMembers(
1992 setterSelector, types.newTypedSelector(thisType, setterMask)); 1992 setterSelector, types.newTypedSelector(thisType, setterMask));
1993 // We just recognized a field initialization of the form: 1993 // We just recognized a field initialization of the form:
1994 // `this.foo = 42`. If there is only one target, we can update 1994 // `this.foo = 42`. If there is only one target, we can update
1995 // its type. 1995 // its type.
1996 if (targets.length == 1) { 1996 if (targets.length == 1) {
1997 MemberElement single = targets.first; 1997 MemberElement single = targets.first;
1998 if (single.isField) { 1998 if (single.isField) {
1999 locals.updateField(single, rhsType); 1999 locals.updateField(single, rhsType);
2000 } 2000 }
2001 } 2001 }
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
2947 Selector moveNextSelector = Selectors.moveNext; 2947 Selector moveNextSelector = Selectors.moveNext;
2948 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node); 2948 TypeMask moveNextMask = inTreeData.typeOfIteratorMoveNext(node);
2949 2949
2950 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector, 2950 TypeInformation iteratorType = handleDynamicSend(node, iteratorSelector,
2951 iteratorMask, expressionType, new ArgumentsTypes.empty()); 2951 iteratorMask, expressionType, new ArgumentsTypes.empty());
2952 2952
2953 return handleForInLoop(node, iteratorType, currentSelector, currentMask, 2953 return handleForInLoop(node, iteratorType, currentSelector, currentMask,
2954 moveNextSelector, moveNextMask); 2954 moveNextSelector, moveNextMask);
2955 } 2955 }
2956 } 2956 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698