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

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

Issue 2854013002: Make JavaScriptBackend.processAnnotations element-model agnostic (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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 final Map<Element, GlobalTypeInferenceElementData> inTreeData = 78 final Map<Element, GlobalTypeInferenceElementData> inTreeData =
79 new Map<Element, GlobalTypeInferenceElementData>(); 79 new Map<Element, GlobalTypeInferenceElementData>();
80 80
81 InferrerEngine(this.compiler, ClosedWorld closedWorld, 81 InferrerEngine(this.compiler, ClosedWorld closedWorld,
82 this.closedWorldRefiner, this.mainElement) 82 this.closedWorldRefiner, this.mainElement)
83 : this.types = new TypeSystem(closedWorld), 83 : this.types = new TypeSystem(closedWorld),
84 this.closedWorld = closedWorld; 84 this.closedWorld = closedWorld;
85 85
86 CommonElements get commonElements => closedWorld.commonElements; 86 CommonElements get commonElements => closedWorld.commonElements;
87 87
88 /// Returns `true` if [element] has an `@AssumeDynamic()` annotation.
89 bool assumeDynamic(Element element) {
90 return element is MemberElement && annotations.assumeDynamic(element);
Siggi Cherem (dart-lang) 2017/05/02 20:04:22 nit: let's rename annotations too (optimizerHints?
Johnni Winther 2017/05/03 08:05:59 Done.
91 }
92
93 /// Returns `true` if [element] has an `@TrustTypeAnnotations()` annotation.
94 bool trustTypeAnnotations(Element element) {
95 return element is MemberElement &&
96 annotations.trustTypeAnnotations(element);
97 }
98
88 /** 99 /**
89 * Applies [f] to all elements in the universe that match 100 * Applies [f] to all elements in the universe that match
90 * [selector] and [mask]. If [f] returns false, aborts the iteration. 101 * [selector] and [mask]. If [f] returns false, aborts the iteration.
91 */ 102 */
92 void forEachElementMatching( 103 void forEachElementMatching(
93 Selector selector, TypeMask mask, bool f(Element element)) { 104 Selector selector, TypeMask mask, bool f(Element element)) {
94 Iterable<MemberEntity> elements = 105 Iterable<MemberEntity> elements =
95 closedWorld.allFunctions.filter(selector, mask); 106 closedWorld.allFunctions.filter(selector, mask);
96 for (MemberElement e in elements) { 107 for (MemberElement e in elements) {
97 if (!f(e.implementation)) return; 108 if (!f(e.implementation)) return;
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 /** 1086 /**
1076 * Records that the captured variable [local] is read. 1087 * Records that the captured variable [local] is read.
1077 */ 1088 */
1078 void recordCapturedLocalRead(Local local) {} 1089 void recordCapturedLocalRead(Local local) {}
1079 1090
1080 /** 1091 /**
1081 * Records that the variable [local] is being updated. 1092 * Records that the variable [local] is being updated.
1082 */ 1093 */
1083 void recordLocalUpdate(Local local, TypeInformation type) {} 1094 void recordLocalUpdate(Local local, TypeInformation type) {}
1084 } 1095 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698