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

Unified Diff: pkg/compiler/lib/src/serialization/system.dart

Issue 2456643006: More functionality in kernel_impact. (Closed)
Patch Set: Fix errors. Created 4 years, 1 month 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/resolution/signatures.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/serialization/system.dart
diff --git a/pkg/compiler/lib/src/serialization/system.dart b/pkg/compiler/lib/src/serialization/system.dart
index 8d241ceea9350d61b118df5677d0717f05423a1c..9e6da49126f87a10d039428c957d7c3bed571441 100644
--- a/pkg/compiler/lib/src/serialization/system.dart
+++ b/pkg/compiler/lib/src/serialization/system.dart
@@ -9,6 +9,7 @@ import 'dart:async';
import '../common.dart';
import '../common/resolution.dart';
import '../compiler.dart';
+import '../dart_types.dart';
import '../elements/elements.dart';
import '../scanner/scanner.dart';
import '../script.dart';
@@ -156,20 +157,36 @@ class CompilationDeserializerSystem extends ResolutionDeserializerSystem {
ResolutionImpact getResolutionImpact(Element element) {
if (element.isConstructor &&
element.enclosingClass.isUnnamedMixinApplication) {
- ClassElement superclass = element.enclosingClass.superclass;
+ ConstructorElement constructor = element;
+ ClassElement superclass = constructor.enclosingClass.superclass;
ConstructorElement superclassConstructor =
- superclass.lookupConstructor(element.name);
+ superclass.lookupConstructor(constructor.name);
assert(invariant(element, superclassConstructor != null,
- message: "Superclass constructor '${element.name}' called from "
+ message: "Superclass constructor '${constructor.name}' called from "
"${element} not found in ${superclass}."));
// TODO(johnniwinther): Compute callStructure. Currently not used.
CallStructure callStructure;
- return _resolutionImpactDeserializer.registerResolutionImpact(element,
+ return _resolutionImpactDeserializer.registerResolutionImpact(constructor,
() {
+ List<TypeUse> typeUses = <TypeUse>[];
+ void addCheckedModeCheck(DartType type) {
+ if (!type.isDynamic) {
+ typeUses.add(new TypeUse.checkedModeCheck(type));
+ }
+ }
+
+ FunctionType type = constructor.type;
+ // TODO(johnniwinther): Remove this substitution when synthesized
+ // constructors handle type variables correctly.
+ type = type.substByContext(constructor.enclosingClass
+ .asInstanceOf(constructor.enclosingClass));
+ type.parameterTypes.forEach(addCheckedModeCheck);
+ type.optionalParameterTypes.forEach(addCheckedModeCheck);
+ type.namedParameterTypes.forEach(addCheckedModeCheck);
return new DeserializedResolutionImpact(staticUses: <StaticUse>[
new StaticUse.superConstructorInvoke(
superclassConstructor, callStructure)
- ]);
+ ], typeUses: typeUses);
});
}
return _resolutionImpactDeserializer.getResolutionImpact(element);
« no previous file with comments | « pkg/compiler/lib/src/resolution/signatures.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698