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

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

Issue 1352533002: Enqueue superclasses instead of supertypes. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Unify native behavior processing Created 5 years, 3 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/js_backend/backend.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 3de82e038c447d186b439e17d0ddcb7fadc13b25..5a5a199fb673a30bf2047a2059a23f6255c3638c 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -11,6 +11,10 @@ class NativeEnqueuer {
/// Initial entry point to native enqueuer.
void processNativeClasses(Iterable<LibraryElement> libraries) {}
+ /// Registers the [nativeBehavior]. Adds the liveness of its instantiated
+ /// 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.
@@ -468,48 +472,41 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
});
}
+ void registerNativeBehavior(NativeBehavior nativeBehavior, cause) {
+ processNativeBehavior(nativeBehavior, cause);
+ flushQueue();
+ }
+
void registerMethodUsed(Element method) {
- processNativeBehavior(
- NativeBehavior.ofMethod(method, compiler),
- method);
- flushQueue();
+ registerNativeBehavior(NativeBehavior.ofMethod(method, compiler), method);
}
void registerFieldLoad(Element field) {
- processNativeBehavior(
- NativeBehavior.ofFieldLoad(field, compiler),
- field);
- flushQueue();
+ registerNativeBehavior(NativeBehavior.ofFieldLoad(field, compiler), field);
}
void registerFieldStore(Element field) {
- processNativeBehavior(
- NativeBehavior.ofFieldStore(field, compiler),
- field);
- flushQueue();
+ registerNativeBehavior(NativeBehavior.ofFieldStore(field, compiler), field);
}
void registerJsCall(Send node, ResolverVisitor resolver) {
NativeBehavior behavior = NativeBehavior.ofJsCall(node, compiler, resolver);
- processNativeBehavior(behavior, node);
+ registerNativeBehavior(behavior, node);
nativeBehaviors[node] = behavior;
- flushQueue();
}
void registerJsEmbeddedGlobalCall(Send node, ResolverVisitor resolver) {
NativeBehavior behavior =
NativeBehavior.ofJsEmbeddedGlobalCall(node, compiler, resolver);
- processNativeBehavior(behavior, node);
+ registerNativeBehavior(behavior, node);
nativeBehaviors[node] = behavior;
- flushQueue();
}
void registerJsBuiltinCall(Send node, ResolverVisitor resolver) {
NativeBehavior behavior =
NativeBehavior.ofJsBuiltinCall(node, compiler, resolver);
- processNativeBehavior(behavior, node);
+ registerNativeBehavior(behavior, node);
nativeBehaviors[node] = behavior;
- flushQueue();
}
NativeBehavior getNativeBehaviorOf(Send node) => nativeBehaviors[node];
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/resolution/registry.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698