OLD | NEW |
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 final Map<MemberElement, GlobalTypeInferenceElementData> _memberData = | 80 final Map<MemberElement, GlobalTypeInferenceElementData> _memberData = |
81 new Map<MemberElement, GlobalTypeInferenceElementData>(); | 81 new Map<MemberElement, GlobalTypeInferenceElementData>(); |
82 | 82 |
83 InferrerEngine(this.compiler, ClosedWorld closedWorld, | 83 InferrerEngine(this.compiler, ClosedWorld closedWorld, |
84 this.closedWorldRefiner, this.mainElement) | 84 this.closedWorldRefiner, this.mainElement) |
85 : this.types = new TypeSystem(closedWorld), | 85 : this.types = new TypeSystem(closedWorld), |
86 this.closedWorld = closedWorld; | 86 this.closedWorld = closedWorld; |
87 | 87 |
88 CommonElements get commonElements => closedWorld.commonElements; | 88 CommonElements get commonElements => closedWorld.commonElements; |
89 | 89 |
90 /// Returns `true` if [element] has an `@AssumeDynamic()` annotation. | |
91 bool assumeDynamic(Element element) { | |
92 return element is MemberElement && optimizerHints.assumeDynamic(element); | |
93 } | |
94 | |
95 /// Returns `true` if [element] has an `@TrustTypeAnnotations()` annotation. | |
96 bool trustTypeAnnotations(Element element) { | |
97 return element is MemberElement && | |
98 optimizerHints.trustTypeAnnotations(element); | |
99 } | |
100 | |
101 /** | 90 /** |
102 * Applies [f] to all elements in the universe that match | 91 * Applies [f] to all elements in the universe that match |
103 * [selector] and [mask]. If [f] returns false, aborts the iteration. | 92 * [selector] and [mask]. If [f] returns false, aborts the iteration. |
104 */ | 93 */ |
105 void forEachElementMatching( | 94 void forEachElementMatching( |
106 Selector selector, TypeMask mask, bool f(Element element)) { | 95 Selector selector, TypeMask mask, bool f(Element element)) { |
107 Iterable<MemberEntity> elements = closedWorld.locateMembers(selector, mask); | 96 Iterable<MemberEntity> elements = closedWorld.locateMembers(selector, mask); |
108 for (MemberElement e in elements) { | 97 for (MemberElement e in elements) { |
109 if (!f(e.implementation)) return; | 98 if (!f(e.implementation)) return; |
110 } | 99 } |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 /** | 1096 /** |
1108 * Records that the captured variable [local] is read. | 1097 * Records that the captured variable [local] is read. |
1109 */ | 1098 */ |
1110 void recordCapturedLocalRead(Local local) {} | 1099 void recordCapturedLocalRead(Local local) {} |
1111 | 1100 |
1112 /** | 1101 /** |
1113 * Records that the variable [local] is being updated. | 1102 * Records that the variable [local] is being updated. |
1114 */ | 1103 */ |
1115 void recordLocalUpdate(Local local, TypeInformation type) {} | 1104 void recordLocalUpdate(Local local, TypeInformation type) {} |
1116 } | 1105 } |
OLD | NEW |