Commit graph

94 commits

Author SHA1 Message Date
Lasse R.H. Nielsen 6f78471687 New methods on Iterable, List, Set, Queue, Map.
Changes signature of Iterable.singleWhere.
Makes LinkedHashMap no longer be a HashMap.

Change-Id: I7a12fea533d42b0fc8357086649df38ad01f3cdd
Reviewed-on: https://dart-review.googlesource.com/39140
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-02-07 06:12:53 +00:00
William Hesse 9c35cff5cd Revert "New methods on Iterable, List, Set, Queue, Map."
This reverts commit 0b59f24f97.

Reason for revert: Creates crashes in dart2js with kernel, see
https://luci-milo.appspot.com/buildbot/client.dart/dart2js-linux-d8-minified-1-5-be/9751

Original change's description:
> New methods on Iterable, List, Set, Queue, Map.
> Changes signature of Iterable.singleWhere.
> Makes LinkedHashMap no longer be a HashMap.
> 
> Change-Id: Ibd7e56e1ac03cb9fb10d19d1328d452fcd06d89f
> Reviewed-on: https://dart-review.googlesource.com/32541
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=lrn@google.com,leafp@google.com

Change-Id: Iab904f5885a5213ae2e16ef496eed0b6843185f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/39060
Reviewed-by: William Hesse <whesse@google.com>
2018-02-06 13:32:19 +00:00
Lasse R.H. Nielsen 0b59f24f97 New methods on Iterable, List, Set, Queue, Map.
Changes signature of Iterable.singleWhere.
Makes LinkedHashMap no longer be a HashMap.

Change-Id: Ibd7e56e1ac03cb9fb10d19d1328d452fcd06d89f
Reviewed-on: https://dart-review.googlesource.com/32541
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-06 11:17:46 +00:00
Samir Jindel 68554ab8f5 [kernel] Support "dart-ext:..." imports in the CFE.
They are encoded as annotations on the importing library, similarly to
how native methods are encoded.

Change-Id: I4dc1119b20949308e4856666693fe4e890e9ee87
Reviewed-on: https://dart-review.googlesource.com/35660
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-01-29 14:04:25 +00:00
Alexander Markov 7bd5093f83 [corelib] Fix type argument of Iterable from EmptyIterable.map
Change-Id: Ifee26537d05848e4ea6d354f5d57e0f14574d050
Reviewed-on: https://dart-review.googlesource.com/35460
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-01-17 22:31:18 +00:00
Lasse R.H. Nielsen d1382f983c Initial steps to add cast operation.
Start by adding static castTo method to the interfaces. This provides everybody with the
desired implementation without exposing the classes.
When implementing the cast method, the recommended way is to (extend the base class,
but if you choose not to ...) use the castTo method.

If we ever get a language feature, we can implement the castTo method using that,
without being stuck with an unnecessary class.

Change-Id: I53274e60c88a4de519bead85d2ca44c1065a9c1a
Reviewed-on: https://dart-review.googlesource.com/26620
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-01-03 12:16:24 +00:00
Bob Nystrom 03c8767f73 Here's a start at exposing an API to address https://github.com/dart-lang/sdk/issues/31371.
There is no actual implementation here yet (that's your job :) ), but there is:

- An external method in dart:_internal, extractTypeArguments().
- Empty patch methods for that for the VM, dart2js, and DDC. These need to have implementations
  filled in.
- A "dart_internal" package to expose a subset of the API. It gives you:

    extractListTypeArgument()
    extractMapTypeArguments()

  We'll bring this into Google, but not publish it externally unless we find we really need to.
- A test for the behavior. It probably has bugs since I can't run it.

See: https://github.com/dart-lang/sdk/issues/31371
Change-Id: I7d9f9a3a36f8e8be106440375c80d584898c83cb
Reviewed-on: https://dart-review.googlesource.com/26467
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-12-08 21:57:00 +00:00
Leaf Petersen faa4ff9408 Type on printToZone, and startRootIsolate fix.
Put a precise type on the printToZone variable, and change entry
calls in startRootIsolate to avoid casting arguments to Null.


Bug:
Change-Id: Ia7d23e8dafa93bd6246ec7fa9b8c14411db30421
Reviewed-on: https://dart-review.googlesource.com/18683
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2017-12-04 22:57:04 +00:00
Peter von der Ahé 0023f99019 Changes to runtime patches so Fasta can understand them.
Change-Id: I7f8d6b110f2f0c90b131a2538240c1b81bfa1578
Reviewed-on: https://dart-review.googlesource.com/17162
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-01 15:16:04 +00:00
Vyacheslav Egorov dcfb7b9a4c [VM] Fix typing violations in string_patch.dart.
Bug: https://github.com/dart-lang/sdk/issues/31052
Change-Id: I1a0a94ce19bb54cb4273d1508b6ed08b94c60307
Reviewed-on: https://dart-review.googlesource.com/14840
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-19 06:42:37 +00:00
Leaf Petersen bdfc674a54 SDK core library fuzzy arrow fixes.
Fix a couple of places in the core libraries that were relying on
fuzzy arrow (lack of) checking.

BUG=
R=lrn@google.com

Review-Url: https://codereview.chromium.org/3005653002 .
2017-08-29 14:03:38 -07:00
Zachary Anderson 734beef062 [infra] Translate _sources.gypi files to _sources.gni files
Also deletes code that becomes dead as a result.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2996903002 .
2017-08-14 21:54:36 -07:00
Florian Loitsch ee46026671 Don't use LinkedList in the core libraries anymore.
R=lrn@google.com

Committed: fe17b5b2bc
Reverted: 5d4a786f44
Review-Url: https://codereview.chromium.org/2975443002 .
2017-07-28 21:14:11 +02:00
Florian Loitsch 5d4a786f44 Revert "Don't use LinkedList in the core libraries anymore."
This reverts commit fe17b5b2bc.

Review-Url: https://codereview.chromium.org/2974073002 .
2017-07-10 14:58:04 +02:00
Florian Loitsch fe17b5b2bc Don't use LinkedList in the core libraries anymore.
R=lrn@google.com

Review-Url: https://codereview.chromium.org/2975443002 .
2017-07-10 14:09:24 +02:00
Ryan Macnak 1bfd01c1f7 Revert "Use relative URIs for core library part-of statements."
This reverts commit 62bc61b367.

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2968413002 .
2017-07-07 11:18:24 -07:00
Florian Loitsch 42fd6cfd77 Revert "Remaining private libs"
This reverts commit 91db4489ee.

Review-Url: https://codereview.chromium.org/2973823002 .
2017-07-06 16:39:18 +02:00
Lasse R.H. Nielsen 91db4489ee Remaining private libs
Handle internal libraries correctly.

Revert `part of "file.dart"` to `part of "dart:file"` to avoid warnings in fasta.

BUG=
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2974433002 .
2017-07-06 14:58:27 +02:00
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
Erik Corry aa6353b6da Dart SDK Spelling b, c, and d.
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2850783002 .
2017-05-01 08:28:10 +02: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 ed2d79a872 Tweak corelib files so dartfmt can do a better job. Use // comments to force line wrapping for long array literals to be more reasonable. Switched some /* comments to // comments Fixed cases where comments were not indented correctly when running the formatter was considered.
BUG=
R=floitsch@google.com, lrn@google.com, rnystrom@google.com

Review-Url: https://codereview.chromium.org/2754923002 .
2017-04-19 07:28:26 -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 d26132d119 Move methods from internal.Lists that are not used, or only used once.
Remove the class (actually move it to the VM-only dart:_internal patch, because the VM code depends on recognizing the Lists.copy method).

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2685783009 .
2017-02-17 12:25:26 +01:00
Lasse R.H. Nielsen dccdd1b981 Normalize UriData.parse result.
Validates base64 encoding, normalizes padding.
Normalizes non-base64 data using URI percent-escapes for all invalid characters.

Fixes issue #28728, #28700
BUG= http://dartbug.com/28728 http://dartbug.com/28700
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2694373003 .
2017-02-17 11:02:38 +01:00
Kevin Moore 1e8558a3a6 fix spelling in core libraries
Fixes https://github.com/dart-lang/sdk/issues/28490

R=dgrove@google.com, rnystrom@google.com

Review-Url: https://codereview.chromium.org/2655883002 .
2017-01-25 09:36:55 -08: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
Kevin Millikin 9ab1f22b41 Make some VM libraries patch cleanly using the analyzer.
Modify the following VM dart: library patches: collection, convert,
developer, _internal, isolate, math, mirrors, profiler, vmservice_io,
_vmservice, _builtin, nativewrappers, and io.

The modifications are mostly because:

    - Patches should not be able to introduce new public members to a
      library's API.  In cases where the VM's patches introduce public
      members, the patches are rewritten to introduce private members
      instead.

    - Patches should not be able to replace arbitrary members, only
      ones declared external.  In cases where the VM's patches replace
      arbitrary members, those members are declared external in the
      SDK sources and dart2js's patch files are rewritten to use the
      original SDK implementation.

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2564383002 .
2016-12-15 11:30:20 +01:00
Kevin Millikin f7b6f0cf1c Make the VM's dart:core and dart:async library patches clean.
Clean up the VM's dart:core and dart:async library patches so that
they are clean according to the patching rules implemented in the
analyzer.  Specifically:

  - If a member is patched in a patch file, it must be declared external
    in the SDK.

  - If a member is introduced in a patch file, it must be private.

  - A non-private superclass member cannot be overridden in a patch
    file.

BUG=
R=lrn@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2563633002 .
2016-12-15 10:10:09 +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 b37747934e Specialize Symbol.hashCode
Patch internal.Symbol.hashCode and specialize JS version to avoid
recomputing String.hashCode

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2038853003 .
2016-06-03 15:10:51 -07:00
Jacob Richman 6cb121f847 Make sort method generic. This eliminates a large number of dynamic calls that slow down sorting under ddc.
BUG=
R=leafp@google.com

Review URL: https://codereview.chromium.org/2008373002 .
2016-05-25 12:33:41 -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