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

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

Issue 2045223002: Compute and cache element NativeBehavior during resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cleanup. Created 4 years, 6 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) 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 CoreClasses, CoreTypes; 10 import '../core_types.dart' show CoreClasses, CoreTypes;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 /// Returns the [ResolutionImpact] for [element]. 195 /// Returns the [ResolutionImpact] for [element].
196 ResolutionImpact getResolutionImpact(Element element); 196 ResolutionImpact getResolutionImpact(Element element);
197 } 197 }
198 198
199 /// Interface defining target-specific behavior for resolution. 199 /// Interface defining target-specific behavior for resolution.
200 abstract class Target { 200 abstract class Target {
201 /// Returns `true` if [library] is a target specific library whose members 201 /// Returns `true` if [library] is a target specific library whose members
202 /// have special treatment, such as being allowed to extends blacklisted 202 /// have special treatment, such as being allowed to extends blacklisted
203 /// classes or members being eagerly resolved. 203 /// classes or members being eagerly resolved.
204 bool isTargetSpecificLibrary(LibraryElement element); 204 bool isTargetSpecificLibrary(LibraryElement element);
205
206 /// Resolve target specific information for [element] and register it with
207 /// [registry].
208 void resolveNativeElement(Element element, NativeRegistry registry) {}
205 } 209 }
206 210
207 // TODO(johnniwinther): Rename to `Resolver` or `ResolverContext`. 211 // TODO(johnniwinther): Rename to `Resolver` or `ResolverContext`.
208 abstract class Resolution implements Frontend { 212 abstract class Resolution implements Frontend {
209 ParsingContext get parsingContext; 213 ParsingContext get parsingContext;
210 DiagnosticReporter get reporter; 214 DiagnosticReporter get reporter;
211 CoreClasses get coreClasses; 215 CoreClasses get coreClasses;
212 CoreTypes get coreTypes; 216 CoreTypes get coreTypes;
213 Types get types; 217 Types get types;
214 Target get target; 218 Target get target;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 if (cls.isPatch) { 321 if (cls.isPatch) {
318 patchParser.parsePatchClassNode(cls); 322 patchParser.parsePatchClassNode(cls);
319 } 323 }
320 }); 324 });
321 } 325 }
322 326
323 @override 327 @override
324 ScannerOptions getScannerOptionsFor(Element element) => new ScannerOptions( 328 ScannerOptions getScannerOptionsFor(Element element) => new ScannerOptions(
325 canUseNative: backend.canLibraryUseNative(element.library)); 329 canUseNative: backend.canLibraryUseNative(element.library));
326 } 330 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698