Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 19761) |
| +++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy) |
| @@ -3270,13 +3270,14 @@ |
| bool isListConstructor = false; |
| computeType(element) { |
| Element originalElement = elements[node]; |
| - if (identical(originalElement.getEnclosingClass(), compiler.listClass)) { |
| + if (Elements.isFixedListConstructorCall( |
| + originalElement, node, compiler)) { |
| isListConstructor = true; |
| - if (node.arguments.isEmpty) { |
| - return HType.EXTENDABLE_ARRAY; |
| - } else { |
| - return HType.MUTABLE_ARRAY; |
|
kasperl
2013/03/11 08:40:57
Was this just pessimistic before?
ngeoffray
2013/03/11 08:59:57
Yes it was. But the optimizers were putting it bac
|
| - } |
| + return HType.FIXED_ARRAY; |
| + } else if (Elements.isGrowableListConstructorCall( |
| + originalElement, node, compiler)) { |
| + isListConstructor = true; |
| + return HType.EXTENDABLE_ARRAY; |
| } else if (element.isGenerativeConstructor()) { |
| ClassElement cls = element.getEnclosingClass(); |
| return new HType.nonNullExact(cls.thisType, compiler); |