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

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

Issue 2045223002: Compute and cache element NativeBehavior during resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Temporarily skip compilation subtest 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 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/resolution/registry.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 f38ccc43f10663e59d0e43ec2f63206d2c9ead90..63b601d898b3c905a0ce96b43c5b7e28f7af1b92 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -34,19 +34,17 @@ class NativeEnqueuer {
/// types to the world.
void registerNativeBehavior(NativeBehavior nativeBehavior, cause) {}
- /// Notification of a main Enqueuer worklist element. For methods, adds
- /// information from metadata attributes, and computes types instantiated due
- /// to calling the method.
- void registerElement(Element element) {}
-
- /// Notification of native field. Adds information from metadata attributes.
+ // TODO(johnniwinther): Move [handleFieldAnnotations] and
+ // [handleMethodAnnotations] to [JavaScriptBackend] or [NativeData].
+ // TODO(johnniwinther): Change the return type to 'bool' and rename them to
+ // something like `computeNativeField`.
+ /// Process the potentially native [field]. Adds information from metadata
+ /// attributes.
void handleFieldAnnotations(Element field) {}
- /// Computes types instantiated due to getting a native field.
- void registerFieldLoad(Element field) {}
-
- /// Computes types instantiated due to setting a native field.
- void registerFieldStore(Element field) {}
+ /// Process the potentially native [method]. Adds information from metadata
+ /// attributes.
+ void handleMethodAnnotations(Element method) {}
/// Returns whether native classes are being used.
bool hasInstantiatedNativeClasses() => false;
@@ -371,26 +369,6 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
}
}
- registerElement(Element element) {
- reporter.withCurrentElement(element, () {
- if (element.isFunction ||
- element.isFactoryConstructor ||
- element.isGetter ||
- element.isSetter) {
- handleMethodAnnotations(element);
- if (backend.isNative(element)) {
- registerMethodUsed(element);
- }
- } else if (element.isField) {
- handleFieldAnnotations(element);
- if (backend.isNative(element)) {
- registerFieldLoad(element);
- registerFieldStore(element);
- }
- }
- });
- }
-
void handleFieldAnnotations(Element element) {
if (compiler.serialization.isDeserialized(element)) {
return;
@@ -475,18 +453,6 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
flushQueue();
}
- void registerMethodUsed(Element method) {
- registerNativeBehavior(NativeBehavior.ofMethod(method, compiler), method);
- }
-
- void registerFieldLoad(Element field) {
- registerNativeBehavior(NativeBehavior.ofFieldLoad(field, compiler), field);
- }
-
- void registerFieldStore(Element field) {
- registerNativeBehavior(NativeBehavior.ofFieldStore(field, compiler), field);
- }
-
processNativeBehavior(NativeBehavior behavior, cause) {
// TODO(ahe): Is this really a global dependency?
Registry registry = compiler.globalDependencies;
« no previous file with comments | « pkg/compiler/lib/src/native/behavior.dart ('k') | pkg/compiler/lib/src/resolution/registry.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698