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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 12753003: Recognize const/fixed/growable arrays in simple types inferrer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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
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);

Powered by Google App Engine
This is Rietveld 408576698