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); |
} |
} |