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

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

Issue 1896843002: Store and serialize NativeBehavior in TreeElements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 52108857bd1145a4b14e66f9175976b9996a25b9..c04509b33c66d309763733cb4bdd52800d0dd3c1 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -48,8 +48,6 @@ class NativeEnqueuer {
/// Computes types instantiated due to setting a native field.
void registerFieldStore(Element field) {}
- NativeBehavior getNativeBehaviorOf(Send node) => new NativeBehavior();
-
/// Returns whether native classes are being used.
bool hasInstantiatedNativeClasses() => false;
@@ -95,10 +93,6 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
final queue = new Queue();
bool flushing = false;
- /// Maps JS foreign calls to their computed native behavior.
- final Map<Node, NativeBehavior> nativeBehaviors =
Siggi Cherem (dart-lang) 2016/04/18 16:48:54 Great to see this gone! Really nice decoupling of
Johnni Winther 2016/04/20 10:12:55 Acknowledged.
- new Map<Node, NativeBehavior>();
-
final Enqueuer world;
final Compiler compiler;
final bool enableLiveTypeAnalysis;
@@ -493,8 +487,6 @@ abstract class NativeEnqueuerBase implements NativeEnqueuer {
registerNativeBehavior(NativeBehavior.ofFieldStore(field, compiler), field);
}
- NativeBehavior getNativeBehaviorOf(Send node) => nativeBehaviors[node];
-
processNativeBehavior(NativeBehavior behavior, cause) {
// TODO(ahe): Is this really a global dependency?
Registry registry = compiler.globalDependencies;
@@ -613,11 +605,12 @@ class NativeResolutionEnqueuer extends NativeEnqueuerBase {
* JS('_DOMWindowImpl', 'window')
*
*/
- void registerJsCall(Send node, ForeignResolver resolver) {
+ NativeBehavior resolveJsCall(Send node, ForeignResolver resolver) {
NativeBehavior behavior = NativeBehavior.ofJsCall(
node, reporter, compiler.parsingContext, compiler.coreTypes, resolver);
+ // TODO(johnniwinther): Move registration to the world impact application.
registerNativeBehavior(behavior, node);
- nativeBehaviors[node] = behavior;
+ return behavior;
}
/**
@@ -629,11 +622,13 @@ class NativeResolutionEnqueuer extends NativeEnqueuerBase {
* JS_EMBEDDED_GLOBAL('String', 'foo')
*
*/
- void registerJsEmbeddedGlobalCall(Send node, ForeignResolver resolver) {
+ NativeBehavior resolveJsEmbeddedGlobalCall(
+ Send node, ForeignResolver resolver) {
NativeBehavior behavior = NativeBehavior.ofJsEmbeddedGlobalCall(
node, reporter, compiler.parsingContext, compiler.coreTypes, resolver);
+ // TODO(johnniwinther): Move registration to the world impact application.
registerNativeBehavior(behavior, node);
- nativeBehaviors[node] = behavior;
+ return behavior;
}
/**
@@ -645,11 +640,12 @@ class NativeResolutionEnqueuer extends NativeEnqueuerBase {
* JS_BUILTIN('String', 'int2string', 0)
*
*/
- void registerJsBuiltinCall(Send node, ForeignResolver resolver) {
+ NativeBehavior resolveJsBuiltinCall(Send node, ForeignResolver resolver) {
NativeBehavior behavior = NativeBehavior.ofJsBuiltinCall(
node, reporter, compiler.parsingContext, compiler.coreTypes, resolver);
+ // TODO(johnniwinther): Move registration to the world impact application.
registerNativeBehavior(behavior, node);
- nativeBehaviors[node] = behavior;
+ return behavior;
}
}

Powered by Google App Engine
This is Rietveld 408576698