Commit graph

8738 commits

Author SHA1 Message Date
Samir Jindel fc6cb0ac21 [vm/ffi] Revamp struct representation in FFI.
See dartbug.com/37229 for details.

Change-Id: I63490e41c512ffc9312803985a6f6d4be1586c0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101291
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-07-02 23:12:13 +00:00
Nicholas Shahan 5fd51b9fd2 Cleanup remnants of ignoring Dart v1.x subtype checks
Remove ability to ignore subtype checks that fail but in a way that
would have passed in Dart 1.x.x.

Change-Id: I157a87777df52be139ef687d3fc193f7730a19b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107461
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-07-02 21:47:55 +00:00
Abhishek kanojia 9ed728ec7a Add: Example usage to fillRange method.
Closes #37313
https://github.com/dart-lang/sdk/pull/37313

GitOrigin-RevId: a4c9e85a8f539f893e1049c1735584e3b4edb8bc
Change-Id: I11bc591746dde4444b69d3c97b8065fe14b422cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106724
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2019-07-02 14:17:47 +00:00
Stephen Adams 6694aa821d [dart2js] new-rti: Temporary work-around for timeouts
We will remove this in a few weeks when more of the rti runtime is
correct.

TBR=fishythefish@google.com

Change-Id: I6cf9ff18398aa1a4c2dc1e38a9919165a816a145
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107833
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-02 02:23:31 +00:00
Stephen Adams 18ff5ce893 [dart2js] new-rti: Implement general As/Check methods
TBR=fishythefish@google.com

Change-Id: Ib2ac75dd3787401129a8b7420c60d59013d80f21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107824
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-02 00:49:20 +00:00
Stephen Adams 1db0b4436c [dart2js] new-rti: Implement type bounds check
TBR=fishythefish@google.com

Change-Id: Id6978b8453de639fa403436487edb849e4074206
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107681
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-01 20:52:59 +00:00
Stephen Adams ca4b6e533a [dart2js] new-rti: Implement basic is-test
Also add a few more type literal tests.

TBR=fishythefish@google.co,

Change-Id: Iab5ca4a5f8d224f67deaf1fe391e17ece46bde59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107600
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-07-01 19:12:20 +00:00
Lorenz Nickel 79e478e50e Fixed some links
**I fixed some links and some other minor flaws.**

I also found the following outdated links, which I didn't fix:

- [This link](https://github.com/dart-lang/pool/tree/zone.strong) in [this file](https://github.com/dart-lang/sdk/blob/master/docs/newsletter/20170728.md) (didn't fix because don't know new location and this is some sort of archive so the link should probably stay the original)
- [This link](https://www.dartlang.org/tools/analyzer) in [this file](https://github.com/dart-lang/sdk/blob/master/pkg/analyzer_cli/lib/src/options.dart) (didn't fix since the link is still working, it just gets redirected and the link is part of the programm, I don't want to break anything by changing it, all other links are in comments)
- [This link](https://github.com/domokit/mojo/issues/728) in [this file](https://github.com/dart-lang/sdk/blob/master/build/config/compiler/BUILD.gn) (didn't fix since probably has no new location and is part of TODO, which I don't want to change)

While doing all this I also noticed that [these tests](https://github.com/dart-lang/sdk/tree/master/tests/compiler/dart2js_extra) contain a lot of other inconsistencies in their comments and the location of the import-statements (I only fixed one which was not link-related), could be target of another PR.

Closes #36927
https://github.com/dart-lang/sdk/pull/36927

GitOrigin-RevId: 71d05d0b52d8ec5b92d077a070e066d1fdd4bbfa
Change-Id: Ide4b2424fccad8ae2e06c788efd4443dc0de997b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102222
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2019-07-01 16:21:41 +00:00
Mayank Patke af506eb45e [dart2js] Eliminate redundant call to universe(parser).
In lieu of actual common subexpression elimination, let's fake CSE by hand.

Change-Id: I09e75fda71af14465ff2cd2b678b1aaaebeed403
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107363
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-06-27 21:37:54 +00:00
Mayank Patke 92a93e797b [dart2js] Avoid allocating extra RTI for Future<T>.
Change-Id: Ifb46cfcd1171364afe506e7de09433f870e3e89b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107362
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-27 21:37:54 +00:00
Samir Jindel 496345e2e1 [vm/ffi] Update exception behavior of FFI callbacks and fix callbacks returning void
Issues dartbug.com/36856 and dartbug.com/37301

Change-Id: I96595b0781a3a6ddf73bba5595ed5c1aa08be257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106352
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-06-27 18:26:27 +00:00
Stephen Adams c6f708d2bf [dart2js] new-rti: Implement type literals
Emit type literals in the constant pool using recipes.

Change-Id: Ia5ea024b444596844e94afbe2a34ce33e8557604
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107454
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-27 16:39:36 +00:00
Todd Volkert c4af35cdf3 Update Datagram.data to be Uint8List
Bug: https://github.com/dart-lang/sdk/issues/36900
Change-Id: Ia0a4fcb6f21bcb16cb0418bfe9d1b880193fefed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104540
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-27 07:09:23 +00:00
Mayank Patke dcf9fecb69 [dart2js] Fix RTI bindCache getter/setter.
Change-Id: I2c3eae6dfabdc43ab7fa2261ac753600012bc6b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107455
Auto-Submit: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-27 03:31:23 +00:00
Todd Volkert ddfde57069 Update File.openRead to return Stream<Uint8List>
Bug: https://github.com/dart-lang/sdk/issues/36900
Change-Id: Ib2e417f4baa0048e2d4c2156c250d0cf454fdf87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104523
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-27 00:22:17 +00:00
Todd Volkert c92af46433 Update HttpRequest and HttpClientResponse to be Stream<Uint8List>
Bug: https://github.com/dart-lang/sdk/issues/36900
Change-Id: I1306b2df7c789597e49d2033b660a3ea62d6c1a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104525
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-27 00:21:07 +00:00
Stephen Adams f5892dafe6 [dart2js] new-rti: bindings
HInstanceEnvironment returns the type of an instance, which gives access to all
type variables of the supertypes. HInstanceEnvironment is currently lowered to a
call to 'instanceType', but we expect to lower to a field access in
most cases, or a constant type which can be folded into subsequent operations.

The type_builder builds a type environment for each type expression. The
environment is build from the instance type scope and the function type scopes.
GVN optimizations already introduce more sharing, but it might be advantageous to
pre-compute the environment and sink the operations instead.
Later we will pass multiple type arguments as tuples which will reduce the number
of operations, especially in factory constructors.

There are some tweaks removing types in rti.dart to avoid re-entrant code.


Change-Id: I004adf7a8a464e575b32d59476c888db46542fde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107460
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-26 21:11:27 +00:00
Mayank Patke 4628f3e086 [dart2js] Remove unnecessary arrayPush().
Change-Id: I1b5007c51de16addd3d8a5aca2a7b56ac11cae5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107311
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-25 23:37:04 +00:00
Mayank Patke 7b39dede0e [dart2js] Define canonical recipes in terms of recipe_syntax.
Change-Id: I4e5e4fea81dbef9bf0d2994d8dcbec23a4f1fb01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107309
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-25 22:59:24 +00:00
Mayank Patke 9b7bcfd1ce [dart2js] Support Future/FutureOr in RTI.
Change-Id: Ib0d849947d023a421d682061920faac8e6d7d352
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107220
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-25 22:59:24 +00:00
Mayank Patke 637cae2486 [dart2js] Add ability to check if RTIs are Object, Function, or Null.
Change-Id: Ia893c688fa619a87fd9ab97cf881f35763a48bdf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107080
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-24 20:36:59 +00:00
Daco Harkes 0400593d1c [vm/ffi] DynamicLibrary.handle
Issue: https://github.com/dart-lang/sdk/issues/35881

Change-Id: I67ff49fef950c7c507f5006c357909cd09914c5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106903
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-06-24 09:29:54 +00:00
Stephen Adams 990f84173c [dart2js] Implement encoder for recipes
Change-Id: Ia8fd313b014730859796abaf0083fdf738034365
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106941
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-22 00:00:21 +00:00
Mayank Patke 089a435344 [dart2js] Add subtyping for identical interface names without explicit type rule.
Change-Id: I0db1ff88e6fcb6a5e3f7615aa588afb473a77a16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106820
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-20 21:24:27 +00:00
Mayank Patke f4903989bb [dart2js] Refactor RTI type rules and streamline test harness.
Change-Id: I8c32ec329d26babcfccc3e06f4d3a7ead9257201
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106780
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-20 21:24:27 +00:00
Jonas Termansen 44415c49e4 [dart:_http] Require Cookie name and value to be valid.
This is a breaking change. https://github.com/dart-lang/sdk/issues/37192

This change makes the name and value positional optional parameters in the
Cookie class constructor mandatory by changing the signature from

  Cookie([String name, String value])

to

  Cookie(String name, String value)

The parameters were already effectively mandatory as a bug introduced in
Dart 1.3.0 (2014) meant the name and value parameters could not be null, and
any such uses already threw a noSuchMethod exception because null did not
have a length getter. As such, this is not a breaking change but adopts the
current behavior as a null name and value was already of questionable use.

Breaking change: This change adds validation to the String name and String
value setters, which had not been validating the fields at all, unlike the
constructor. This also forbids the name and value from being set to null.
That meant potentially invalid cookies could be sent to servers if the
cookie was modified after construction. This change adds the validation to
follow the rule of least surprise.

The documentation has been updated accordingly and improved a bit.

Closes https://github.com/dart-lang/sdk/issues/37192
Closes https://github.com/dart-lang/sdk/issues/29463

Change-Id: Iffed3dc265ca9c68142c4372522913f9d1ff4d51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103840
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-20 13:40:10 +00:00
Todd Volkert 9173aed1ba Declare return types of Uint8List.
These methods all were returning Uint8List, yet they were only
declared to return List<int>. This forced callers to either defensively
wrap the return values in Uint8List, or to assume the contravariant
return value:

* Utf8Codec.encode()
* BytesBuilder.takeBytes()
* BytesBuilder.toBytes()
* File.readAsBytes()
* File.readAsBytesSync()
* RandomAccessFile.read()
* RandomAccessFile.readSync()
* Uint8List.sublist()

Since it's related, this change also updates the following sublist()
methods to declare that they return the a sublist of the same type as
the source list:

* Int8List
* Uint8ClampedList
* Int16List
* Uint16List
* Int32List
* Uint32List
* Int64List
* Uint64List
* Float32List
* Float64List
* Float32x4List
* Int32x4List
* Float64x2List

Bug: https://github.com/dart-lang/sdk/issues/36900
Bug: https://github.com/dart-lang/sdk/issues/31547
Bug: https://github.com/dart-lang/sdk/issues/27818
Bug: https://github.com/dart-lang/sdk/issues/35521
Change-Id: Ic3bc1db0d64de36fb68b1d8d98037eed1464f978
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101742
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-20 06:43:44 +00:00
Todd Volkert 25b40a0291 Update RawSocket.read to return Uint8List
Bug: https://github.com/dart-lang/sdk/issues/36900
Change-Id: I0940d86dadce0acd41fb639a4598ffa36569c11a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104522
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-20 06:36:28 +00:00
Todd Volkert bd84cff2b1 Update InternetAddress.rawAddress to be Uint8List
Bug: https://github.com/dart-lang/sdk/issues/36900
Change-Id: I7ca3ddb22fb09e9b85eb15c6185b21c036b241a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104521
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-20 06:35:35 +00:00
Robert Nystrom ee8d2322d4 Remove support for ignoring cast failures in DDC.
Change-Id: I63aac10df5e26155f394623308a03c1977eba1e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106400
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-06-19 21:50:21 +00:00
Ryan Macnak 92701dfa48 [vm] Document clock compatibility between Timeline.now and Dart_TimelineGetMicros.
Change-Id: Ife4b5360b9c42221b9dac84014d072f60cd8f11c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106720
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-06-19 21:17:51 +00:00
Stephen Adams 98ded83813 [dart2js] Pull recipe syntax constants into shared library
Change-Id: Ibed00f517934ccfd5c0a05c6daedb72966b4ac01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106723
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-06-19 20:32:00 +00:00
Mayank Patke 0fae370538 [dart2js] Add subtyping rules to new RTI.
Change-Id: I9b70e2ccfc2dbac768fdccf4449b0f551a4fb5cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106486
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-06-19 20:01:16 +00:00
Ben Konyi a75ded625e [ VM / Service ] Made VM timeline functionality public through the service API.
Change-Id: I8228f0417047af53edc6f570940d452da3155bbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106061
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-06-19 16:06:12 +00:00
Stephen Adams 3619d26f70 [dart2js] Emit code for checks
Emit as-casts and type-checks.

The recipes and environments are dummy values, and there is no
propagation of type information, so the code is pretty terrible.

Change-Id: Iea8b7d7dddd4538187d88f12e9ed81439f74d0e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106428
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-18 02:38:18 +00:00
Stephen Adams 97522cfdd8 [dart2js] Emit a Rti universe
Use embedded names to keep the field names consistent.

Change-Id: Ic8986b38e4a30e9457221939c6512d0446fb32f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106203
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-17 22:15:47 +00:00
Nicholas Shahan 2073a822bd [dartdevc] Add top level function names to NSM error messages
These are now represented as named functions. This will also help the
debug tools give more information.

Tested with three applications and adding the names caused a code size increases
of less than 1%.

|Total App JS size | Increase |
|------------------|----------|
|  24.7 MB         |   0.06%  |
|  242  MB         |   0.14%  |
|  327  MB         |   0.19%  |

Fixes: #37118
Change-Id: I89a259215ceb8b9e559a190dbd521c923d4c55c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105546
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-06-17 20:58:31 +00:00
James Lin 977ae22f29 Make FileStat.stat's dartdoc provide a reference to FileSystemEntityType
Make the documentation to Filestat.stat (and similar functions)
provide a dartdoc reference to FileSystemEntityType.  Also adjust the
formatting of some other identifiers in comments.

Change-Id: I2af58e1c82136ef3ba1414b6f57c59fd8487d282
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94982
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: James Lin <jamesdlin@google.com>
2019-06-17 12:32:00 +00:00
Stephen Adams 3bacc84c1e [js_runtime] Install general stubs
These stubs always throw so test should not pass for the wrong reason.

Change-Id: Ie9d00046d3c7e34b8b53798f1c20eb14807e8632
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106183
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-14 22:56:00 +00:00
Zichang Guo ce9a582b05 [vm] RFC6874 support zoneID in uri parser
An implementation of https://tools.ietf.org/html/rfc6874.

IP-literal = "[" ( IPv6address / IPvFuture  ) "]"

will be updated to:

IP-literal = "[" ( IPv6address / IPv6addrz / IPvFuture  ) "]"
ZoneID = 1*( unreserved / pct-encoded )
IPv6addrz = IPv6address "%25" ZoneID

Bug: https://github.com/dart-lang/sdk/issues/29456
Change-Id: Ieac7b00e97d3ceff794f3b56ed4b6e4d9d6bbb47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103544
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-13 16:19:35 +00:00
Stephen Adams 68dadda21c Add other terminal Rtis
Change-Id: If70dc283a5fb06fa0d037fb0d30e4ba19352f8d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105736
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-13 00:22:28 +00:00
Stephen Adams b981798e3a Add environment.bind operation.
Change-Id: I2fd5d4b87e7fdd1fe75f064ec82c43a8334c2138
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105722
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-06-12 21:15:22 +00:00
Stephen Adams 701a2fed01 Parse binding recipes
Indexing scheme changed.

Change-Id: I44f7592b65d615827ea3b78f46117c71f3e50b31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105660
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-11 23:52:59 +00:00
Stephen Adams 7ecd81b0b8 Start on parser
Change-Id: Ibcc1dcb04735bcefd43f4239dcac28329f519c95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105470
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-11 03:17:35 +00:00
Sigmund Cherem ff863afb16 Fix ddc isolate patch (which broke at 4ccae238)
This was unfortunately not detected by the bots:

  * First because of #37117 this didn't break the build.

  * Second, because of how I am migrating modular_test to use the test matrix,
    we are temporarily not seeing failures either.

    I had the intention to wait to land my changes until after the test
    infrastructure had support to report the status of individual modular tests.
    I landed what I thought was safe to land first, but didn't realize that my
    first change already was hiding failures. Now I decided to move forward to
    land the rest of my changes, so the only thing that remains is to wait for
    the test infrastructure changes to land (ETA: very soon, a CL is already
    approved).

TBR=vsm@google.com

Change-Id: Ia06f4ce9bc5d9368fc36a88f9c9ce5530e42c983
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105404
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-06-07 22:08:09 +00:00
Nate Bosch 8614f86c9b Remove remaining support for dart:isolate on web
Closes #37153

Isolate.resolvePackageUri was the only API which had an implementation
across DDC and dart2js. The implementation in dart2js has been broken by
default since Dart 2.0.0 without a user implemented hook that is not
used on any public repo on github. Our current supported path for
invoking the compilers on projects disallows the import altogether on
the web and it is only usable with an older version of the
`build_web_compilers` package, or by invoking the compiler manually
outside of the build system. This CL does not break the ability to have
the import when invoking outside of the build system.

- Drop implementation for `Isolate.resolvePackageUri` from the dart2js
  and DDC patch files.
- Drop all references to `defaultPackagesBase` since it is not used.
- Drop all tests under `isolate/browser` since we do not expect any
  support on the web. Most of these tests would have already been
  failing. Remove status file entries that refer to the deleted tests.

Change-Id: I4a19213b0946d835c00e9c107a714f3bc5672f86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-06-07 21:13:06 +00:00
Stephen Adams d10dffbfbf Add simple test to create dynamic
- Add testing entry points to create Universe
- Add creation of 'dynamic'

Change-Id: I54dd27b9a2f6c93a382c4927e6a306b11bcea96c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105345
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-07 19:40:12 +00:00
Jonas Termansen 9ff2c109bb [dart:io] Clarify CompressionOptions null window bits means default window.
CompressionOptions's clientMaxWindowBits and serverMaxWindowBits are null
by default, indicating that no particular window size is negotiated in
the protocol, instead implying that the connection can handle a default
window size of 15 (32,768 bytes) (RFC 7692 7.1.2.1 and 7.1.2.2).

This change clarifies the documentation for the clientMaxWindowBits and
serverMaxWindowBits fields by stating they can be null to request the
protocol's default window size.

The current implementation's behavior is reasonable. It could be changed
to explicitly say 15 instead of null, but it's more efficient to omit the
request for 15 bits from the protocol since it's default, and it's fine to
allow callers to explicitly request 15 bits since the code already allows
this behavior. This change simply codifies the existing behavior in the
documentation.

The co19 test LibTest/io/CompressionOptions/DEFAULT_A01_t01 was written
based off the misleading documentation. An issue to test the intended
behavior was filed at <https://github.com/dart-lang/co19/issues/364>.

Closes https://github.com/dart-lang/sdk/issues/29436

Change-Id: If7645e7d5abd59715fd1eb0bfe8cbb877d776402
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103813
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-07 15:03:30 +00:00
Alexander Aprelev 4ccae238ea [vm/isolate] Add TransferableTypedData class that allows low-cost passing of Uint8List between isolates.
TransferableTypedData instances are one-use kind of thing: once receiver materializes it, it can't be used
again, once sender sends it out to an isolate, sender can't send it to different isolate.

Example of use:

sender isolate:

```
Future<TransferableTypedData> consolidateHttpClientResponseBytes(HttpClientResponse response) {
  final completer = Completer<TransferableTypedData>();
  final chunks = <Uint8List>[];
  response.listen((List<int> chunk) {
    chunks.add(chunk);
  }, onDone: () {
    completer.complete(TransferableTypedData.fromList(chunks));
  });
  return completer.future;
}
...
sendPort.send(await consolidateHttpClientResponseBytes(response));
```

receiver isolate:
```
    RawReceivePort port = RawReceivePort((TransferableTypedData transferable) {
      Uint8List content = transferable.materialize().asUint8List();
      ...
    });
```

31959[tr] and 31960[tr] tests were inspired by dartbug.com/31959, dartbug.com/31960 that this CL attempts to address:
```
╰─➤  out/ReleaseX64/dart 31960.dart
sending...
163ms for round-trip
sending...
81ms for round-trip
sending...
20ms for round-trip
sending...
14ms for round-trip
sending...
20ms for round-trip
sending...
14ms for round-trip
```

(notice no "since last checking" pauses") vs

```
╰─➤  out/ReleaseX64/dart 31960.dart
sending...
154ms since last checkin
174ms for round-trip
sending...
68ms since last checkin
9ms since last checkin
171ms for round-trip
sending...
13ms since last checkin
108ms for round-trip
sending...
14ms since last checkin
108ms for round-trip
sending...
14ms since last checkin
107ms for round-trip
```

Change-Id: I0fcb5ce285394f498c3f1db4414204531f98199d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99623
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-06 19:49:07 +00:00
Lasse R.H. Nielsen a8a0aff237 Add @Since annotations to some recent and future features.
Addresses some parts of #37127

Bug: http://dartbug.com/37127
Change-Id: Ia3a98e5764a16529331b2ba5613096d27061cab0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104763
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Todd Volkert <tvolkert@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-06-06 12:12:21 +00:00