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

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

Issue 1192103002: Support serialization of the compiler backbone. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Handle (bypass) external const constructors. Created 5 years, 5 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/ordered_typeset.dart ('k') | pkg/compiler/lib/src/resolution/constructors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/class_hierarchy.dart
diff --git a/pkg/compiler/lib/src/resolution/class_hierarchy.dart b/pkg/compiler/lib/src/resolution/class_hierarchy.dart
index 13a6855fa566b5b1ce50fe78e44538cd00f4db6c..712e78e0d0056e403fc4e8096e510bf6f95fe746 100644
--- a/pkg/compiler/lib/src/resolution/class_hierarchy.dart
+++ b/pkg/compiler/lib/src/resolution/class_hierarchy.dart
@@ -270,21 +270,22 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
new Modifiers.withFlags(new NodeList.empty(), Modifiers.FLAG_ABSTRACT));
// Create synthetic type variables for the mixin application.
List<DartType> typeVariables = <DartType>[];
- element.typeVariables.forEach((TypeVariableType type) {
+ int index = 0;
+ for (TypeVariableType type in element.typeVariables) {
TypeVariableElementX typeVariableElement = new TypeVariableElementX(
- type.name, mixinApplication, type.element.node);
+ type.name, mixinApplication, index, type.element.node);
TypeVariableType typeVariable = new TypeVariableType(typeVariableElement);
typeVariables.add(typeVariable);
- });
+ index++;
+ }
// Setup bounds on the synthetic type variables.
- int index = 0;
- element.typeVariables.forEach((TypeVariableType type) {
- TypeVariableType typeVariable = typeVariables[index++];
+ for (TypeVariableType type in element.typeVariables) {
+ TypeVariableType typeVariable = typeVariables[type.element.index];
TypeVariableElementX typeVariableElement = typeVariable.element;
typeVariableElement.typeCache = typeVariable;
typeVariableElement.boundCache =
type.element.bound.subst(typeVariables, element.typeVariables);
- });
+ }
// Setup this and raw type for the mixin application.
mixinApplication.computeThisAndRawType(compiler, typeVariables);
// Substitute in synthetic type variables in super and mixin types.
@@ -309,8 +310,11 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
FunctionElement createForwardingConstructor(ConstructorElement target,
ClassElement enclosing) {
- return new SynthesizedConstructorElementX.notForDefault(
- target.name, target, enclosing);
+ FunctionElement constructor =
+ new SynthesizedConstructorElementX.notForDefault(
+ target.name, target, enclosing);
+ constructor.computeType(compiler);
+ return constructor;
}
void doApplyMixinTo(MixinApplicationElementX mixinApplication,
@@ -566,8 +570,10 @@ class ClassSupertypeResolver extends CommonResolverVisitor {
super(compiler);
void loadSupertype(ClassElement element, Node from) {
- compiler.resolver.loadSupertypes(element, from);
- element.ensureResolved(compiler);
+ if (!element.isResolved) {
+ compiler.resolver.loadSupertypes(element, from);
+ element.ensureResolved(compiler);
+ }
}
void visitNodeList(NodeList node) {
« no previous file with comments | « pkg/compiler/lib/src/ordered_typeset.dart ('k') | pkg/compiler/lib/src/resolution/constructors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698