Commit graph

44 commits

Author SHA1 Message Date
Lasse R.H. Nielsen 62bc61b367 Use relative URIs for core library part-of statements.
Reapply "Change some platform libraries to use `part of URI`."
Change to used relative URIs in the part-of declarations.

R=brianwilkerson@google.com, floitsch@google.com

Review-Url: https://codereview.chromium.org/2911903002 .
2017-07-03 10:04:06 +02:00
Lasse R.H. Nielsen 953f78d6dd Revert "Change some platform libraries to use part of URI."
This makes the analyzer generate a variety of odd errors.
Best guess is that it somehow fails to recognize Object as the Object class
(stack overflow while traversing superclasses, cannot assign Foo<T> to
Foo<Object> and similar errors can be explained by that).

Review-Url: https://codereview.chromium.org/2880543002 .
2017-05-11 11:42:21 +02:00
Lasse R.H. Nielsen 540bb7a0ec Change some platform libraries to use part of URI.
Use new dart-style. Now needs an SDK built with this checked in as well.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2871123004 .
2017-05-11 10:56:02 +02:00
Stephen Adams 0539c0b8bf SkipIterable - ensure field is only initialized to a known int.
By checking before initializing, dart2js can infer the field is not null

BUG=
R=lrn@google.com

Review-Url: https://codereview.chromium.org/2845933002 .
2017-05-01 10:01:04 -07:00
Vijay Menon aa3966dc84 Fix hot dynamic check in WhereIterator
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2843423002 .
2017-04-27 06:35:37 -07:00
Jacob Richman ea6991a245 Format all dart: library files
BUG=
R=floitsch@google.com, sra@google.com

Review-Url: https://codereview.chromium.org/2754013002 .
2017-03-16 10:22:19 -07:00
Peter von der Ahé 00bed94e0c Fix various nits in VM patch files.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2705593002 .
2017-02-17 16:28:57 +01:00
Lasse R.H. Nielsen d0624a3815 Small fix to MappedListIterable
No need to implement EfficientLengthIterable, it's inherited from ListIterable.

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2621273002 .
2017-01-11 14:04:44 +01:00
Lasse R.H. Nielsen 44594277e1 Make core libraries use generic method syntax.
Removes comment syntax where possible for the following platform libraries:
* async
* collection
* convert
* core
* internal
* io
* math

The HTML related libraries are not changed. The templates used to build them
must be changed as well.

R=floitsch@google.com

Committed: 68818315b5
Committed: 3f74b8d82e
Review-Url: https://codereview.chromium.org/2529393002 .
2017-01-03 12:05:40 +01:00
Lasse Reichstein Holst Nielsen 3f74b8d82e Make core libraries use generic method syntax.
Removes comment syntax where possible for the following platform libraries:
* async
* collection
* convert
* core
* internal
* io
* math

The HTML related libraries are not changed. The templates used to build them
must be changed as well.

R=floitsch@google.com

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

Committed: 68818315b5
2016-12-14 12:24:36 +01:00
Lasse Reichstein Holst Nielsen 68818315b5 Make core libraries use generic method syntax.
Removes comment syntax where possible for the following platform libraries:
* async
* collection
* convert
* core
* internal
* io
* math

The HTML related libraries are not changed. The templates used to build them
must be changed as well.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2529393002 .
2016-12-14 11:32:16 +01:00
Lasse Reichstein Holst Nielsen 7957a1c256 Make EfficientLength extend Iterable.
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.

It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.

R=floitsch@google.com

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

Committed: b08fb1373f
2016-11-28 08:04:04 +01:00
Ryan Macnak 6cf5c3baa3 Revert "Make EfficientLength extend Iterable."
This reverts commit b08fb1373f.

TBR=lrn@google.com

Review URL: https://codereview.chromium.org/2467283003 .
2016-11-02 13:20:41 -07:00
Lasse R.H. Nielsen b08fb1373f Make EfficientLength extend Iterable.
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.

It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2467113003 .
2016-11-02 14:05:35 +01:00
Stephen Adams 127b419fc1 Add WhereIterable.map
This makes some nice code improvements for dart2js. dart2js can't
inline the MappedIterable factory constructor and specialize by
optimization, so specializing by hand removes the test "is
EfficientLength" for code like "x.where(f).map(g)".

R=lrn@google.com

Review URL: https://codereview.chromium.org/2354093002 .
2016-09-22 10:36:16 -07:00
Stephen Adams 73c236a3a4 Revert "Library changes to align with DDC."
TBR=floitsch@google.com
BUG=

Review URL: https://codereview.chromium.org/1970653002 .
2016-05-10 19:42:51 -07:00
Stephen Adams 260eb5534a Library changes to align with DDC.
Mostly adding a few types and formatting changes since DDC uses dartfmt.

R=floitsch@google.com, vsm@google.com

Committed: 308cb34a7c

Reverted: facb3eb9dc

Review URL: https://codereview.chromium.org/1952183002 .
2016-05-10 18:38:19 -07:00
Stephen Adams facb3eb9dc Revert "Library changes to align with DDC."
TBR=floitsch@google.com

Review URL: https://codereview.chromium.org/1969643002 .
2016-05-10 17:42:02 -07:00
Stephen Adams 308cb34a7c Library changes to align with DDC.
Mostly adding a few types and formatting changes since DDC uses dartfmt.

R=floitsch@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/1952183002 .
2016-05-10 17:36:16 -07:00
Florian Loitsch 4be9d36961 Make dart:internal strong-mode clean.
R=leafp@google.com

Review URL: https://codereview.chromium.org/1890323002 .
2016-04-21 13:53:51 +02:00
Leaf Petersen 92edd907c1 Add generic annotations to more SDK APIs.
Fixes https://github.com/dart-lang/sdk/issues/25860 .

BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org/1815583002 .
2016-03-28 17:52:40 -07:00
Johnni Winther 149ad3a2e9 Remove unused BidirectionalIterator from dart:_internal.
BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org/1799113002 .
2016-03-15 09:37:09 +01:00
Lasse R.H. Nielsen 08efdd3f30 Remove junk code in ExpandIterator.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org/1406283014 .
2015-11-04 13:13:04 +01: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
Lasse R.H. Nielsen dcf0286f53 Add Iterable.empty constructor.
Convenience constructor giving an easy/quick way to create an empty iterable.

R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1152483002
2015-05-22 10:39:58 +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
sra@google.com 39dfecbfb5 Revert "Change ListIterator to only check for concurrent modification at each iteration"
Revert "Fix ListIterator.iterator function hash for VM."

This is not as easy to optimize for dart2js as initially thought.
Revert this change while we discuss.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45216 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 18:53:39 +00:00
lrn@google.com 5a79c03e09 Change ListIterator to only check for concurrent modification at each iteration
in checked mode.

It also checks at the end in all cases.

Iteration only goes from 0 to the original length of the list.
This ensures that iterating a list while adding to it (like by x.addAll(x))
is caught instead of growing until out-of-memory.
For well-behaved programs this makes no difference since length and original
length stay the same.
Also, it means that calling moveNext again later, after increasing the length,
will not make iteration continue. After returning false, iteration is always
done.
However, it means that reducing the length causes an out-of-range read before
reaching the end, and before a concurrent modification error can happen.

R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45198 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 09:07:58 +00:00
lrn@google.com 0e22f7402f Move implementation from IterableBase to Iterable.
Keep IterableBase around, but just extend Iterable.

There is no good reason to have IterableBase different from Iterable. The only argument is to be consistent with ListBase, but that's also inconsistent with, e.g., Stream.
ListBase only exists because List uses the default List constructor, so it's not a good super-class. As a usability-tradeoff, the ListBase class exists as a super-class.
Iterable doesn't have the same problem, so applying that "trade-off" has no up-side.

(A better long-term solution would be to be able to designate another constructor as the default "super()" constructor to call, so List could be used as a superclass).

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45096 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-13 12:26:15 +00:00
sra@google.com 4930144c17 Delete IterableMixinWorkaround
Most code in IterableMixinWorkaround was unused.  The remaining O(20)
methods have been moved to their only use on JSArray.

I looked into using ListMixin on JSArray.  The code was clearly worse
- nearly 1% bloat on swarm and some less precise inference.  I think
it is reasonable to have the JSArray methods special-cased for
performance reasons.

R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44006 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-24 22:57:28 +00:00
jacobr@google.com 5fe403d861 Fix a couple type bugs in dart html and what seems like strange type choices in dart:core
BUG=
R=vsm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42550 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-22 18:49:07 +00:00
lrn@google.com 05031864ee Change incorrect limit check in IterableMixinWorkaround.insertAllList.
Review URL: https://codereview.chromium.org//740653003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41896 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 12:00:11 +00:00
lrn@google.com ce08b80b53 Fix incorrect type variable usage in copied code.
Review URL: https://codereview.chromium.org//752513002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41895 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 11:18:58 +00:00
lrn@google.com 6ae29ec58e Create generic check methods for RangeError causing checks.
Use them where appropriate in core libraries.

There are many more possible uses in vm- and dart2js-libraries.

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41893 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 10:29:15 +00:00
lrn@google.com cd16d94f1e Add concurrent modification check to ListMixin/IterableMixin.reduce.
Add tests of reduce and fold.

BUG= http://dartbug.com/21289
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41093 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-14 09:12:21 +00:00
lrn@google.com a2685542da Fix bad default value for SubListIterable.toList.
Analyzer is not happy.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40674 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-25 12:06:26 +00:00
lrn@google.com 8bba32d131 Make String.fromCharCodes take start/end.
This avoids having to make a sublist of a list of character codes before passing it to String.fromCharCodes.

    new String.fromCharCodes(codes.sublist(start, end))

becomes just

    new String.fromCharCodes(codes, start, end)

R=floitsch@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40672 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-25 10:45:24 +00:00
lrn@google.com 729de01f79 Make IterableMixinWorkaround using classes return correctly typed Iterables.
BUG= http://dartbug.com/13646
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38372 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-18 08:08:16 +00:00
lrn@google.com 989709f3a8 Reinstall previous behavior for Set and Queue toString.
A previous change made these omit elements to keep the toString length down.
That could break code that expects the original behavior.

This still avoids using IterableMixinWorkaround.

Add static toString methods on ListBase, SetBase, IterableBase so that users can
get the same behavior as our toString methods, and with the same cycle detection
safety.

Unify all collection toString methods in two methods:
- IterableBase.iterableToShortString
- IterableBase.iterableToFullString

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36616 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-26 06:08:20 +00:00
lrn@google.com f449a85d1e Unify error messages for iterables and lists.
Add factory methods that generate the errors thrown for unmodifiable lists,
non-growable lists and iterations with the wrong number of elements.

R=iposva@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35733 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-05 09:26:56 +00:00
lrn@google.com 8fd1e2f65d Make generator argument to Iterable.generate optional.
It defaults to an integer identity function.

Also optimize skip/take on the generated iterable by making it
take hold start and end positions instead of just the count.

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34240 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-21 09:54:46 +00:00
lrn@google.com 3b3e87cabc Revert "Rename internal library dart:_collection-dev to dart:_internal."
Dartium needs updating too.

Committed: https://code.google.com/p/dart/source/detail?r=31827

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31877 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-16 12:06:38 +00:00
lrn@google.com ead87f47e9 Revert "Rename internal library dart:_collection-dev to dart:_internal."
Dartium needs updating too.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31827 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-15 12:27:44 +00:00
lrn@google.com 0098710559 Rename internal library dart:_collection-dev to dart:_internal.
BUG= http://dartbug.com/14140
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31823 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-15 09:24:46 +00:00
Renamed from sdk/lib/_collection_dev/iterable.dart (Browse further)