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

Unified Diff: pkg/compiler/lib/src/resolution/resolution_strategy.dart

Issue 2975433002: Assert that we don't mix K and J elements (Closed)
Patch Set: Updated cf. comments Created 3 years, 5 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/native/resolver.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/resolution_strategy.dart
diff --git a/pkg/compiler/lib/src/resolution/resolution_strategy.dart b/pkg/compiler/lib/src/resolution/resolution_strategy.dart
index e805d6ba8fd1155a2d42594d27f69e718db70b16..4d8dff91b153ccf76c40fbbf13addb6bb9220183 100644
--- a/pkg/compiler/lib/src/resolution/resolution_strategy.dart
+++ b/pkg/compiler/lib/src/resolution/resolution_strategy.dart
@@ -32,6 +32,7 @@ import '../js_backend/native_data.dart';
import '../js_backend/no_such_method_registry.dart';
import '../js_backend/runtime_types.dart';
import '../library_loader.dart';
+import '../native/enqueue.dart' show NativeResolutionEnqueuer;
import '../native/resolver.dart';
import '../tree/tree.dart' show Node;
import '../serialization/task.dart';
@@ -45,7 +46,7 @@ import 'no_such_method_resolver.dart';
/// [FrontendStrategy] that loads '.dart' files and creates a resolved element
/// model using the resolver.
-class ResolutionFrontEndStrategy implements FrontendStrategy {
+class ResolutionFrontEndStrategy extends FrontendStrategyBase {
final Compiler _compiler;
final _CompilerElementEnvironment _elementEnvironment;
final CommonElements commonElements;
@@ -89,8 +90,8 @@ class ResolutionFrontEndStrategy implements FrontendStrategy {
measurer);
}
- AnnotationProcessor get annotationProcesser =>
- _annotationProcessor ??= new _ElementAnnotationProcessor(_compiler);
+ AnnotationProcessor get annotationProcesser => _annotationProcessor ??=
+ new _ElementAnnotationProcessor(_compiler, nativeBasicDataBuilder);
@override
NativeClassFinder createNativeClassFinder(NativeBasicData nativeBasicData) {
@@ -123,6 +124,8 @@ class ResolutionFrontEndStrategy implements FrontendStrategy {
NativeDataBuilder nativeDataBuilder,
InterceptorDataBuilder interceptorDataBuilder,
BackendUsageBuilder backendUsageBuilder,
+ RuntimeTypesNeedBuilder rtiNeedBuilder,
+ NativeResolutionEnqueuer nativeResolutionEnqueuer,
SelectorConstraintsStrategy selectorConstraintsStrategy) {
return new ElementResolutionWorldBuilder(
_compiler.backend,
@@ -131,6 +134,8 @@ class ResolutionFrontEndStrategy implements FrontendStrategy {
nativeDataBuilder,
interceptorDataBuilder,
backendUsageBuilder,
+ rtiNeedBuilder,
+ nativeResolutionEnqueuer,
selectorConstraintsStrategy);
}
@@ -673,39 +678,38 @@ class _CompilerElementEnvironment implements ElementEnvironment {
/// syntax), and, once resolution completes, it validates that the parsed
/// annotations correspond to the correct element.
class _ElementAnnotationProcessor implements AnnotationProcessor {
- Compiler _compiler;
+ final Compiler _compiler;
+ final NativeBasicDataBuilder _nativeBasicDataBuilder;
- _ElementAnnotationProcessor(this._compiler);
+ _ElementAnnotationProcessor(this._compiler, this._nativeBasicDataBuilder);
CommonElements get _commonElements => _compiler.resolution.commonElements;
/// Check whether [cls] has a `@Native(...)` annotation, and if so, set its
/// native name from the annotation.
- void extractNativeAnnotations(covariant LibraryElement library,
- NativeBasicDataBuilder nativeBasicDataBuilder) {
+ void extractNativeAnnotations(covariant LibraryElement library) {
library.forEachLocalMember((Element element) {
if (element.isClass) {
EagerAnnotationHandler.checkAnnotation(_compiler, element,
- new NativeAnnotationHandler(nativeBasicDataBuilder));
+ new NativeAnnotationHandler(_nativeBasicDataBuilder));
}
});
}
- void extractJsInteropAnnotations(covariant LibraryElement library,
- NativeBasicDataBuilder nativeBasicDataBuilder) {
+ void extractJsInteropAnnotations(covariant LibraryElement library) {
bool checkJsInteropAnnotation(Element element) {
return EagerAnnotationHandler.checkAnnotation(
_compiler, element, const JsInteropAnnotationHandler());
}
if (checkJsInteropAnnotation(library)) {
- nativeBasicDataBuilder.markAsJsInteropLibrary(library);
+ _nativeBasicDataBuilder.markAsJsInteropLibrary(library);
}
library.forEachLocalMember((Element element) {
if (element.isClass) {
ClassElement cls = element;
if (checkJsInteropAnnotation(element)) {
- nativeBasicDataBuilder.markAsJsInteropClass(cls);
+ _nativeBasicDataBuilder.markAsJsInteropClass(cls);
}
}
});
« no previous file with comments | « pkg/compiler/lib/src/native/resolver.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698