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

Unified Diff: pkg/compiler/lib/src/native/resolver.dart

Issue 2841583002: Add FrontEndStrategy, ResolutionFrontEndStrategy and KernelFrontEndStrategy (Closed)
Patch Set: Updated cf. comments Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/library_loader.dart ('k') | pkg/compiler/lib/src/resolution/resolution_strategy.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/native/resolver.dart
diff --git a/pkg/compiler/lib/src/native/resolver.dart b/pkg/compiler/lib/src/native/resolver.dart
index a90d780121fcf9d99ffd9facce05db88612d27d6..8c408a323416cf19b3d02f8fb46062c151edcb31 100644
--- a/pkg/compiler/lib/src/native/resolver.dart
+++ b/pkg/compiler/lib/src/native/resolver.dart
@@ -26,67 +26,10 @@ import '../elements/modelx.dart' show FunctionElementX, MetadataAnnotationX;
import '../elements/resolution_types.dart' show ResolutionDartType;
import '../js_backend/js_backend.dart';
import '../js_backend/native_data.dart';
-import '../kernel/world_builder.dart' show KernelAnnotationProcessor;
import '../patch_parser.dart';
import '../tree/tree.dart';
import 'behavior.dart';
-/// Class that performs the mechanics to investigate annotations in the code.
-abstract class AnnotationProcessor {
- factory AnnotationProcessor(Compiler compiler) =>
- compiler.options.loadFromDill
- // TODO(johnniwinther): Pass the [KernelWorldBuilder] to
- // [KernelAnnotationProcessor].
- ? new KernelAnnotationProcessor(null)
- : new _ElementAnnotationProcessor(compiler);
-
- void extractNativeAnnotations(
- LibraryEntity library, NativeBasicDataBuilder nativeBasicDataBuilder);
-
- void extractJsInteropAnnotations(
- LibraryEntity library, NativeBasicDataBuilder nativeBasicDataBuilder);
-}
-
-/// Original logic for annotation processing, which involves in some cases
-/// triggering pre-parsing and validation of the annotations.
-class _ElementAnnotationProcessor implements AnnotationProcessor {
- Compiler _compiler;
-
- _ElementAnnotationProcessor(this._compiler);
-
- /// Check whether [cls] has a `@Native(...)` annotation, and if so, set its
- /// native name from the annotation.
- void extractNativeAnnotations(
- LibraryElement library, NativeBasicDataBuilder nativeBasicDataBuilder) {
- library.forEachLocalMember((Element element) {
- if (element.isClass) {
- EagerAnnotationHandler.checkAnnotation(_compiler, element,
- new NativeAnnotationHandler(nativeBasicDataBuilder));
- }
- });
- }
-
- void extractJsInteropAnnotations(
- LibraryElement library, NativeBasicDataBuilder nativeBasicDataBuilder) {
- bool checkJsInteropAnnotation(Element element) {
- return EagerAnnotationHandler.checkAnnotation(
- _compiler, element, const JsInteropAnnotationHandler());
- }
-
- if (checkJsInteropAnnotation(library)) {
- nativeBasicDataBuilder.markAsJsInteropLibrary(library);
- }
- library.forEachLocalMember((Element element) {
- if (element.isClass) {
- ClassElement cls = element;
- if (checkJsInteropAnnotation(element)) {
- nativeBasicDataBuilder.markAsJsInteropClass(cls);
- }
- }
- });
- }
-}
-
/// Interface for computing native members and [NativeBehavior]s in member code
/// based on the AST.
abstract class NativeDataResolver {
@@ -320,14 +263,6 @@ class NativeDataResolverImpl implements NativeDataResolver {
}
}
-/// Check whether [cls] has a `@Native(...)` annotation, and if so, set its
-/// native name from the annotation.
-checkNativeAnnotation(Compiler compiler, ClassElement cls,
- NativeBasicDataBuilder nativeBasicDataBuilder) {
- EagerAnnotationHandler.checkAnnotation(
- compiler, cls, new NativeAnnotationHandler(nativeBasicDataBuilder));
-}
-
/// Annotation handler for pre-resolution detection of `@Native(...)`
/// annotations.
class NativeAnnotationHandler extends EagerAnnotationHandler<String> {
« no previous file with comments | « pkg/compiler/lib/src/library_loader.dart ('k') | pkg/compiler/lib/src/resolution/resolution_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698