Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| index eb48b99e04a22800f2bd563b2ab8db66228b09dc..c072479f2904f29bb439fbb685936b396c7ec7a0 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| @@ -1083,7 +1083,7 @@ class TypedefElementX extends ElementX |
| return thisTypeCache; |
| } |
| - TypedefType createType(Link<DartType> typeArguments) { |
| + TypedefType createType(List<DartType> typeArguments) { |
| return new TypedefType(this, typeArguments); |
| } |
| @@ -1801,9 +1801,9 @@ abstract class TypeDeclarationElementX<T extends GenericType> |
| return rawTypeCache; |
| } |
| - T createType(Link<DartType> typeArguments); |
| + T createType(List<DartType> typeArguments); |
| - void setThisAndRawTypes(Compiler compiler, Link<DartType> typeParameters) { |
| + void setThisAndRawTypes(Compiler compiler, List<DartType> typeParameters) { |
| assert(invariant(this, thisTypeCache == null, |
| message: "This type has already been set on $this.")); |
| assert(invariant(this, rawTypeCache == null, |
| @@ -1812,37 +1812,36 @@ abstract class TypeDeclarationElementX<T extends GenericType> |
| if (typeParameters.isEmpty) { |
| rawTypeCache = thisTypeCache; |
| } else { |
| - Link<DartType> dynamicParameters = const Link<DartType>(); |
| - typeParameters.forEach((_) { |
| - dynamicParameters = |
| - dynamicParameters.prepend(compiler.types.dynamicType); |
| - }); |
| + List<DartType> dynamicParameters = |
| + new List.filled(typeParameters.length, compiler.types.dynamicType); |
| rawTypeCache = createType(dynamicParameters); |
| } |
| } |
| - Link<DartType> get typeVariables => thisType.typeArguments; |
| + List<DartType> get typeVariables => thisType.typeArguments; |
| /** |
| * Creates the type variables, their type and corresponding element, for the |
| * type variables declared in [parameter] on [element]. The bounds of the type |
| * variables are not set until [element] has been resolved. |
| */ |
| - Link<DartType> createTypeVariables(NodeList parameters) { |
| - if (parameters == null) return const Link<DartType>(); |
| + List<DartType> createTypeVariables(NodeList parameters) { |
| + if (parameters == null) return const <DartType>[]; |
| // Create types and elements for type variable. |
| - LinkBuilder<DartType> arguments = new LinkBuilder<DartType>(); |
| - for (Link<Node> link = parameters.nodes; !link.isEmpty; link = link.tail) { |
| - TypeVariable node = link.head; |
| + Link<Node> nodes = parameters.nodes; |
| + List<DartType> arguments = |
| + new List.generate(nodes.slowLength(), (_) { |
| + TypeVariable node = nodes.head; |
| String variableName = node.name.source; |
| + nodes = nodes.tail; |
| TypeVariableElementX variableElement = |
| new TypeVariableElementX(variableName, this, node); |
| TypeVariableType variableType = new TypeVariableType(variableElement); |
| variableElement.typeCache = variableType; |
| - arguments.addLast(variableType); |
| - } |
| - return arguments.toLink(); |
| + return variableType; |
| + }); |
|
Johnni Winther
2014/07/01 11:03:50
Add `, growable: false` ?
karlklose
2014/07/01 13:32:06
Done.
|
| + return arguments; |
| } |
| } |
| @@ -1898,7 +1897,7 @@ abstract class BaseClassElementX extends ElementX |
| return thisTypeCache; |
| } |
| - void computeThisAndRawType(Compiler compiler, Link<DartType> typeVariables) { |
| + void computeThisAndRawType(Compiler compiler, List<DartType> typeVariables) { |
| if (thisTypeCache == null) { |
| if (origin == null) { |
| setThisAndRawTypes(compiler, typeVariables); |
| @@ -1909,11 +1908,11 @@ abstract class BaseClassElementX extends ElementX |
| } |
| } |
| - InterfaceType createType(Link<DartType> typeArguments) { |
| + InterfaceType createType(List<DartType> typeArguments) { |
| return new InterfaceType(this, typeArguments); |
| } |
| - Link<DartType> computeTypeParameters(Compiler compiler); |
| + List<DartType> computeTypeParameters(Compiler compiler); |
| /** |
| * Return [:true:] if this element is the [:Object:] class for the [compiler]. |
| @@ -2306,7 +2305,7 @@ abstract class ClassElementX extends BaseClassElementX { |
| localMembers = localMembers.prepend(constructor); |
| } |
| - Link<DartType> computeTypeParameters(Compiler compiler) { |
| + List<DartType> computeTypeParameters(Compiler compiler) { |
| ClassNode node = parseNode(compiler); |
| return createTypeVariables(node.typeParameters); |
| } |
| @@ -2400,7 +2399,7 @@ class MixinApplicationElementX extends BaseClassElementX |
| addConstructor(constructor); |
| } |
| - Link<DartType> computeTypeParameters(Compiler compiler) { |
| + List<DartType> computeTypeParameters(Compiler compiler) { |
| NamedMixinApplication named = node.asNamedMixinApplication(); |
| if (named == null) { |
| throw new SpannableAssertionFailure(node, |