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

Unified Diff: pkg/compiler/lib/src/resolution/registry.dart

Issue 1957343002: Register NativeBehavior from WorldImpact. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 4 years, 7 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/resolution/registry.dart
diff --git a/pkg/compiler/lib/src/resolution/registry.dart b/pkg/compiler/lib/src/resolution/registry.dart
index 7008c9a27750d94de60715b54798449466ba92e6..7de89c24ca02d54b4515e6120af93e48ddf21077 100644
--- a/pkg/compiler/lib/src/resolution/registry.dart
+++ b/pkg/compiler/lib/src/resolution/registry.dart
@@ -36,6 +36,7 @@ class _ResolutionWorldImpact extends ResolutionImpact with WorldImpactBuilder {
Setlet<ListLiteralUse> _listLiterals;
Setlet<String> _constSymbolNames;
Setlet<ConstantExpression> _constantLiterals;
+ Setlet<dynamic> _nativeData;
_ResolutionWorldImpact(this.name);
@@ -104,6 +105,19 @@ class _ResolutionWorldImpact extends ResolutionImpact with WorldImpactBuilder {
: const <ConstantExpression>[];
}
+ void registerNativeData(dynamic nativeData) {
+ assert(nativeData != null);
+ if (_nativeData == null) {
+ _nativeData = new Setlet<dynamic>();
+ }
+ _nativeData.add(nativeData);
+ }
+
+ @override
+ Iterable<dynamic> get nativeData {
+ return _nativeData != null ? _nativeData : const <dynamic>[];
+ }
+
String toString() {
StringBuffer sb = new StringBuffer();
sb.write('_ResolutionWorldImpact($name)');
@@ -359,7 +373,9 @@ class ResolutionRegistry extends Registry {
var nativeData = backend.resolveForeignCall(node, element, callStructure,
new ForeignResolutionResolver(visitor, this));
if (nativeData != null) {
+ // Split impact from resolution result.
mapping.registerNativeData(node, nativeData);
+ worldImpact.registerNativeData(nativeData);
}
}
« no previous file with comments | « pkg/compiler/lib/src/native/enqueue.dart ('k') | pkg/compiler/lib/src/serialization/impact_serialization.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698