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

Side by Side Diff: pkg/compiler/lib/src/inferrer/inferrer_engine.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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart'; 8 import '../common/names.dart';
9 import '../compiler.dart'; 9 import '../compiler.dart';
10 import '../constants/expressions.dart'; 10 import '../constants/expressions.dart';
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return element is MemberElement && 95 return element is MemberElement &&
96 optimizerHints.trustTypeAnnotations(element); 96 optimizerHints.trustTypeAnnotations(element);
97 } 97 }
98 98
99 /** 99 /**
100 * Applies [f] to all elements in the universe that match 100 * Applies [f] to all elements in the universe that match
101 * [selector] and [mask]. If [f] returns false, aborts the iteration. 101 * [selector] and [mask]. If [f] returns false, aborts the iteration.
102 */ 102 */
103 void forEachElementMatching( 103 void forEachElementMatching(
104 Selector selector, TypeMask mask, bool f(Element element)) { 104 Selector selector, TypeMask mask, bool f(Element element)) {
105 Iterable<MemberEntity> elements = 105 Iterable<MemberEntity> elements = closedWorld.locateMembers(selector, mask);
106 closedWorld.allFunctions.filter(selector, mask);
107 for (MemberElement e in elements) { 106 for (MemberElement e in elements) {
108 if (!f(e.implementation)) return; 107 if (!f(e.implementation)) return;
109 } 108 }
110 } 109 }
111 110
112 // TODO(johnniwinther): Make this private again. 111 // TODO(johnniwinther): Make this private again.
113 GlobalTypeInferenceElementData dataOf(AstElement element) => inTreeData 112 GlobalTypeInferenceElementData dataOf(AstElement element) => inTreeData
114 .putIfAbsent(element, () => new GlobalTypeInferenceElementData()); 113 .putIfAbsent(element, () => new GlobalTypeInferenceElementData());
115 114
116 /** 115 /**
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 TypeInformation receiverType, 890 TypeInformation receiverType,
892 Element caller, 891 Element caller,
893 ArgumentsTypes arguments, 892 ArgumentsTypes arguments,
894 SideEffects sideEffects, 893 SideEffects sideEffects,
895 bool inLoop) { 894 bool inLoop) {
896 if (selector.isClosureCall) { 895 if (selector.isClosureCall) {
897 return registerCalledClosure(node, selector, mask, receiverType, caller, 896 return registerCalledClosure(node, selector, mask, receiverType, caller,
898 arguments, sideEffects, inLoop); 897 arguments, sideEffects, inLoop);
899 } 898 }
900 899
901 closedWorld.allFunctions 900 closedWorld.locateMembers(selector, mask).forEach((MemberElement callee) {
902 .filter(selector, mask)
903 .forEach((MemberElement callee) {
904 updateSideEffects(sideEffects, selector, callee); 901 updateSideEffects(sideEffects, selector, callee);
905 }); 902 });
906 903
907 CallSiteTypeInformation info = new DynamicCallSiteTypeInformation( 904 CallSiteTypeInformation info = new DynamicCallSiteTypeInformation(
908 types.currentMember, 905 types.currentMember,
909 node, 906 node,
910 caller, 907 caller,
911 selector, 908 selector,
912 mask, 909 mask,
913 receiverType, 910 receiverType,
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 /** 1083 /**
1087 * Records that the captured variable [local] is read. 1084 * Records that the captured variable [local] is read.
1088 */ 1085 */
1089 void recordCapturedLocalRead(Local local) {} 1086 void recordCapturedLocalRead(Local local) {}
1090 1087
1091 /** 1088 /**
1092 * Records that the variable [local] is being updated. 1089 * Records that the variable [local] is being updated.
1093 */ 1090 */
1094 void recordLocalUpdate(Local local, TypeInformation type) {} 1091 void recordLocalUpdate(Local local, TypeInformation type) {}
1095 } 1092 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698