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

Unified Diff: tests/compiler/dart2js/serialization_helper.dart

Issue 1901683002: Support deserialization of ResolutionImpact for members of unnamed mixin applications (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
« no previous file with comments | « pkg/compiler/lib/src/serialization/task.dart ('k') | tests/compiler/dart2js/serialization_test_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/serialization_helper.dart
diff --git a/tests/compiler/dart2js/serialization_helper.dart b/tests/compiler/dart2js/serialization_helper.dart
index b261f74fca81b16f9f05769472f1fd3d9b358614..b03066ea11fda326013d17fcb2709214e9c7fad5 100644
--- a/tests/compiler/dart2js/serialization_helper.dart
+++ b/tests/compiler/dart2js/serialization_helper.dart
@@ -28,6 +28,8 @@ import 'package:compiler/src/serialization/modelz.dart';
import 'package:compiler/src/serialization/task.dart';
import 'package:compiler/src/tokens/token.dart';
import 'package:compiler/src/script.dart';
+import 'package:compiler/src/universe/call_structure.dart';
+import 'package:compiler/src/universe/use.dart';
import 'package:compiler/src/universe/world_impact.dart';
import 'memory_compiler.dart';
@@ -146,7 +148,7 @@ class ResolutionImpactSerializer extends SerializerPlugin {
if (resolution.hasBeenResolved(element)) {
ResolutionImpact impact = resolution.getResolutionImpact(element);
ObjectEncoder encoder = createEncoder(WORLD_IMPACT_TAG);
- new ImpactSerializer(encoder).serialize(impact);
+ new ImpactSerializer(element, encoder).serialize(impact);
}
}
}
@@ -158,7 +160,8 @@ class ResolutionImpactDeserializer extends DeserializerPlugin {
void onElement(Element element, ObjectDecoder getDecoder(String tag)) {
ObjectDecoder decoder = getDecoder(WORLD_IMPACT_TAG);
if (decoder != null) {
- impactMap[element] = ImpactDeserializer.deserializeImpact(decoder);
+ impactMap[element] =
+ ImpactDeserializer.deserializeImpact(element, decoder);
}
}
}
@@ -225,7 +228,32 @@ class _DeserializerSystem extends DeserializerSystem {
}
@override
+ bool hasResolutionImpact(Element element) {
+ if (element.isConstructor &&
+ element.enclosingClass.isUnnamedMixinApplication) {
+ return true;
+ }
+ return _resolutionImpactDeserializer.impactMap.containsKey(element);
+ }
+
+ @override
ResolutionImpact getResolutionImpact(Element element) {
+ if (element.isConstructor &&
+ element.enclosingClass.isUnnamedMixinApplication) {
+ ClassElement superclass = element.enclosingClass.superclass;
+ ConstructorElement superclassConstructor =
+ superclass.lookupConstructor(element.name);
+ assert(invariant(element, superclassConstructor != null,
+ message: "Superclass constructor '${element.name}' called from "
+ "${element} not found in ${superclass}."));
+ // TODO(johnniwinther): Compute callStructure. Currently not used.
+ CallStructure callStructure;
+ return _resolutionImpactDeserializer.impactMap.putIfAbsent(element, () {
+ return new DeserializedResolutionImpact(
+ staticUses: <StaticUse>[new StaticUse.superConstructorInvoke(
+ superclassConstructor, callStructure)]);
+ });
+ }
return _resolutionImpactDeserializer.impactMap[element];
}
« no previous file with comments | « pkg/compiler/lib/src/serialization/task.dart ('k') | tests/compiler/dart2js/serialization_test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698