| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |