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

Side by Side Diff: pkg/compiler/lib/src/common/resolution.dart

Issue 1917863002: Replace _analyzeElementEagerly with Resolution.ensureResolved (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: dartfmt Created 4 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compile_time_constants.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart2js.common.resolution; 5 library dart2js.common.resolution;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../compiler.dart' show Compiler; 8 import '../compiler.dart' show Compiler;
9 import '../constants/expressions.dart' show ConstantExpression; 9 import '../constants/expressions.dart' show ConstantExpression;
10 import '../core_types.dart' show CoreTypes; 10 import '../core_types.dart' show CoreTypes;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 /// testing. 205 /// testing.
206 bool retainCachesForTesting; 206 bool retainCachesForTesting;
207 207
208 void resolveTypedef(TypedefElement typdef); 208 void resolveTypedef(TypedefElement typdef);
209 void resolveClass(ClassElement cls); 209 void resolveClass(ClassElement cls);
210 void registerClass(ClassElement cls); 210 void registerClass(ClassElement cls);
211 void resolveMetadataAnnotation(MetadataAnnotation metadataAnnotation); 211 void resolveMetadataAnnotation(MetadataAnnotation metadataAnnotation);
212 FunctionSignature resolveSignature(FunctionElement function); 212 FunctionSignature resolveSignature(FunctionElement function);
213 DartType resolveTypeAnnotation(Element element, TypeAnnotation node); 213 DartType resolveTypeAnnotation(Element element, TypeAnnotation node);
214 214
215 /// Returns `true` if [element] has been resolved.
216 // TODO(johnniwinther): Normalize semantics between normal and deserialized
217 // elements; deserialized elements are always resolved but the method will
218 // return `false`.
215 bool hasBeenResolved(Element element); 219 bool hasBeenResolved(Element element);
216 220
221 /// Resolve [element] if it has not already been resolved.
222 void ensureResolved(Element element);
223
217 ResolutionWorkItem createWorkItem( 224 ResolutionWorkItem createWorkItem(
218 Element element, ItemCompilationContext compilationContext); 225 Element element, ItemCompilationContext compilationContext);
219 226
220 /// Returns `true` if [element] as a fully computed [ResolvedAst]. 227 /// Returns `true` if [element] as a fully computed [ResolvedAst].
221 bool hasResolvedAst(Element element); 228 bool hasResolvedAst(Element element);
222 229
223 /// Returns the `ResolvedAst` for the [element]. 230 /// Returns the `ResolvedAst` for the [element].
224 ResolvedAst getResolvedAst(Element element); 231 ResolvedAst getResolvedAst(Element element);
225 232
226 /// Returns `true` if the [ResolutionImpact] for [element] is cached. 233 /// Returns `true` if the [ResolutionImpact] for [element] is cached.
227 bool hasResolutionImpact(Element element); 234 bool hasResolutionImpact(Element element);
228 235
229 /// Returns the precomputed [ResolutionImpact] for [element]. 236 /// Returns the precomputed [ResolutionImpact] for [element].
230 ResolutionImpact getResolutionImpact(Element element); 237 ResolutionImpact getResolutionImpact(Element element);
231 238
239 /// Returns the [ResolvedAst] for [element], computing it if necessary.
240 ResolvedAst computeResolvedAst(Element element);
241
232 /// Returns the precomputed [WorldImpact] for [element]. 242 /// Returns the precomputed [WorldImpact] for [element].
233 WorldImpact getWorldImpact(Element element); 243 WorldImpact getWorldImpact(Element element);
234 244
235 /// Computes the [WorldImpact] for [element]. 245 /// Computes the [WorldImpact] for [element].
236 WorldImpact computeWorldImpact(Element element); 246 WorldImpact computeWorldImpact(Element element);
237 247
238 /// Removes the [WorldImpact] for [element] from the resolution cache. Later 248 /// Removes the [WorldImpact] for [element] from the resolution cache. Later
239 /// calls to [getWorldImpact] or [computeWorldImpact] returns an empty impact. 249 /// calls to [getWorldImpact] or [computeWorldImpact] returns an empty impact.
240 void uncacheWorldImpact(Element element); 250 void uncacheWorldImpact(Element element);
241 251
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 if (cls.isPatch) { 300 if (cls.isPatch) {
291 patchParser.parsePatchClassNode(cls); 301 patchParser.parsePatchClassNode(cls);
292 } 302 }
293 }); 303 });
294 } 304 }
295 305
296 @override 306 @override
297 ScannerOptions getScannerOptionsFor(Element element) => new ScannerOptions( 307 ScannerOptions getScannerOptionsFor(Element element) => new ScannerOptions(
298 canUseNative: backend.canLibraryUseNative(element.library)); 308 canUseNative: backend.canLibraryUseNative(element.library));
299 } 309 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compile_time_constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698