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

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: Cleanup. 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
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..3f7490b78d7d9d1453070ee1302727834259c441 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -34,19 +34,15 @@ 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].
Harry Terkelsen 2016/06/08 16:34:42 do these do anything if the element is not native?
Johnni Winther 2016/06/10 07:58:51 Adding a TODO to make them return a bool; they act
+ /// 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 +367,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 +451,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;

Powered by Google App Engine
This is Rietveld 408576698