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

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

Issue 2841583002: Add FrontEndStrategy, ResolutionFrontEndStrategy and KernelFrontEndStrategy (Closed)
Patch Set: 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
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..57237c0a9936711955e5cb38fbfeca26771f89b7 100644
--- a/pkg/compiler/lib/src/native/resolver.dart
+++ b/pkg/compiler/lib/src/native/resolver.dart
@@ -26,20 +26,12 @@ 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 {
Siggi Cherem (dart-lang) 2017/04/24 19:36:47 maybe this class shouldn't be here? move to builde
Johnni Winther 2017/04/25 07:52:51 Moved to frontend_strategy
- 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);
@@ -47,46 +39,6 @@ abstract class AnnotationProcessor {
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 {

Powered by Google App Engine
This is Rietveld 408576698