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

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

Issue 2686533002: Refactor computation of NativeBehavior. (Closed)
Patch Set: Updated cf. comments. Created 3 years, 10 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/behavior.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/native/enqueue.dart
diff --git a/pkg/compiler/lib/src/native/enqueue.dart b/pkg/compiler/lib/src/native/enqueue.dart
index 112a85ae953d312c73084527041482413a730945..3f9610e1e33d736846e3ad06e6f38522e5c19d01 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -56,11 +56,6 @@ class NativeEnqueuer {
/// Emits a summary information using the [log] function.
void logSummary(log(message)) {}
-
- // Do not use annotations in dart2dart.
- ClassElement get annotationCreatesClass => null;
- ClassElement get annotationReturnsClass => null;
- ClassElement get annotationJsNameClass => null;
}
abstract class NativeEnqueuerBase implements NativeEnqueuer {
@@ -80,10 +75,6 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
final Compiler compiler;
final bool enableLiveTypeAnalysis;
- ClassElement _annotationCreatesClass;
- ClassElement _annotationReturnsClass;
- ClassElement _annotationJsNameClass;
-
/// Subclasses of [NativeEnqueuerBase] are constructed by the backend.
NativeEnqueuerBase(Compiler compiler, this.enableLiveTypeAnalysis)
: this.compiler = compiler;
@@ -256,34 +247,11 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
});
}
- ClassElement get annotationCreatesClass {
- findAnnotationClasses();
- return _annotationCreatesClass;
- }
-
- ClassElement get annotationReturnsClass {
- findAnnotationClasses();
- return _annotationReturnsClass;
- }
-
- ClassElement get annotationJsNameClass {
- findAnnotationClasses();
- return _annotationJsNameClass;
- }
-
- void findAnnotationClasses() {
- if (_annotationCreatesClass != null) return;
-
- _annotationCreatesClass = helpers.annotationCreatesClass;
- _annotationReturnsClass = helpers.annotationReturnsClass;
- _annotationJsNameClass = helpers.annotationJSNameClass;
- }
-
/// Returns the JSName annotation string or `null` if no JSName annotation is
/// present.
String findJsNameFromAnnotation(Element element) {
String name = null;
- ClassElement annotationClass = annotationJsNameClass;
+ ClassElement annotationClass = backend.helpers.annotationJSNameClass;
for (MetadataAnnotation annotation in element.implementation.metadata) {
annotation.ensureResolved(resolution);
ConstantValue value =
« no previous file with comments | « pkg/compiler/lib/src/native/behavior.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698