Commit Graph

27 Commits

Author SHA1 Message Date
Lasse R.H. Nielsen 50aa43569d Add "growable" parameter to List.filled constructor.
Fixes issue #24884
BUG= http://dartbug.com/24884
R=floitsch@google.com

Review URL: https://codereview.chromium.org/1440663003 .
2015-11-13 09:30:46 +01:00
Ivan Posva e974b952a7 - Prevent getting an unmodifiable list being returned from List.from.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1275703002 .
2015-08-05 13:25:32 -07:00
Lasse R.H. Nielsen babcd4e9c0 Revert "Make EfficientLength public, as EfficientLengthIterable."
It's still not a good solution for detecting an Iterable with an efficient
length. It's not inherited by, e.g., a DelegatingIterable wrapper or similar
generic Iterable transformers.

Keep this as an internal optimization for quickly detecting the most common
efficient-length Iterable classes (List, Set, Queue, Map.keys/values), but
don't make it public.

A *real* solution would be adding a hasEfficientLength getter to Iterable, or
adding an efficientLength getter that may return null if it's not efficient.
This would something that a wrapper can attach to.

R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1154263003
2015-05-29 12:52:45 +02:00
lrn@google.com 92c526b2a2 Make EfficientLength public, as EfficientLengthIterable.
R=iposva@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//1104063002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45556 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-06 09:00:45 +00:00
lrn@google.com f139d0e93b Add List.unmodifiable constructor.
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1056353004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45334 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 10:48:22 +00:00
lrn@google.com 3f1780f70d Change List/Set/Map/Queue.from constructrs to accept any iterable.
This allows using the .from constructor as a cast:

  new Set<int>.from(numSetContainingOnlyInts);

BUG= http://dartbug.com/21731
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//838463002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42620 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-06 10:14:56 +00:00
lrn@google.com 7947f84054 Optimize List.toList/.sublist and List.from on lists.
R=fschneider@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//485043002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39579 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 08:00:48 +00:00
iposva@google.com e7e2e4bf03 - Rename arrays to lists:
_ObjectArray -> _List
  _GrowableObjectArray -> _GrowableList
  _ImmutableArray -> _ImmutableList

R=srdjan@google.com

Review URL: https://codereview.chromium.org//25813002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28189 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-03 00:15:14 +00:00
floitsch@google.com f74e8a023b Revert "- Do not keep growing when creating Lists from Iterables."
This reverts commit r21531.

BUG= http://dartbug.com/10070

Review URL: https://codereview.chromium.org//14402013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21817 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-22 16:52:03 +00:00
iposva@google.com 6adbe1b84f - Do not keep growing when creating Lists from Iterables.
Review URL: https://codereview.chromium.org//14210006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21531 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 23:55:48 +00:00
iposva@google.com 5c71abedff - Do not use the ? operator in the List factory.
Review URL: https://codereview.chromium.org//12335146

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19178 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 22:36:22 +00:00
lrn@google.com 6b4f4b1bab Change new List(n) to return fixed length list.
Deprecate List.fixedLength, add List.filled.

Make Iterable.toList and List.from take "growable" argument,
defaulting to false.

Review URL: https://codereview.chromium.org//12328104

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19112 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 08:45:04 +00:00
floitsch@google.com e024c74a5f Remove List.filled constructor.
Review URL: https://codereview.chromium.org//12041019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17871 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-30 20:10:27 +00:00
srdjan@google.com 2ad98117fd Fix performance of array literals (e.g. "[1, 2]"). Improves speed of DeltaBlue.
Simplify code to allocate groable object array from an object array.
Review URL: https://codereview.chromium.org//11882005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16999 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 23:39:00 +00:00
srdjan@google.com 8a831fe908 Factor out length check in list factories: reduce bloat, factorize code, improve performance.
Review URL: https://codereview.chromium.org//11773045

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16810 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-08 17:47:03 +00:00
srdjan@google.com 020b5893db Cleanups.
Review URL: https://codereview.chromium.org//11801023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16756 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 22:13:47 +00:00
floitsch@google.com 4a7dfd2da3 Big merge from experimental to bleeding edge.
Review URL: https://codereview.chromium.org//11783009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16687 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 11:23:16 +00:00
ajohnsen@google.com 0f367f8894 Make List an abstract class.
This was the last interface in dart:core.

BUG=

Review URL: https://codereview.chromium.org//11417051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15240 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-22 07:40:52 +00:00
regis@google.com 02a8df0c83 Remove private class helping the parser to construct literal lists and maps.
Patch List and Map (implementation) classes with literal factories.
Review URL: https://codereview.chromium.org//11369234

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14873 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-14 04:28:02 +00:00
floitsch@google.com 8e6f238f86 a === b -> identical(a, b)
Replace === null with == null.

BUG=http://dartbug.com/6380

Review URL: https://codereview.chromium.org//11361190

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14794 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-12 17:19:58 +00:00
ajohnsen@google.com dbbf15abd8 Move ListImplementation from coreimpl to core, as a private member.
BUG=

Review URL: https://codereview.chromium.org//11189141

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14274 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 13:25:04 +00:00
ager@google.com 35e073bf80 Minor style and comment fixes from review comments.
R=iposva@google.com
BUG=

Review URL: https://codereview.chromium.org//11024002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13161 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-03 08:08:34 +00:00
ager@google.com abee5139e5 Reapply change to hide VM-only List implementation classes.
The performance issue was that I had not updated the method
recognizer.

BUG=

Review URL: https://codereview.chromium.org//10990083

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13003 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 11:08:38 +00:00
ager@google.com fe66a0af1a Revert hiding of VM-only coreimpl list implementation types. While I
investigate performance regression (even after fixing constructors
in the intrinsifier).

R=iposva@google.com,srdjan@google.com,fschneider@google.com
BUG=

Review URL: https://codereview.chromium.org//11000025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12963 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 14:07:56 +00:00
ager@google.com 8e6a2c8345 Hide VM-only coreimpl List implementation types. These should not be
exposed as visible parts of coreimpl.

Review URL: https://codereview.chromium.org//10990055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12952 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-27 12:37:30 +00:00
srdjan@google.com 3051c69910 Improve moves of Smi and null objects. Add result cid to List constructor calls. Add tracing of inline cache misses in optimized code (a big no-no).
Review URL: https://chromiumcodereview.appspot.com//10933019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12208 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 15:41:34 +00:00
ajohnsen@google.com 660f03288e Unify list.
I've added a TODO that we'll have to address asap. This patch will
currently limit the checks being performed with List.from(other).

BUG=

Review URL: https://chromiumcodereview.appspot.com//10878077

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11384 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 14:06:03 +00:00