Commit graph

10063 commits

Author SHA1 Message Date
Nicholas Shahan e2cb0b8553 [ddc] Fix function apply arguments list
- Fix default value assignment when passing a list of positional
  arguments that isn't a dart:core `List` at runtime.
- Fix modification of the original list passed as positional arguments
  when also passing named arguments.

Change-Id: I3aef6b1584f159c92251b963ffb927e1f75d3472
Fixes: https://github.com/dart-lang/sdk/issues/46457
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204900
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-06-25 15:44:15 +00:00
Lasse R.H. Nielsen 43cff26365 Add supertype to enum classes.
TEST= language/enum/enum_test

Change-Id: I83b7fd1c29103c3aa4dc7ad3e41141fb8c62339e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203564
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-06-25 14:08:16 +00:00
Lasse R.H. Nielsen 83376bf1ee Add Object.hash and Object.hashAll static helper methods.
Fixes #11617.

Bug: http://dartbug.com/11617
Change-Id: Id06fb5b3914bee24713427edbd3b9b7e86f86449
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/73360
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-06-25 11:40:35 +00:00
Stephen Adams 8fda1d6cf3 [js_runtime] Don't modify inputs to Function.apply
In some cases adding default arguments modified the 'positional'
arguments input List.  Since there are 'accelerated' paths for small
numbers of arguments, this bug did not show in any other tests.

Change-Id: I5075c96ecfdc9645b85b9beeeb38305415153d20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204747
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2021-06-24 03:29:38 +00:00
Mayank Patke 3405b94338 [dart2js] Remove Symbol.validated.
Bug: https://github.com/dart-lang/sdk/issues/46397
Fixes: https://github.com/dart-lang/sdk/issues/46397
Change-Id: I307f486deb7afe72c347bfeb6779cb9389d1ff13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204601
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-06-23 20:58:18 +00:00
Mayank Patke c015e02180 [dart2js] Fix spurious ! in ConstantMap.
Change-Id: I45ab75005c4f3d658c476886ede3ba37dbb067e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204625
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-06-23 18:30:11 +00:00
Stephen Adams 11991056b6 Specialize closures for 0 and 2 arguments
Change-Id: Ia21249cb9671960eb3e0d96afef5e5efb8ba7ee2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105200
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2021-06-23 16:54:41 +00:00
Lasse R.H. Nielsen f89ed9bfc3 More elaborate error when a future error handler returns something of the wrong type.
Bug: https://github.com/dart-lang/sdk/issues/44386, https://github.com/dart-lang/sdk/issues/41313
Change-Id: I87b10c3cd03475f4cd80b7a7c5cba6a558167748
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175062
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-06-23 11:25:25 +00:00
Ben Konyi 3a4b3514bc [ VM / Service ] Add UserTag support to C-API and send UserTagChanged
events on Developer stream.

Also removes intrinsic implementations for UserTag_makeCurrent to allow
for service events to be sent on UserTag change.

TEST=DartAPI_UserTags,pkg/vm_service/test/user_tag_changed_test.dart

Change-Id: I5dc9ee77c0048590d3c6e33a652eee5bc3bf522a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204440
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-06-23 00:58:47 +00:00
Nate Bosch 1948bd6109 Add fixes for HttpStatus constants
Add rename migrations for all the screaming snake case constants that
were renamed to lower camel case during the Dart 2 migraiton.

Rename the test from `file.dart` to `io.dart` so that we can test all
deprecations for the same import together. Add a test for the same
deprecations when imported through `dart:html`.

Change-Id: Iee91d88b1b11648e8c65cfcc8d2fcfabac3954ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203820
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2021-06-22 23:39:57 +00:00
Lasse R.H. Nielsen 902f149e2c Add unawaited function and ignore extensions member.
The `unawaited` function in `dart:async` is intended for use with the `unawaited_futures` lint which is hopefully going to be part of the Dart recommended set of lints.

The `ignore` extension method is there to provide an alternative if you even want to ignore errors from a future. By having both, it makes the distinction clearer and makes it easier to not think one can be used for everything.

Change-Id: Ib96ed5ff64ead4b228721e5210efa82f76119c9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200428
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-06-22 20:03:13 +00:00
Lasse R.H. Nielsen 19252d5786 Fix behavior for -infinity width/height of rectangles.
Fixes #30186
BUG= dartbug.com/30186

Change-Id: I2994d180a4dc4d4e4bba7edec67bc2bcc2e8fc0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201568
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-06-21 13:29:39 +00:00
Jason Simmons 2f9f746d83 Fix a typo in the Object docs (exception -> except)
Change-Id: Ie160e4b7daa2f989e23edf9f5248b612681d285e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204262
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-06-19 11:19:13 +00:00
Martin Kustermann 2ed0bb3596 [vm/concurrency] Allow rehashing of linked hashmaps that contain deleted entries
When rehashing linked hash maps we'll allow rehashing of hashmaps that
have deleted entries in them. This avoids making assumptions about the
state of a linked hashmap object at the time when it's transitively
copied.

It was split out of a follow-up CL that adds transitive object copies,
which will copy linked hashmaps as they are.

Issue https://github.com/dart-lang/sdk/issues/36097

TEST=Existing test coverage.

Change-Id: Ia844a14a3893e2416a11fa99d9de38025d6fac7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203773
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-06-18 05:58:11 +00:00
Tomasz Kontusz b14e5ed355 [doc] setTrustedCertificates doesn't replace certs
With the previous wording, "Sets the set of ... certificates", I've assumed it always replaces everything in the store (at least on non-iOS).
This change should make it clear that the certificates are added.

(See also bc2cf88bac/runtime/bin/security_context.cc (L181) for the actual implementation).

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

GitOrigin-RevId: 04d6cdece5f707af3e4d74aca983e4025fcc6cde
Change-Id: Ib3d3dcf41b78cb3925947d58e5c980b7bb82f331
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203720
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2021-06-16 08:35:05 +00:00
Nicholas Shahan c83eeac5b8 [ddc] Avoid sending messages to console.debug
Calling `postEvent()` or `registerExtension()` from the
dart:developer library now sends messages via global functions
that can be set by the development infrastructure. For example,
these hooks are set by package:dwds.

When there is no debugger attached to the app, calling `postEvent()`
or `registerExtension()` will produce a warning once each to avoid
spamming the debug log with messages that do nothing.

For backwards compatibility, when a debugger is attached but the
hooks have not defined continue to write the events to the
console.debug log. This support will be removed when package:dwds
no longer reads from the log.
https://github.com/dart-lang/webdev/issues/1342

Change-Id: I126446666b5a85c68424546b8b1198d1582bba74
Issue: https://github.com/flutter/flutter/issues/75225
Fixes: https://github.com/dart-lang/sdk/issues/36143
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202540
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-06-15 23:28:03 +00:00
Stephen Adams 8a60ce9e6d [dart2js] Pass tear-off parameters in an object
- Pass tear-off parameters in an object rather than a large number
  of variables.

- Reduce number of fields for BoundClosure. This speeds up tear-off
  creation 7-20%

-

Change-Id: Idf5313d5709a098cd5c877871417304f4e4c5b56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203445
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-06-15 22:19:13 +00:00
Clement Skau a7210551ca [VM] Nit: rename var with keyword name "native"
Change-Id: Id612c11d21f67734a95aaafd6ff19a017e44dd32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203681
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-06-15 11:07:50 +00:00
Clement Skau 2f916ad807 [vm/ffi] Adds @FfiNative() support
Adds support for marking external functions as @FfiNative's,
which will be called using fast FFI calls.

Resolution happens by calling out to a new embedder provided
Dart_FfiNativeResolver which the embedder can specify via
Dart_SetFfiNativeResolver.

TEST=vm/cc/DartAPI_FfiNativeResolver

Bug: https://github.com/dart-lang/sdk/issues/43889
Change-Id: I3cfff360b05314499a81444b90f4ea0a1b937b0b
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170092
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-06-15 05:58:39 +00:00
Gabriel Castro 820ba59dda [html] Fix nested JS Map to Dart assignment
Added check to convertNativeToDart_Dictionary to recursively convert native objects within a map to their Dart equivalent.

Fixes: https://github.com/dart-lang/sdk/issues/44319
Change-Id: I80a2bc0541454900b1c7d9635debaf72d7c120f2
Bug: 44319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201200
Commit-Queue: Gabriel Castro <gabrielmcastro@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-06-14 21:18:08 +00:00
Lasse Reichstein Holst Nielsen fdcc930bd0 Update String.split documentation.
Fixes #46280
BUG= http://dartbug.com/46280

Change-Id: I8425cb71fb3cdf97bd59ad48232f0ebb07878e3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202771
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-06-14 19:15:07 +00:00
Martin Kustermann 65bca53b6e [vm] Avoid going to runtime for String.split()
This makes the small benchmark on the github issue more than 2.5x
faster.

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

TEST=Existing test suite.

Change-Id: I82c53b3553e04f2afe23606b09b3199cb9b6a926
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203502
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-06-14 14:41:33 +00:00
Lasse Reichstein Holst Nielsen 2951e33b24 Add extra documentation on asBroadcastStream.
Fixes #30395
BUG= https://github.com/dart-lang/sdk/issues/30395

Change-Id: I887b4b5882b9f4801f29690c2d039941eb99efd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201567
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-06-14 09:44:42 +00:00
Alexander Aprelev 52aa8508f1 [io/stacktraces] Ensure websocket connect reports callers stacktrace.
Introduce dwarf-friendly socket connect stacktrace test.

TEST=socket_connect_dwarf_stacktrace_test

Fixes https://github.com/dart-lang/sdk/issues/46304

Change-Id: I428ac4b334d9d80ea06c64283ece3ff411abfa19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203160
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-06-10 16:16:50 +00:00
Stephen Adams 8ee467361b [dart2js] Fix for #46175
Pass compile-time shadowing information through tearoff code, rather
than trying to feature-test for potential overrides of the method
accessed via a super-getter.

Bug: 46175

Change-Id: Idca8e440cf12bb6cbae020f305763575e6a37b08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202803
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-06-10 03:30:09 +00:00
Ryan Macnak 84e6d4a4e8 [vm] Make use of the new TypedDataBase to avoid redundant code in the runtime.
Reduces VM code size by about 18k.

TEST=ci
Change-Id: Ic0dbdb6a7807a0f0d37333c6f32bed5cb3e7b905
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202543
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-06-08 19:15:38 +00:00
Alexander Aprelev 80749188ca [io/socket] When socket connection fails report stacktrace of the callsite.
Currently stack trace reported on thrown exceptions is null.

TEST=socket_connect_stacktrace_test.dart

Bug: https://github.com/dart-lang/sdk/issues/44994
Change-Id: I188aff197ab519272f63f41387b94458c2f1cec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202802
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-06-08 16:17:47 +00:00
Lasse Reichstein Holst Nielsen 1154efb073 Fix null-safety migration bug in VM version of fuse JSON-UTF-8 decoder.
A JSON value can be `null`, so the return type must be `Object?`, not `Object`.

Fixes #46205.

Bug: http://dartbug.com/462051
Change-Id: I9a5522e09765457dcf8cd2639abbe385d97a3186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202623
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-06-07 11:43:02 +00:00
Alexander Aprelev 3cd209692c [io/android] Enable file watching on Android.
Fixes https://github.com/dart-lang/sdk/issues/46261
File watching was partially disabled on android despite working as expected with
minor detail that [read] from inotify returns -1 at the end of the stream.

TEST=file_system_watcher_large_set

Change-Id: I4ce7a89ab1e531d91b62d0363ebc36f919d5b8a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202500
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-06-05 01:33:27 +00:00
Sigmund Cherem 80160d3efb [dart:html] add syntax highlighting to code blocks
Change-Id: I7dc008c01e776be8010da4845b3dc95643e34194
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202401
Auto-Submit: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-06-04 01:07:35 +00:00
Alexander Aprelev 6c254fab89 [io/http] Don't add zero-valued content-length header on GET, HEAD, DELETE, CONNECT requests.
Per https://tools.ietf.org/html/rfc7230#section-3.3.2:
"... A user agent SHOULD NOT send a
Content-Length header field when the request message does not contain
a payload body and the method semantics do not anticipate such a
body."

Fixes https://github.com/dart-lang/sdk/issues/45139

Change-Id: I96b735c06038eb3d12a303ee5329228a9b594726
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194881
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-06-03 16:14:24 +00:00
Robert Nystrom 4333b3db98 Add deprecation warning to dartfmt.
Change-Id: I7c67041fc84cddbc44b54e629eee79548fd6566b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202144
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2021-06-03 10:11:24 +00:00
Mayank Patke 93c96d5857 [dart2js] Implement basic lowering for late instance variables.
This feature is gated behind the --experiment-late-instance-variables
flag.

Change-Id: I1ecb2d4d960b58204207ea055361463efa3a0bcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200922
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-06-02 23:21:24 +00:00
Stephen Adams d3d6c86fe1 [dart2js] Migrate shared libraries to 2.12
Change-Id: I5600fe01e90963b56a6ffa36ec9edf0096088b2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202000
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-06-02 21:41:34 +00:00
Simon Binder be893fdf27 [vm/ffi] Add providesSymbol to DynamicLibrary
This adds the providesSymbol method to DynamicLibrary. It returns
whether the library contains a function with the given name.

As per dlsym(3), it is valid for dlsym to return nullptr in a success
case if the symbol actually has a NULL value. So I've changed the logic
to check for dlerror() after we invoke dlsym(), both in the existing
lookup and in the new method.

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

TEST=tests/ffi(_2)/has_symbol_test.dart

Change-Id: Ibcb1c051cc0cdd95a104fe86ef2fc76da5bafb5d
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-mac-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201900
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-06-02 16:01:43 +00:00
Jason Simmons b67de429e0 Move the frontend server snapshot into the platform SDK
Change-Id: I15bfa8690fe792a4f0c4ac66a337fdc9c2647626
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201920
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2021-06-01 21:05:35 +00:00
Ryan Macnak ab91ef643c [vm] Remove code dead since the type 'int' stopped supporting integers.
Change-Id: I72e1760a8172d8486b634abddbfc1ca8759a375c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197441
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-06-01 17:18:33 +00:00
Riley Porter f08edad8ce Optimize js_util setProperty calls for non-function values to
_setPropertyUnchecked version that can be inlined.

No change in the generated JavaScript for dart2js.

Change-Id: Ie4a8e5a34826b6c9083d34656aaa27050635cb21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200933
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-05-25 19:28:01 +00:00
Stephen Adams 7572e5ba4a [js_runtime] Speed up 'is List' test on negative path
Change-Id: Ie8849837a394724fb3e8419eacc283d8cd370d69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201229
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-05-25 18:03:01 +00:00
Michael Thomsen cac00e9d95 Add deprecations notices to dart2native
Related to: https://github.com/dart-lang/sdk/issues/46100

Change-Id: I2bcd4aadfbc96fa6ba265aec04cd60e3e81eef41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199429
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2021-05-25 13:20:30 +00:00
Clement Skau 4d5055805f [VM/FFI] Adds FFI leaf calls.
This CL adds FFI leaf calls by adding `lookupFunction(.., isLeaf)`
and `_asFunctionInternal(.., isLeaf)`, which generate FFI leaf calls.
These calls skip a lot of the usual frame building and generated <->
native transition overhead.

`benchmark/FfiCall/` shows a 1.1x - 4.3x speed-up between the regular
FFI calls and their leaf call counterparts (JIT, x64, release).

TEST=Adds `tests/ffi{,_2}/vmspecific_leaf_call_test.dart`. Tested FFI tests.

Closes: https://github.com/dart-lang/sdk/issues/36707
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-release-arm64-try,vm-ffi-android-release-arm-try,vm-ffi-android-product-arm64-try,vm-ffi-android-product-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-precomp-nnbd-mac-release-simarm64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try
Bug: https://github.com/dart-lang/sdk/issues/36707
Change-Id: Id8824f36b0006bf09951207bd004356fe6e9f46e
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179768
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-05-21 11:12:02 +00:00
Alexander Aprelev 8d54a30825 [io/http] Introduce callback that embedder can override to provide custom HTTPClient connection validation.
For example, this can be used to ban insecure http connections, force use of https ones - see https://github.com/flutter/engine/pull/26226.

Issue https://github.com/flutter/flutter/issues/69685
Issue https://github.com/flutter/flutter/issues/54448

Change-Id: Id81aeae9aff0d469ac6f911e4e502b39ce9558bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200524
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-20 15:17:52 +00:00
Daco Harkes 413abf0d82 [sdk] Recover folder structure in include folder 2
Such that runtime/include/internal/dart_api_dl_impl.h ends up in
include/internal/dart_api_dl_impl.h in the sdk release.

Long explanation:

https://dart-review.googlesource.com/c/sdk/+/164320 tried to recover the
folder structure but failed to do so correctly. It put
runtime/include/internal/dart_api_dl_impl.h in
include/runtime/dart_api_dl_impl.h rather than
include/internal/dart_api_dl_impl.h.

The gn copy action only supports a single `outputs` string.
https://gn.googlesource.com/gn/+/HEAD/docs/reference.md#var_outputs

This string can have 'placeholders'.
https://gn.googlesource.com/gn/+/HEAD/docs/reference.md#placeholders

The only placeholder that preserves the original folder structure,
without also nesting deeply inside folders is `source_target_relative`.

If `source_target_relative` inside sdk/BUILD.gn it starts including
`runtime/include/` in its path. So the only way to achieve the correct
copy is by doing it in runtime/include/BUILD.gn.

TEST=Manual testing, we don't have tests verifying the SDK structure.

Change-Id: I9d503626266edcdd8417f5cafb0f8ff9746f89f7
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200866
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-05-20 13:54:42 +00:00
Lasse R.H. Nielsen cf627eb01c Change signature of HttpClient.authenticate{,Proxy}.
Allow the `realm` argument to callbacks to be `null`.
This is a breaking change, but it only affects null-safe code.

Also fix a bug in http_impl.dart where an error function with
an *optional* stack trace parameter would be called without a stack trace.

Bug: https://github.com/dart-lang/sdk/issues/44039
Change-Id: I4b38382328e26478661bf45f46cd3017631f4ebd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170094
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-05-20 13:13:42 +00:00
asiva 6f2eeae1a4 [sdk] - Fix for issue 46050 (Allow spaces in environment constants)
TEST=Manual command line test

Change-Id: I0e6e70093df32b4878b32b91ab101af5ffb8d1a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200661
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-05-19 19:09:02 +00:00
Stephen Adams cb23be0b5f [rti] Specialized is List<dynamic> test
Change-Id: I7ded143b8316a5b3f78f8fe358cf7341f42d8ddd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200288
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-05-19 01:12:43 +00:00
Lasse R.H. Nielsen 59526f4311 Address missed comments from CL https://dart-review.googlesource.com/c/sdk/+/200189
Change-Id: I54baa2ca802c6524ddf5baf9c205d5c6bb2e9779
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200223
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-05-18 11:00:14 +00:00
Jacob MacDonald 4da697ce56 fix todos linked to issue #38725
Change-Id: I06fd71b4027673105be8a3219af61fbc9b93e216
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200282
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-05-17 20:51:52 +00:00
Alexander Aprelev 0aeb8731e5 [vm] Use recognized method for has63BitSmis, drop static final field.
This should improve performance of lightweight isolates configuration

TEST=ci, perf benchmarks

Change-Id: I98ac9a7e02318d58db3431a6d33f08ab95e607fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199700
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-05-17 17:22:13 +00:00
Lasse R.H. Nielsen c88d8163c0 Update documentation for num.operator< and other members.
Fixes #46015.

Bug: http://dartbug.com/46015
Change-Id: I6a8b245e10c644df84f767df4f24404b332af9b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200189
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-05-17 16:56:22 +00:00
asiva fb90f11f4b [dart:io] - Fix incorrect setting of socket options for UNIX-DOMAIN sockets
- setting of UNIX-DOMAIN socket options was not throwing the correct error
- listen in HTTPServer was trying to set TCP_NODELAY for UNIX-DOMAIN sockets

Fixes :
 https://github.com/dart-lang/sdk/issues/45977
 https://github.com/dart-lang/sdk/pull/45978
 https://github.com/dart-lang/sdk/issues/45975

TEST=new test cases added

Change-Id: Ie0341f26b1ba0f9423c08a8de968053a2af1c730
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199640
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-05-14 01:53:48 +00:00
Joshua Litt b8a1cd4850 [dart2js] Cleanup obsolete 'getGlobalFromName' builtin.
Change-Id: Ie2b0f586fedbd183ea98b08fc766d5acf52d9e7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198881
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-05-13 20:47:38 +00:00
Kenzie Schmoll a0de473efd Update UserTag class documentation to point to DevTools instead of Observatory
Change-Id: I3814bc4cf1485d78409bd358fb62df9794c824ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199740
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
2021-05-13 19:19:55 +00:00
Jonas Finnemann Jensen 47f88b5ff3 Removed 7zip from Windows distribution of the Dart SDK
Bug: https://github.com/dart-lang/pub/issues/2939
Change-Id: I30148017e33a4d7af99102bd98b99e70d5641478
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199250
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-05-12 14:50:50 +00:00
Mayank Patke 2d62f325a2 [dart2js] Add a flag to omit names for late cells.
Change-Id: I67125e35b5339697b97738dd0c5540fe7a773510
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199300
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-05-12 14:02:10 +00:00
Lasse R.H. Nielsen a5e18113f3 Remove references to triple-shift and generic-metadata experiments.
TEST= removed flags from test. No behavior should change.

Change-Id: I401bfb68c082d1bd405a118d5eca6a47a807945f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199241
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-05-12 13:35:00 +00:00
Sigmund Cherem 460887d814 [web] Replace DDC's expando implementation
DDC now uses WeakMaps, just like dart2js. This ensures that expandos
will also continue to work properly after a hot restart.

Fixes https://github.com/dart-lang/sdk/issues/45874

Change-Id: I89799b4da9cb7827500a14dcdc2aff7c5e6afa03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199222
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-05-11 22:14:28 +00:00
Sigmund Cherem 7a18ef405e [web] Cleanup dart2js implementation of expandos.
This removes the feature detection of WeakMaps and no longer uses a raw
field to implement an expando. This is because WeakMaps are supported in
all browsers we currently support, and are also supported in IE11.

Change-Id: Ia0bc8261a3eb3dd4fad8cba5d0a2abecd1d3ecc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199220
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-05-11 22:14:28 +00:00
Ben Konyi b99466d472 Reland "[ VM / DDS / CLI ] Add DevTools support to the standalone VM"
This reverts commit 5cbf10febe.

TEST=pkg/dds/devtools_observatory_connection_test.dart

Change-Id: I682d009f784b930094dae9b7d4e9a66efffb6ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198561
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-11 17:55:26 +00:00
Lasse R.H. Nielsen f5a1dd57a1 Change parameters named f to something longer on Iterable.
Remove some unnecessary `new`s while here.

Bug: http://dartbug.com/30399
Change-Id: Ie5665fc680bcd25a74dd765ef68dc88e2c54b671
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192385
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-05-10 15:03:20 +00:00
Lasse R.H. Nielsen 5b64d1233b Fix null-safety migration error in CastMap.
Make expect use `Never` to signal non-completion instead of depending on `meta`.

Change-Id: Ibb4230e6b0cfbf995ad91a31c6620525cf6a8918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194244
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-05-10 14:15:07 +00:00
Stephen Adams b7d2dbe9b5 [js_runtime] Cleanup some dynamic calls
Change-Id: I7fe4dab27f1d6fb2e52a171bd8f373c3decc0b7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197562
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-05-07 22:47:47 +00:00
Ben Konyi 5cbf10febe Revert "[ VM / DDS / CLI ] Add DevTools support to the standalone VM"
This reverts commit ef0e4ea107.

Reason for revert: Flutter HHH and golem builds are red. Rolls to Flutter are failing.

TEST=N/A

Original change's description:
> [ VM / DDS / CLI ] Add DevTools support to the standalone VM
>
> Example output on stdout when DevTools is enabled:
>
> Observatory listening on http://127.0.0.1:8181/CzkZzZaONW4=/
> The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/devtools/#/?uri=ws%3A%2F%2F127.0.0.1%3A8181%2FCzkZzZaONW4%3D%2Fws
> hello world!
>
> vm-service: isolate(1674461414267555)  'main' has no debugger attached and is paused at exit.  Connect to Observatory at http://127.0.0.1:8181/CzkZzZaONW4=/ to debug.
>
> TEST=pkg/dartdev/test/commands/run_test.dart
>
> Change-Id: Icd1afda87ad4a46f228125d53094d10adf8056ec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188361
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I50e8dc4e592e13b44c2fb980b2029d5c5cc3ad2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198381
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-05-05 20:31:07 +00:00
Nicholas Shahan 0c53b5999c [ddc] Remove unnecessary call to addTypeCaches
The `makeGenericType` closure is not actually used as a type so the
caches are not needed.

The caches are already added to the type in body of `typeConstructor`
that gets called on line 236.

This change showed no notable differences in performance:
Weak:
https://golem.corp.goog/Comparison?repository=dart&team=dartdevc#targetA%3Ddartdevc%3BmachineTypeA%3Dlinux-x64%3BrevisionA%3D92073%3BpatchA%3Dnshahan-generic-perf%3BtargetB%3Ddartdevc%3BmachineTypeB%3Dlinux-x64%3BrevisionB%3D92073%3BpatchB%3DNone
Sound:
https://golem.corp.goog/Comparison?repository=dart&team=dartdevc#targetA%3Ddartdevc-null%3BmachineTypeA%3Dlinux-x64%3BrevisionA%3D92073%3BpatchA%3Dnshahan-generic-perf%3BtargetB%3Ddartdevc-null%3BmachineTypeB%3Dlinux-x64%3BrevisionB%3D92073%3BpatchB%3DNone

Change-Id: Ife8b5353b30205d16e56cb52f0db4909fc965846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197821
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-05-04 19:48:11 +00:00
Nicholas Shahan 7ae257ebdf [ddc] remove extra call of addTypeCaches
The caches on FutureOr types were accidentally being cleared every time
one was created with the same type argument. These caches are already
added on every FutureOr class that is created in the wrapping for
generic types.

This bug surfaced when a class with a circular type hierarchy that must
be deferred included a FutureOr. The result was infinite recursion when
creating the type because the caches were always empty.

This change showed no notable differences in performance:
Weak:
https://golem.corp.goog/Comparison?repository=dart&team=dartdevc#targetA%3Ddartdevc%3BmachineTypeA%3Dlinux-x64%3BrevisionA%3D92060%3BpatchA%3Dnshahan-FutureOr-perf%3BtargetB%3Ddartdevc%3BmachineTypeB%3Dlinux-x64%3BrevisionB%3D92059%3BpatchB%3DNone
Sound:
https://golem.corp.goog/Comparison?repository=dart&team=dartdevc#targetA%3Ddartdevc-null%3BmachineTypeA%3Dlinux-x64%3BrevisionA%3D92060%3BpatchA%3Dnshahan-FutureOr-perf%3BtargetB%3Ddartdevc-null%3BmachineTypeB%3Dlinux-x64%3BrevisionB%3D92058%3BpatchB%3DNone

Change-Id: I985e0ab2898a8a68ac6cdf4d0a738120bc42c623
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197900
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-05-04 19:46:51 +00:00
Ben Konyi ef0e4ea107 [ VM / DDS / CLI ] Add DevTools support to the standalone VM
Example output on stdout when DevTools is enabled:

Observatory listening on http://127.0.0.1:8181/CzkZzZaONW4=/
The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/devtools/#/?uri=ws%3A%2F%2F127.0.0.1%3A8181%2FCzkZzZaONW4%3D%2Fws
hello world!

vm-service: isolate(1674461414267555)  'main' has no debugger attached and is paused at exit.  Connect to Observatory at http://127.0.0.1:8181/CzkZzZaONW4=/ to debug.

TEST=pkg/dartdev/test/commands/run_test.dart

Change-Id: Icd1afda87ad4a46f228125d53094d10adf8056ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188361
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-03 18:24:09 +00:00
Vyacheslav Egorov a11d9f17fb [vm] Fix race when setting identity hash codes.
We might interrupt Object._objectHashCode(obj) helper to serve a
vm-service request between checking for unset hash code and setting
a new hash code. While serving this request we might set the hash
code of [obj] (e.g. when generating heap snapshot or in
Instance::PrintJSONImpl). Later Object._objectHashCode will call
Object_setHash, which (on 64-bit platforms) assumes that
hash field in the object header is set to 0 and uses bitwise-or
to initialize it. This leads to a mismatch between hash code that
the first invocation of _objectHashCode will return and the
value stored in the header (because we OR non-zero value set
by vm-service with a value which _objectHashCode intended to
use as a hash).

This CL changes Object_setHash to avoid overwriting or mangling
the hash value if it was already set.

We also fix hash code generation in vm-service to ensure that we
only generate values which are valid Smis because the rest of the
code expects that.

TEST=pkg/front_end/test/incremental_compiler_leak_test.dart

Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm64-try
Change-Id: Ica913af8bc1cfef0ad60a9e7504531ee4de53015
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197400
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-05-03 11:47:08 +00:00
Srujan Gaddam 7abaa95492 [dart:html] Fix Geoposition bindings and callbacks
Closes https://github.com/dart-lang/sdk/issues/45562
Closes https://github.com/dart-lang/sdk/issues/44324

Geoposition should be bound to GeolocationPosition as well since
Position is deprecated since Chrome 79.

Similarly, success callbacks used in the Geolocation API can accept
a Firefox-specific implementation, so the callback should accept a
dynamic instead. Doing this requires adding annotations to the APIs
so liveness of Geolocation types is maintained.

Change-Id: Id38f68d10c9cdcb7d711ef83a70df87b30be405d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194325
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-04-29 21:32:15 +00:00
Nate Bosch 427e17dfce Allow null to flow through _throwFormatException
In the case of `tryParse` the intention was for the `onError` callback
to return `null`, however in strong mode this can't be returned through
the `int` return type so there is an exception.

Add types to the `onError` callback to make it explicit that below the
boundary of the public `parse` method the callback may return null. A
`null` return from the `onError` callback is now caught in strong mode
within `parse` with an `as int` cast.

Remove the catch-all error handler that masked this issue.

TEST=ci

Change-Id: Ib8b266e0d7e425c1811145e80b6f5bd4a81d4c6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193960
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2021-04-29 10:22:45 +00:00
Chandru S 871374447f Expose loadId during deferred loading that will allow for advanced bundling optimizations.
Change-Id: Ic4e5edd8dc4761e49b4eb97892c75b869adfc2a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196980
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-04-27 01:40:48 +00:00
Sigmund Cherem d52475c166 [web] deprecate dart:web_sql
The WebSql was dropped 5+ years ago and this library is unsupported.

This change adds the `@deprecated` annotation on the library and APIs in
dart:html that expose it (`window.openDatabase`). It also indicates to dartdoc
to skip it for the api.dart.dev site.

I run a `pub_crawl` process to verify that this is not in use. I checked 15K
packages, and only found 2 occurrances of an import to this library:
  * One in a package marked as discontinued (used for migrating constants back
  in Dart 2)
  * Another in an example mock test (generated by mockito for mocking dart:html)
Also no library uses `window.openDatabase` either.

We will send a breaking change announcement soon and plan to delete this in a
future Dart release (possibly 2.15).

Fixes https://github.com/dart-lang/sdk/issues/45687
Fixes https://github.com/dart-lang/sdk/issues/45688

Change-Id: I8cd2bfa0ce64892c3f108bd6e24b8a0a3ec7c6ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196461
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-04-23 19:04:42 +00:00
Dan Field 5776d576a0 Reland "Make throwing Zone.uncaughtError handlers propagate the error to their parent zone."
This reverts commit f0a8b63402.

Reason for revert: The Flutter SDK issues have been resolved - see https://github.com/flutter/flutter/issues/80969 and https://github.com/flutter/flutter/pull/81014

Original change's description:
> Revert "Make throwing Zone.uncaughtError handlers propagate the error to their parent zone."
>
> This reverts commit 88a351f3d2.
>
> This broke the Dart SDK -> Flutter Engine roller. Flutter issue at https://github.com/flutter/flutter/issues/80969
>
> Change-Id: Idaf255a730c7b6054e6cd929b6770dbe66860151
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196561
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Zach Anderson <zra@google.com>

# Not skipping CQ checks because this is a reland.

Change-Id: Icd98c550c63160f35cc5da40af7ca6bf2cbf180e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196621
Reviewed-by: Dan Field <dnfield@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Dan Field <dnfield@google.com>
2021-04-23 05:24:41 +00:00
George Wright f0a8b63402 Revert "Make throwing Zone.uncaughtError handlers propagate the error to their parent zone."
This reverts commit 88a351f3d2.

This broke the Dart SDK -> Flutter Engine roller. Flutter issue at https://github.com/flutter/flutter/issues/80969

Change-Id: Idaf255a730c7b6054e6cd929b6770dbe66860151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196561
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2021-04-22 22:20:16 +00:00
Emmanuel Pellereau 335f55a601 Revert "Optimize js_util setProperty calls for non-function value types."
This reverts commit 853597a978.

Reason for revert: Breaks google3 (b/186088197)

Original change's description:
> Optimize js_util setProperty calls for non-function value types.
>
> No change in the generated JavaScript for dart2js base on a sample
> foo.dart file and tests/lib/js/js_util/properties_test.dart
>
> Bug: #44533
> Change-Id: Ib6866fa7fca1f13b03c75dd4f1eac904b18811e3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193838
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Riley Porter <rileyporter@google.com>

TBR=sigmund@google.com,srujzs@google.com,rileyporter@google.com

Change-Id: I3f08d29e2d6a1a7846b8d67fadc314ad947f54cf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: #44533
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196484
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2021-04-22 09:27:29 +00:00
Stephen Adams b529afd10a [dart2js] rename setRuntimeTypeInfo to _setArrayType
For a long time now this is used only to put types on JSArray.

Change-Id: I31f15d313d7e131eecac76697a8938c197f83e7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195940
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-04-22 02:06:31 +00:00
Riley Porter 853597a978 Optimize js_util setProperty calls for non-function value types.
No change in the generated JavaScript for dart2js base on a sample
foo.dart file and tests/lib/js/js_util/properties_test.dart

Bug: #44533
Change-Id: Ib6866fa7fca1f13b03c75dd4f1eac904b18811e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193838
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-04-21 19:01:11 +00:00
Lasse Reichstein Holst Nielsen 88a351f3d2 Make throwing Zone.uncaughtError handlers propagate the error to their parent zone.
Avoids infinite recursion when the uncaught error is handled by the same,
potentially still failing, uncaught error handler.

Bug: https://github.com/dart-lang/sdk/issues/45616, https://github.com/dart-lang/sdk/issues/45617
Change-Id: I60ee0f1220b7345f4a41e1f1b323b8da47ed326e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194402
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-04-21 07:52:58 +00:00
Stephen Adams fc3ce31d39 [dart2js] Remove vestiges of reflection
Change-Id: I8d6beadc6e1d6b4525d810308957ca5527f19eb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195463
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-04-20 21:40:08 +00:00
Xiao Yu d968304570 Reland "Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic"
This is a reland of d84f359786

Original change's description:
> Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic
>
> Bug: https://github.com/flutter/flutter/issues/72723
> Change-Id: Ib5f809fccf1fad69add441fd40c463da8dc8be36
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192953
> Auto-Submit: Xiao Yu <xster@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

Bug: https://github.com/flutter/flutter/issues/72723
Change-Id: I466d888b3f324a996f0bef0463e7ab3df3179c56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195485
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Xiao Yu <xster@google.com>
2021-04-16 20:25:36 +00:00
Stephen Adams 7754a868dd [dart2js] Remove static state accessors
Change-Id: I58391845d3e28b041b7bb1746e696610d113ea7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195511
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-04-16 03:43:17 +00:00
Xiao Yu f560d90059 Revert "Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic"
This reverts commit d84f359786.

Reason for revert: removed some private looking but actually vm-entrypoints used by Flutter engine https://buganizer.corp.google.com/issues/185462669

Original change's description:
> Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic
>
> Bug: https://github.com/flutter/flutter/issues/72723
> Change-Id: Ib5f809fccf1fad69add441fd40c463da8dc8be36
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192953
> Auto-Submit: Xiao Yu <xster@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>

TBR=lrn@google.com,vegorov@google.com,xster@google.com

Change-Id: Ie746805ab7ef214bc4ba6f3582eb1d32672360ee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/flutter/flutter/issues/72723
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195484
Reviewed-by: Xiao Yu <xster@google.com>
Commit-Queue: Xiao Yu <xster@google.com>
2021-04-15 15:29:28 +00:00
Daco Harkes 8a2b7bb5d5 [vm/ffi] Support Unions
Closes: https://github.com/dart-lang/sdk/issues/38491

tools/test.py ffi ffi_2
TEST=tests/ffi(_2)/(.*)by_value_(*.)_test.dart

Change-Id: I6d29f7e3c3046cda4a15c9b42063c66b064787be
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-linux-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194420
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-04-15 10:16:27 +00:00
Alexander Thomas b5c63ce757 [infra] Migrate scripts to python3
* Migrate to python3; drop python support.
* Update Windows toolchain support.
* Remove some unused methods.
* Python 2.7 is still needed on Windows.
* Update gsutil to a version that supports python3.

Fixes: https://github.com/dart-lang/sdk/issues/28793

TEST=Manually tested common user journeys.

Change-Id: I663a22b237a548bb82dc2e601e399e3bc3649211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192182
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-15 10:10:20 +00:00
Xiao Yu d84f359786 Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic
Bug: https://github.com/flutter/flutter/issues/72723
Change-Id: Ib5f809fccf1fad69add441fd40c463da8dc8be36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192953
Auto-Submit: Xiao Yu <xster@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-04-15 09:25:17 +00:00
Stephen Adams 813019a9c5 [dart2js] Remove old-rti substitution property from namer
Change-Id: I696220cba191b5df4ffd14abd62a718708366f7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195308
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2021-04-15 04:46:56 +00:00
Daco Harkes 4558112105 Rereland "[vm/ffi] Disallow Pointers and structs in finalizers and expandos"
`Dart_NewWeakPersistentHandle` and `Dart_NewFinalizableHandle` in
`dart_api.h` do no longer accept `Pointer`s and subtypes of `Struct`s
as values passed in to the `object` parameter.

Expandos no longer accept `Pointer`s and subtypes of `Struct`s
as values passed in to the `object` parameter.

Cleans up unused object_store->ffi_struct_class.

Reland 1: Allow importing `dart:ffi` from `dart:core` with
          `--enable-ffi=false`.
Reland 2: Allow the new `_Compound` class to extend `NativeType`. (This
          got triggered in this CL on the build because of the import
          from `dart:core`.)

Closes: https://github.com/dart-lang/sdk/issues/45071
Breaking change: https://github.com/dart-lang/sdk/issues/45072

TEST=vm/cc/DartAPI_FinalizableHandleErrors
TEST=vm/cc/DartAPI_WeakPersistentHandleErrors
TEST=tests/ffi(_2)/expando_test.dart

Change-Id: I133278e16bd75cd2bb6234e7ddf042ffa0a54fd6
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-linux-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195079
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-14 12:07:18 +00:00
Srujan Gaddam 3d52fcd250 [dart:html] Type FontFaceSet.add result as nullable
Closes https://github.com/dart-lang/sdk/issues/45676

`FontFaceSet.add` can return null on Firefox, which leads to a crash
due to native null assertions. The scripts are modified to treat
the `add` return type as nullable.

Change-Id: I8fcff8ef716e8620f04c44f5fb8b3a5884b3d1db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195167
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-04-14 00:00:08 +00:00
Srujan Gaddam ce5a1c2392 [dart:html] Fix sanitization for HTML templates
Bug: b/143778164

Resolves an issue where sanitization wasn't properly handled
when templates were involved.

Change-Id: Ic8f6f28036e18981eb934c2b39c2c0cd4e6f1a96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195056
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-04-13 23:29:08 +00:00
Ryan Macnak 55645786bc Revert "[vm, compiler] Support unboxed parameters for integer intrinsics."
This reverts commit 1d369b5000.

Reason for revert: Failures on Golem

Original change's description:
> [vm, compiler] Support unboxed parameters for integer intrinsics.
>
> TEST=ci
> Change-Id: I7f29471043c049ef1acf7cd4bcb0890db6d33aa4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192728
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I09e54cd894c0f73bf3af215729567503c156ec3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195165
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-04-13 17:05:47 +00:00
Daco Harkes c33dad37e5 Revert "Reland "[vm/ffi] Disallow Pointers and structs in finalizers and expandos""
This reverts commit 3f0ad61daa.

Reason for revert: Conflicts with https://dart-review.googlesource.com/c/sdk/+/194765

Original change's description:
> Reland "[vm/ffi] Disallow `Pointer`s and structs in finalizers and expandos"
>
> `Dart_NewWeakPersistentHandle` and `Dart_NewFinalizableHandle` in
> `dart_api.h` do no longer accept `Pointer`s and subtypes of `Struct`s
> as values passed in to the `object` parameter.
>
> Expandos no longer accept `Pointer`s and subtypes of `Struct`s
> as values passed in to the `object` parameter.
>
> Cleans up unused object_store->ffi_struct_class.
>
> Closes: https://github.com/dart-lang/sdk/issues/45071
> Breaking change: https://github.com/dart-lang/sdk/issues/45072
>
> TEST=vm/cc/DartAPI_FinalizableHandleErrors
> TEST=vm/cc/DartAPI_WeakPersistentHandleErrors
> TEST=tests/ffi(_2)/expando_test.dart
>
> Change-Id: I9af6d0173db60614091068c218391f73756c135f
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195061
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

TBR=kustermann@google.com,dacoharkes@google.com

Change-Id: I90064b6b73155a43f37388f987c6b29f72ce9770
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195076
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-13 15:05:07 +00:00
Daco Harkes 3f0ad61daa Reland "[vm/ffi] Disallow Pointers and structs in finalizers and expandos"
`Dart_NewWeakPersistentHandle` and `Dart_NewFinalizableHandle` in
`dart_api.h` do no longer accept `Pointer`s and subtypes of `Struct`s
as values passed in to the `object` parameter.

Expandos no longer accept `Pointer`s and subtypes of `Struct`s
as values passed in to the `object` parameter.

Cleans up unused object_store->ffi_struct_class.

Closes: https://github.com/dart-lang/sdk/issues/45071
Breaking change: https://github.com/dart-lang/sdk/issues/45072

TEST=vm/cc/DartAPI_FinalizableHandleErrors
TEST=vm/cc/DartAPI_WeakPersistentHandleErrors
TEST=tests/ffi(_2)/expando_test.dart

Change-Id: I9af6d0173db60614091068c218391f73756c135f
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195061
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-13 13:52:36 +00:00
Alexander Aprelev 8800decca4 [io] Move OSError::isInprogressCode to implementation patch class.
This addresses comments on https://dart-review.googlesource.com/c/sdk/+/193221.

TEST=ci

Change-Id: I0eaac9f640b172e37da6199f7353de8b066f854e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195059
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-04-13 13:52:06 +00:00
Daco Harkes bde9578a39 [vm/ffi] Introduce _Compound NativeType
Introduces the class `_Compound extends NativeType`, for sharing between
`Struct` and `Union`.

Does minimal changes to CFE and IL construction. Follow up refactor CLs
rename everything.

Bug: https://github.com/dart-lang/sdk/issues/38491

tools/test.py ffi ffi_2
TEST=tests/ffi(_2)/(.*)by_value_(*.)_test.dart

Change-Id: I276ceb9249c20bd331c2f8b6ef64e35acb525e9c
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194765
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-04-13 12:50:17 +00:00
Mayank Patke 05a0508e7c [dart2js] Implement Cell lowering for initialized local variables.
Change-Id: I99c1274e1a74693be329ad9f582baf2a9817934a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194961
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-04-13 02:25:46 +00:00
Daco Harkes ac2412ca01 Revert "[vm/ffi] Disallow Pointers and structs in finalizers and expandos"
This reverts commit 2376ab5186.

Reason for revert: Importing dart:ffi from dart:core breaks the VM when using --enable-ffi=false

Original change's description:
> [vm/ffi] Disallow `Pointer`s and structs in finalizers and expandos
>
> `Dart_NewWeakPersistentHandle` and `Dart_NewFinalizableHandle` in
> `dart_api.h` do no longer accept `Pointer`s and subtypes of `Struct`s
> as values passed in to the `object` parameter.
>
> Expandos no longer accept `Pointer`s and subtypes of `Struct`s
> as values passed in to the `object` parameter.
>
> Cleans up unused object_store->ffi_struct_class.
>
> Closes: https://github.com/dart-lang/sdk/issues/45071
> Breaking change: https://github.com/dart-lang/sdk/issues/45072
>
> TEST=vm/cc/DartAPI_FinalizableHandleErrors
> TEST=vm/cc/DartAPI_WeakPersistentHandleErrors
> TEST=tests/ffi(_2)/expando_test.dart
>
> Change-Id: I1f11adfa073c7d2c979f3c2bb15c7444c7c767a0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186280
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=lrn@google.com,vegorov@google.com,kustermann@google.com,dacoharkes@google.com

Change-Id: Ib76d27e59391dc6107d3f8e8fba3d67640ea9a5c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195060
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-12 16:30:57 +00:00
Daco Harkes 2376ab5186 [vm/ffi] Disallow Pointers and structs in finalizers and expandos
`Dart_NewWeakPersistentHandle` and `Dart_NewFinalizableHandle` in
`dart_api.h` do no longer accept `Pointer`s and subtypes of `Struct`s
as values passed in to the `object` parameter.

Expandos no longer accept `Pointer`s and subtypes of `Struct`s
as values passed in to the `object` parameter.

Cleans up unused object_store->ffi_struct_class.

Closes: https://github.com/dart-lang/sdk/issues/45071
Breaking change: https://github.com/dart-lang/sdk/issues/45072

TEST=vm/cc/DartAPI_FinalizableHandleErrors
TEST=vm/cc/DartAPI_WeakPersistentHandleErrors
TEST=tests/ffi(_2)/expando_test.dart

Change-Id: I1f11adfa073c7d2c979f3c2bb15c7444c7c767a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186280
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-04-12 14:04:16 +00:00
Nicholas Shahan 4e25e499c8 [ddc] Add library URIs to cast failure messages
When the two types have the same name but are from different libraries
showing the library URI will help users understand the failure better.

Change-Id: I5ab4412e676272111d41f688ef2d1cc83afbe627
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194116
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-04-09 22:24:43 +00:00
Srujan Gaddam bd58cea90b [dart:html] Fix getContext3d nullability
Closes https://github.com/dart-lang/sdk/issues/45572

getContext3d should return a nullable value since getContext can
return a nullable.

Change-Id: Iaefff781976656db3765d526ec95305f2acfeecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194503
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-04-09 19:03:43 +00:00
Daco Harkes 189c36b82a [vm] Native effects
Adds a way to express native effects in Dart expressions in kernel.

This CL adds a `void _nativeEffect(Object)` to `dart:internal`.
The semantics of `_nativeEffect` are to not execute its arguments and
return `null`.

This CL uses this `_nativeEffect` to make sure that we never execute
the struct constructor invocations used to simulate the native behavior
of FFI trampolines.

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

TEST=tests/ffi(_2)/native_effect_test.dart

Change-Id: Ie06de145e49f8b1cae9e148c2d5d97d5cd8e6878
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,dart-sdk-linux-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194421
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-09 16:45:13 +00:00
Ryan Macnak 1d369b5000 [vm, compiler] Support unboxed parameters for integer intrinsics.
TEST=ci
Change-Id: I7f29471043c049ef1acf7cd4bcb0890db6d33aa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192728
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-04-09 00:30:10 +00:00
Lasse R.H. Nielsen 6af4987dc6 Change VM DateTime to-local-time computation to not fail for <1h changes.
The DateTime conversion to local time amounts to solving an
equation, finding an offset where the current local time is that offset.

The current approach doesn't actually do that, it just tries to simulate
the JS approach, with a tweak to avoid DST change issues, but that tweak
assumes that all time zone adjustments are one hour changes.

This CL should work correctly for time zone changes of up to one hour,
but might still fail for changes of more than one hour.
It works by trying more offsets, which obviously has a performance cost,
which depends on how efficient the operation system is at providing
the local time zone for a specific milliseconds-since-epoch.

Change-Id: I80dc6e62e0639d9966d3c5a06430787d8acc4ff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182041
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-04-08 16:51:00 +00:00
Ben Konyi d18d3d837f [ dart:developer ] Add serverWebSocketUri to ServiceProtocolInfo
Adds a convenience getter to ServiceProtocolInfo which transforms the VM
Service HTTP URI into a valid web socket URI that can be used to connect
to the VM service.

Fixes https://github.com/dart-lang/sdk/issues/42968.

TEST=runtime/observatory/tests/service/developer_server_control_test.dart

Change-Id: Ib15de1f1a9b26ac5cf45f55a53014761a6fa7900
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194209
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2021-04-07 20:02:17 +00:00
Mayank Patke c089922d2a Reland "[dart2js] Implement Cell abstraction for late lowering."
This is a reland of b647020318

Original change's description:
> [dart2js] Implement Cell abstraction for late lowering.
>
> Change-Id: Ib5fe8ed8e43513283a4e05f216e068241e8d63da
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193587
> Commit-Queue: Mayank Patke <fishythefish@google.com>
> Reviewed-by: Stephen Adams <sra@google.com>

Change-Id: I75501a556819463dab09842be11790b5f4ef1c7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193890
Reviewed-by: Mayank Patke <fishythefish@google.com>
2021-04-07 19:43:07 +00:00
Lasse Reichstein Holst Nielsen 4b59bf54b2 Fix bug introduced in refactoring.
A constant was renamed to conform to the style guide, and that made it
have the same name as a local variable, and it was shadowed inside that function.

Rename another constant while we're here.

Fixes #45432.

Bug: http://dartbug.com/45432
Change-Id: Ie7e83bb77fea25a93a006bde78431ec35007a82a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192920
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-04-07 11:33:07 +00:00
Daco Harkes d27f166b75 [vm/ffi] Tree shaking of Struct sub classes
This CL enables tree shaking of `Struct` sub classes by simulating the
native behavior in Dart code.

We call the struct constructors in let expressions where FFI trampolines
are created which allocate these struct objects in native code. This way
TFA is instructed about the native behavior. The VM recognizes these
constructor calls as dead code and removes them.

For more info see go/dart-ffi-struct-treeshaking.

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

This CL fixes the types on the generated #fromTypedDataBase constructors.

Also, this CL also cleans up the struct naming:
* _addressOf   -> _typedDataBase
* _fromPointer -> _fromTypedDataBase
* #pointer     -> #typedDataBase

These cleanups are not split into a separate CL to prevent updating
the .expect files multiple times.

Finally, this CL enables running a single transformer test through:
`dart pkg/vm/test/transformations/type_flow/transformer_test.dart name`

TEST=pkg/vm/testcases/transformations/type_flow/transformer/ffi_struct_constructors.dart
TEST=tests/ffi(_2)/function_callbacks_structs_by_value_generated_test.dart
TEST=tests/ffi(_2)/function_structs_by_value_generated_test.dart

Change-Id: I418d0d73bc86b234dfe5b7b04ae726c33d2b8aeb
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,dart-sdk-linux-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193661
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-04-07 11:02:27 +00:00
Jonas Finnemann Jensen 9558ac12bb Migrate InternetAddressType.ANY -> InternetAddressType.any
In documentation comment for `InternetAddress.lookup`.
This should make API docs a little bit prettier.

Change-Id: Ie969756a54e13b2efbef17a1a78fa0ffb8670dec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194063
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2021-04-06 16:12:17 +00:00
Stephen Adams 0087b0538b Revert "[dart2js] Implement Cell abstraction for late lowering."
This reverts commit b647020318.

Reason: test failures.
Change-Id: I1c4987ede89bebfcc5f14273f0bfbaf809507a43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193883
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-04-02 16:59:31 +00:00
Mayank Patke b647020318 [dart2js] Implement Cell abstraction for late lowering.
Change-Id: Ib5fe8ed8e43513283a4e05f216e068241e8d63da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193587
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-04-01 23:57:27 +00:00
Liam Appelbe 6b42491dcf [wasm] Remove deprecated dart_enable_wasm flag.
Change-Id: I37f326a30de20a895159f5b57a772cd808aa53d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193826
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2021-04-01 22:45:07 +00:00
Alexander Aprelev e190a85f49 [io/socket] Handle OSError returned by Socket_GetPort.
Dart code did not expect OSError as a return value from Socket_GetPort.
This CL ensures that Dart code handles OSError in addition to int gracefully as a result of Socket_GetPort call.

Fixes https://github.com/dart-lang/sdk/issues/45116

TEST=run dart ci socket tests on mac with transparent proxy running

Change-Id: I198d99107729ccefecd9a16b71474ccdbfc0039b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193221
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-04-01 18:04:12 +00:00
Alexander Aprelev bddded13aa [io/lookup] Ensure public type InternetAddress is used in lookup methods.
Use of private _InternetAddress class in method declarations results
in errors when user attempts to for example provide timeout handler.

Fixes https://github.com/dart-lang/sdk/issues/45542

Change-Id: Ied83479d7ce6319d0a82985c667ad29ef58cf6de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193720
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-03-31 19:43:42 +00:00
Devon Carew 1ba371139e Address a todo: related to the fix_data.yaml format docs.
Change-Id: I2ce20c975ceaa4f0dc94bf288387426fbb99c611
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193580
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-31 00:47:57 +00:00
Daco Harkes 9dd716a9ea [vm/ffi] Update DynamicLibrary documentation
Improves documentation on `DynamicLibrary`.

Doesn't change `DynamicLibrary.open` from a factory to a static method
yet. Because it's a breaking change, see issue.

Bug: https://github.com/dart-lang/sdk/issues/44849
Closes: https://github.com/dart-lang/sdk/issues/45294

TEST=tests/ffi/vmspecific_dynamic_library_test.dart

Change-Id: Id989e6d4397cb1378ef842bde0f64fc19f3275ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182626
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-03-30 08:34:48 +00:00
Daco Harkes 4ba4fd3f1d [analyzer/ffi] Inline array annotation const dimensions
Moves the Array forwarding constructors and _ArraySize class out of
the patch files so that the analyzer can reason about them.
(The analyzer does not include patch files, because it does not know
whether it's analyzing for VM or JS backend.)

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

Change-Id: Ia0eb4bbca40b906a1e636714f53c5c73dcfc3cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193403
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-03-30 00:28:57 +00:00
Daco Harkes 38d5c5e444 [vm/ffi] Array range error message
Closes: https://github.com/dart-lang/sdk/issues/45189

Change-Id: I225a092fd05efe8a6eed7749375ea4c842547fb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193404
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-03-30 00:12:49 +00:00
Ryan Macnak 6a6e08b784 Reapply "[vm, compiler] Convert binary Smi ops to graph intrinsics."
Explicitly disable unboxed parameters for these functions, previously implicitly disabled by virtue of being ASM intrinsics.

TEST=ci
Change-Id: Ic810bb8400e081c5f99a49b5035031bc9edc4bf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192044
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-03-25 21:54:44 +00:00
Stephen Adams a1db3de44a [dart2js] Accept >>> as a symbol name
Makes language/operator/operator_triple_shift_test pass and
corelib_2/symbol_operator_test/03 fail like all the other configurations.

Change-Id: I06c0fba62dc5407a9787e6216d50acfe8da053c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193080
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-03-25 21:52:14 +00:00
Srujan Gaddam 6929718456 [pkg:js] Handle null value in promise rejection
Closes https://github.com/dart-lang/sdk/issues/44602

Creates an exception to signal a `null`/`undefined` value when a
converted promise is rejected with `null`/`undefined`.

Change-Id: Ic7f14e23c6c1d51d6dbcc5831ffa8491418a4267
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192046
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-03-25 01:30:23 +00:00
Ben Konyi c4bfca9b6a [ dart:io / package:vm_service ] Add HTTP request profiling service
extensions

This change adds HTTP request profiling support to the dart:io service
extensions and removes HTTP request/response body logging to the
timeline due to memory constraints.

Fixes https://github.com/dart-lang/sdk/issues/44950

TEST=pkg/vm_service/test/get_http_profile_test.dart

Change-Id: I85642296c3d6595197f3365022477c7685c452bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189881
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
2021-03-24 23:01:03 +00:00
Nate Bosch 0c258ed081 Fix typo memthod -> method
Fixes https://github.com/dart-lang/language/issues/1545

Change-Id: I8970f29c7e0557143714920d354f2d0d39fad3bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192942
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-03-24 22:54:53 +00:00
Ryan Macnak 5bfb36daa3 [vm, compiler] Use leaf calls for exp and log.
We already do this for the other functions in dart:math.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/45414
Change-Id: Ic1fb1c7cdbbf39eaa4af645219874408988b740b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192522
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-03-22 23:14:25 +00:00
Lasse Reichstein Holst Nielsen 7f2b875b4a Add efficient entries and keys.contains to SplayTreeMap.
Update some other methods to be more performant than the default
inherited from `MapMixin`.
Change argument validation to `map.[]=`, `map.putIfAbsent` and `set.add`
checks that the key/element is allowed by the `compare` function.
Previously the map methods just checked `key != null` (which was wrong),
and compare did nothing special, both just relied on the `splay` call
doing a `compare` call. That was not true for an empty map, which means
that you could add a key/element which wasn't a valid comparable,
as long as you did it as the *first* key/element.
That is now caught.


Bug: https://github.com/dart-lang/sdk/issues/45296
Change-Id: I8ba49a7892ed27daa4434f5fb7be3e777ef32bc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190883
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-03-22 13:20:13 +00:00
Alexander Aprelev f5432d7164 [io/http] Relax http parsing constraints around CRLF.
https://tools.ietf.org/html/rfc2616\#section-19.3 advises to
allow CR*LF wherever CRLF line terminator is expected.

Issue https://github.com/dart-lang/sdk/issues/43916

TEST=http_client_parser_crlf_tolerant_test, http_100_continue_test

Change-Id: I8c6d263bdb950b2f3992b69921eff0ee75704c10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192120
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-03-20 03:11:28 +00:00
Daco Harkes 77dc74bcd5 [vm/ffi] Support packed Structs
Closes: https://github.com/dart-lang/sdk/issues/38158

This CL implements unaligned access for float/double on arm32, but does
not expose it in an API. Rather it only uses these loads/stores inside
the getters and setters of packed structs.
Bug: https://github.com/dart-lang/sdk/issues/45009

Besides unaligned access for float/double, this CL is mostly a CFE
change. The only VM change is reading the packing in the
`_FfiStructLayout` annotation.

The implementation of using the packing in the VM, and analyzer changes
have landed separately in earlier CLs.

tools/test.py ffi ffi_2
TEST=tests/ffi(_2)/(.*)by_value_(*.)_test.dart

Change-Id: Ic3106ecc626d2e30674a49bf03f65ae12d2b3502
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186143
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-03-19 15:34:42 +00:00
Alexander Thomas f38081d1ff [sdk] Add analysis_server.dart.snapshot to ARM SDKs.
Fixes https://github.com/dart-lang/sdk/issues/41845.

Change-Id: Ib1558472dfef0d4c815e5ba870d087fdf18f6862
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191922
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-03-19 12:03:48 +00:00
Ryan Macnak c5eaf317b6 Revert "[vm, compiler] Convert binary Smi ops to graph intrinsics."
This reverts commit 051ec30ff0.

Reason for revert: Failures on ARM32 AOT

Original change's description:
> [vm, compiler] Convert binary Smi ops to graph intrinsics.
>
> Keep left shift as an ASM intrinsic because it includes fallbacks to Mint operations on 32-bit architectures that graph intrinsics aren't good at expressing.
>
> This should be close to neutral on performance, but removes a fair amount of redundant code.
>
> TEST=ci
> Change-Id: Ic9c7d3b2d015ebf31972163a58c6bc9a27bad4ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187164
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com

Change-Id: I2a08df5b4aa0269a6237a3d967729c155c88a1c7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192061
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-03-18 22:11:56 +00:00
Ryan Macnak 051ec30ff0 [vm, compiler] Convert binary Smi ops to graph intrinsics.
Keep left shift as an ASM intrinsic because it includes fallbacks to Mint operations on 32-bit architectures that graph intrinsics aren't good at expressing.

This should be close to neutral on performance, but removes a fair amount of redundant code.

TEST=ci
Change-Id: Ic9c7d3b2d015ebf31972163a58c6bc9a27bad4ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187164
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-03-18 20:33:34 +00:00
Kevin Moore 4616f47c4d dart: library spelling fixes
Change-Id: I3974094d611df8401941eba35ff0071b48d9e44f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191981
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kathy Walrath <kathyw@google.com>
2021-03-18 19:11:33 +00:00
Daco Harkes 55082199e7 [vm/ffi] Fix Array<Pointer> loads and stores
Closes: https://github.com/dart-lang/sdk/issues/45198

TEST=tests/ffi(_2)/regress_45198_test.dart

Change-Id: I15cf5a4d48b1bfb33de039cc8b17be8e01fba752
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191881
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-03-18 12:26:38 +00:00
Kevin Moore d59e280a62 Fix spelling mistakes in core classes
Uri, StringBuffer, int, RangeError

Change-Id: I6d22d4707aed3a871af78c584ae3a06894d8b632
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191804
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-03-18 10:19:48 +00:00
Martin Kustermann 1055db533c [vm/compiler] Add infer range to Utf8ScanInstr
This tells the compiler that boxing the result of Utf8ScanInstr will
always fit in a Smi and the boxing instruction can therefore never go to
runtime (and e.g. cause a lazy-deopt).

Noticed as part of https://github.com/dart-lang/sdk/issues/45213

TEST=Existing test suite.

Change-Id: I30712ec50378c7e0f70e1a5d95a2390b4f5d8ebc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190481
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-03-17 11:17:41 +00:00
Lasse R.H. Nielsen b250a58d8e Implement int.>>> for DDC.
BUG= https://github.com/dart-lang/sdk/issues/44915

Change-Id: Ia63d1653729ff458f9ebb2a2e33883a00a66378f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191220
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-03-16 09:37:15 +00:00
Alexander Markov 16beb34813 [vm/aot] Remove special cases of dynamic function lookups from precompiler
Flutter gallery AOT snapshot size
release: no change;
release-sizeopt: arm -0.24%, arm64 -0.25%.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/44852
Change-Id: I847bfc311552bb4e80222e0040b50b4766a18dbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190783
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-03-15 17:53:23 +00:00
Parker Lougheed 39550008d6 Tag all code blocks which were missing language tags.
A warning to catch these situations was added in https://github.com/dart-lang/dartdoc/pull/2559 so this adds tags to the code blocks in the SDK which were missing them as caught by the new warning.

Change-Id: Iaadbb6e1b811ecac3b95a6c6f64cb689d2eb2d26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190200
Reviewed-by: Janice Collins <jcollins@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
2021-03-10 18:09:53 +00:00
Ryan Knell 48c23c50d4 Update process.dart
Example was broken, silly typo.

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

GitOrigin-RevId: cd1abd5a307e38093467371db8f59dbb60b71fb7
Change-Id: Ie18e9665c8df4611637ee3632fcc25861971d7b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189940
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2021-03-09 12:13:10 +00:00
Daco Harkes ffa5d16ae7 [vm/ffi] Support multi-dimensional inline arrays
This CL only changes dart:ffi API, CFE, and analyzer. No VM changes
were needed because the dimensions of inline arrays can be flattened
before passing them to the VM. The multi-dimensionality does not
impact the ABI.

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

TEST=pkg/analyzer/test/src/diagnostics/size_annotation_dimensions_test.dart
TEST=pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart
TEST=tests/ffi/function_structs_by_value_generated_test.dart
TEST=tests/ffi/inline_array_multi_dimensional_test.dart

Change-Id: Ica2c01fccbea7e513879365b34086d8968b54c5b
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188286
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-03-09 10:50:17 +00:00
Stephen Adams 39aa454e7b [dart2js] Implement int.>>> optimizations
Change-Id: I7d54bc523bb81c5ae8d6fed4ec2e6df473206788
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187340
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2021-03-09 02:20:06 +00:00
Lasse R.H. Nielsen b6001547ff Make NoSuchMethodError.withInvocation a factory constructor.
This will allow implementations to use a different implementation class
when the deprecated unnamed constructor is removed.

Change-Id: I553a733e3947c8cbc316b0a427919892f281445d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/55464
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2021-03-05 09:46:37 +00:00
Ryan Macnak 9451963493 [vm, compiler] Remove intrinsics from internal double-dispatching int methods.
If the intrinsic on int.op fails, then the intrinsic on _opFromInteger will also fail, since both handle the same range of values.

Add intrinsic on int.% as previously only _moduloFromInteger was intrinsified. All the other ops already intrinsified the public method.

Remove _bitAndFromSmi; this was once useful for handling BigInt & Smi, but this case no longer exists.

TEST=ci
Change-Id: Ie33b75126e56110db3caabb9bcb6e9198a3158bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187160
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-03-01 19:29:00 +00:00
Daco Harkes b21430a384 Reland "[vm/ffi] Remove deprecated Struct.addressOf getter"
This got deprecated in Dart 2.12 stable. Removing for the next release.

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

This reverts commit 1d1f68fd6d.

Change-Id: I1df84f2225ea68c2d8ccb7d3e6359050e8802f62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188291
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-03-01 19:20:30 +00:00
Lasse R.H. Nielsen eb6b474d7a Fix null-safety issue in VM's typed-data + operators.
Fixes #45140.

Bug: http://dartbug.com/45140
Change-Id: I95f45c64d86428ddb67d176cdd2d50cfdbadfe8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188283
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-03-01 13:56:19 +00:00
Daco Harkes 0295dfc74e [vm] Support redirecting external const factories
This CL introduces the first combination of `external const factory`
with `@patch const factory (.*) = (.*)`. This specific combination was
never used in the core libraries, and did not work.

Half of the fix is a missing flag from the CFE:
https://dart-review.googlesource.com/c/sdk/+/187440

The other half of the fix is matching on the
kRedirectingFactoryConstructor tag, and allowing constructor names
in procedure targets (even though we never compile those expressions
because they are invalid).

Bug: https://github.com/dart-lang/sdk/issues/45101

TEST=Using redirecting const factory in patch file in core lib.
TEST=tests/ffi(_2)/*

Change-Id: I5524bde928290bf32aaea9170eda1f2d03127fa6
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try,front-end-linux-release-x64-try,vm-kernel-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187003
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-02-26 11:15:26 +00:00
Daco Harkes d45fd0f9d5 [vm/ffi] Support inline arrays in Structs
Adds support for single dimension inline arrays in structs. Multi-
dimensional arrays will be supported in a future CL.

This CL adds:
- CFE static error checks for inline arrays.
- CFE transformations for inline arrays.
- VM consumption of inline array fields for NativeType.
- Test generator support for inline arrays + generated tests.

Previous CLs added support for inline arrays in:
- analyzer https://dart-review.googlesource.com/c/sdk/+/183684
  - updated in this CL to new API.
- ABI calculation https://dart-review.googlesource.com/c/sdk/+/183682

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

Open issue: https://github.com/dart-lang/sdk/issues/45101

CFE transformations are tested with expectation files:
TEST=pkg/front_end/testcases/(.*)/ffi_struct_inline_array.dart

Trampolines and CArray API are tested with end-to-end Dart tests:
TEST=tests/ffi(_2)/(.*)by_value(.*)test.dart
TEST=tests/ffi(_2)/inline_array_test.dart

Compile-time errors (both CFE and analyzer) are tested in:
TEST=tests/ffi(_2)/vmspecific_static_checks_test.dart

Change-Id: I014c0e4153f1b885638adce80de6ab3cac8e6bb2
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183640
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-02-24 13:02:45 +00:00
Alexander Aprelev ea3dfc9ac4 [vm/io] Fix an exception when attempting to immediately cancel socket connection.
Fixes dartbug.com/45047

Change-Id: Ie4630684722e8c17cbc3766f91111b2a76bce7c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186641
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-02-24 00:32:07 +00:00
Alexander Markov 7f8001218b [vm] Support unsigned shift operator int.>>>
TEST=runtime/tests/vm/dart/unsigned_shift_right_test.dart and other
tests for >>>.

Issue https://github.com/dart-lang/sdk/issues/30892
Issue https://github.com/dart-lang/sdk/issues/44914

Change-Id: I7f0a9e1e486be06576c5d9bff3659b0aa6d68c23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184921
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2021-02-24 00:14:57 +00:00
Alexander Markov 9d4ad8a14b [core lib] Add unimplemented int.operator >>>
This change adds a placeholder for int.operator >>>.
No implementation is added yet.

This change unblocks implementation of this operator in
the backends (VM, dart2js, DDC).

Issue: https://github.com/dart-lang/sdk/issues/44912
Issue: https://github.com/dart-lang/sdk/issues/30892
Change-Id: I9912ca9f44d594e9c5fa91f5fc65e807fe48cc7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185480
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2021-02-22 00:02:47 +00:00
jonahwilliams 91ae755c35 add network_policy to io gni
This source file is missing from the gni that flutter engine uses to
construct the analyzer summary. Assuming it wasn't left out intentionally.

Bug: https://github.com/flutter/flutter/issues/76228
Change-Id: I9758ed5839d5b3898064d0372798ecfaa70f9042
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185489
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2021-02-18 22:26:49 +00:00
Zach Anderson 1d1f68fd6d Revert "[vm/ffi] Remove deprecated Struct.addressOf getter"
This reverts commit 65fab2397b.

Reason for revert: These can't be remove until the next dev roll of Flutter. See https://github.com/flutter/flutter/issues/76129.

Original change's description:
> [vm/ffi] Remove deprecated `Struct.addressOf` getter
>
> This got deprecated in Dart 2.12 stable. Removing for the next release.
>
> Closes: https://github.com/dart-lang/sdk/issues/40667
>
> Change-Id: Ifdbcf76178be6fca8603d478d629b6b6655b7123
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184463
> Reviewed-by: Clement Skau <cskau@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

Change-Id: I94c22a206f3668ddb72d284afdc3b048d8b11aaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185500
Commit-Queue: Zach Anderson <zra@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-02-17 21:47:42 +00:00
Lasse Reichstein Holst Nielsen 5bcb19125c Add documentation saying that String.fromEnvironment etc. must behave consistently.
AAll calls to those constructors must behave as if there is a single consistent
environment backing them.
This will force compilers to reject programs where that wouldn't be the case,
which is possible if doing modular compilation with different settings.

If a library doesn't check the environment, it doesn't matter whether the
environment was declared differently, the requirement is only that when actually checking,
the values must be consistent.

Bug: https://github.com/dart-lang/language/issues/304
Change-Id: Ie52ecc3ea49ed87297fab92e5e7bb6d9f96a495d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184467
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-02-17 12:52:03 +00:00
Daco Harkes 3593de9179 [vm/ffi] Change Pointer.elementAt and sizeOf to use static type
This CL changes the semantics of
`Pointer<T extends NativeType>.elementAt` and
`sizeOf<T extends NativeType>` to use the compile-time `T` rather than
the runtime `T`.

Issue: https://github.com/dart-lang/sdk/issues/38721

TEST=tests/ffi/data_test.dart
TEST=tests/ffi/sizeof_test.dart
TEST=tests/ffi/structs_test.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: Ifb25a4bd66d50a385d3db6dec9213b96dff21722
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,analyzer-nnbd-linux-release-try,front-end-linux-release-x64-try,front-end-nnbd-linux-release-x64-try,benchmark-linux-try,dart-sdk-linux-try,pkg-linux-release-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178200
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-02-17 11:39:42 +00:00
ffabss c0d688e139 [docs] Fixed a typo in bigint.dart operator | documentation
Closes https://github.com/dart-lang/sdk/pull/45010
https://github.com/dart-lang/sdk/pull/45010

GitOrigin-RevId: b27d0bd0bf25a08909502e37fc86abd00bef82b9
Change-Id: Icf84e3b1ba13002d6dff992f42be55f1a808a536
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185040
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-02-17 09:15:19 +00:00
Lasse R.H. Nielsen d352bc28b8 Remove (most) uses of the "non-nullable" experiment flag.
Since the flag is now enabled by default, there should be no mention of it.
There are still some uses in front_end/testcases that are not just removable
(it also uses `no-non-nullable`). There migth be more uses that are not
as easily found as grepping for `--enable-experiment

Removes two VM tests where fixing them meant they were just duplicating
the corresponding non *_2/ tests.
Fixes #44941

TEST= Large number of tests chaged.=(no-)?non-nullable`.

Change-Id: Ief755981ccde9a5482fcdf408c2929c74433a710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183688
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-12 17:16:54 +00:00
Lasse R.H. Nielsen 0b70cec33d Update dart:async library documentation.
It's a little too pompous about being essential.
(Also, never call `listen` if you don't want the subscription).

Change-Id: I15b3193abaafa31223f889d864d32a225b3b43ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183681
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-12 13:48:13 +00:00
Daco Harkes 65fab2397b [vm/ffi] Remove deprecated Struct.addressOf getter
This got deprecated in Dart 2.12 stable. Removing for the next release.

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

Change-Id: Ifdbcf76178be6fca8603d478d629b6b6655b7123
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184463
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-02-12 09:16:02 +00:00
Daco Harkes fca959e5f6 [vm/ffi] Add class to vm:ffi:struct-fields pragma
This CL changes `@pragma('vm:ffi:struct-fields', [...])` to
`@pragma('vm:ffi:struct-fields', _FfiStructLayout([...]))` which makes
it easier to add more data in subsequent CLs.

Extends `FindPragma` to allow returning multiple matched pragma's, so
that we can filter them. (In this case to avoid matching user-defined
pragma's that do not have an instance of the private class.)

Separated out from https://dart-review.googlesource.com/c/sdk/+/183640
because of the extra constant in existing expectation files.

Bug: https://github.com/dart-lang/sdk/issues/35763
Bug: https://github.com/dart-lang/sdk/issues/38158

TEST=tests/ffi(_2)/*_by_value_*_test.dart

Change-Id: Idef9f82e9b53c2a32dffabcec19669eae550fe2f
Cq-Include-Trybots: luci.dart.try:front-end-nnbd-mac-release-x64-try,front-end-linux-release-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184181
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-02-11 18:09:05 +00:00
Lasse R.H. Nielsen 9cbed61204 Fix type bug in dart:io HTTP client code.
This would have been caught if the static type had not
been made `Future<dynamic>`.

Fixes #44895

BUG= http://dartbug.com/44895
TEST= standalone/io/regress_44895

Change-Id: I237c552fdb42943b395352a7232b34ab5488ac6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184261
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-02-10 18:00:11 +00:00
Clement Skau 622d54c209 [VM] Adds fast case for custom zone callback.
This expands the fast case in `_asyncThenWrapperHelper` and
`_asyncErrorWrapperHelper` to any zone that uses the root zone
`registerUnaryCallback` (which does nothing).

Informal micro-benchmarking shows a runtime decrease of about
3-5% for custom zones that fall back on the root zone
`register{,Unary,Binary}Callback`.

TEST=Tested all cases.

Bug: https://github.com/dart-lang/sdk/issues/40752
Change-Id: I76c944189cc355eb404163a50914ed0e7711446c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182623
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-02-10 06:44:18 +00:00
Sergey G. Grekhov 46b46c2931 [vm/ffi] Fixed typo in Struct documentation
Change-Id: I9823b09b614145b8d1a0691e45ffd1ec15c19e57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183696
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-02-09 18:49:42 +00:00
Stephen Adams cb06d6c86a [dart2js] Rename JSDouble to JSNumNotInt
JSDouble was really "double *excluding integral values*".
This was confusing, with JSDouble sometimes used assuming it was all doubles.
Rename JSDouble to JSNumNotInt to avoid future errors like #44818

Change-Id: I96bf33d5531b94aaf33b582e584702f47ed50395
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183201
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-02-09 17:51:07 +00:00
Daco Harkes aa2a6f8581 [vm/ffi] Change type of typedDataBase parameter for load and store
So that it can be invoked from `CArray` which has a backing store
that is either TypedData or Pointer.

Bug: https://github.com/dart-lang/sdk/issues/35763

TEST=tests/ffi(_2)/*

Change-Id: I30bb0c1e848f2ac4f47919009106d5428ed66453
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183683
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-02-09 13:01:49 +00:00
Lasse R.H. Nielsen 222b894d62 Change resolve for package:URIs to not remove package name.
A "package URI" is defined as one with a `package` scheme,
no authority, a first path segment terminated by `/` which
contains no escapes and is not all `.` characters.
This is the definition of package names accepted by .packages
as well: Valid path characters and not all dots.

Change-Id: I9a161d47732e8bf873d278774315c72a4a928823
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117542
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-05 18:31:48 +00:00
Sigmund Cherem 912005267d [web] rename suite dart2js -> web.
Change-Id: I46be49b2effec3e38a3dc44cd45cfe736f77fa78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182680
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-02-04 23:11:32 +00:00
Daco Harkes d052156ea4 [vm/ffi] Remove .ref VM runtime entry
After https://dart-review.googlesource.com/c/sdk/+/180190 the runtime
entry has become dead code.

This CL keeps the runtime entry itself but makes it unreachable as was
the suggestion on previous a CL removing runtime entries:
https://dart-review.googlesource.com/c/sdk/+/169406

Bug: https://github.com/dart-lang/sdk/issues/38648
Bug: https://github.com/dart-lang/sdk/issues/38721

TEST=tests/ffi/vmspecific_static_checks_test.dart
TEST=tests/ffi/*struct*test_.dart

Change-Id: I84c5c925215b9dbd999826fb390df91d8050e1dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182627
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-02-04 21:31:29 +00:00
Lasse R.H. Nielsen 98d5ecb553 Add back accidentally removed pragma on scheduleMicrotask.
Was removed in a failed merge.

Change-Id: Ie8bd18f434786dbb7a3bc619d0b49565198c8c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182782
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2021-02-04 19:28:37 +00:00
Alexander Thomas c88171c8af [sdk] Bump version to 2.13
TEST=Presubmit tests and local builds
Change-Id: I1b15d60eced0cf3f422548eda75706609f6640cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182624
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-04 12:10:17 +00:00
Devon Carew b7e9413d14 Several doc fixes for dart:io.
Change-Id: I0b7577faf49bc2e80e82ef77b2677478503fe6c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182180
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-02-03 18:43:22 +00:00
Alexander Aprelev 0f3e6553c4 [vm/service] Keep track and close RawReceivePorts opened for isolate's response if isolate exits.
It could happen that recipient isolate exits before having a chance to respond to a posted request/message. If that happens RawReceivePort remains open preventing an application from exiting.

Fixes b/168809314.

Change-Id: I760f83d4d3a65da75a32cc88684dca74b43c942b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182480
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-02-03 18:07:42 +00:00
Daco Harkes fb624c4209 Reland "[vm/ffi] Change Pointer<T extends Struct>.ref to use static type"
This CL changes the semantics of `Pointer<T extends Struct>.ref` to use
the compile-time `T` rather than the runtime `T`.

This enables tree shaking of subtypes of Struct and optimizing `.ref`.

Bug: https://github.com/dart-lang/sdk/issues/38721

TEST=tests/ffi/vmspecific_static_checks_test.dart
TEST=tests/ffi/*struct*test_.dart

Change-Id: Ie19bc3259d1cb721d0ce56d68e82d09dc3a4ad0e
Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,dart-sdk-linux-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180190
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-02-03 10:55:49 +00:00
Daco Harkes 7cb49e2fb0 [vm/ffi] Rewrite Allocator.call calls in CFE
This rewrites `Allocator.call` calls in the CFE to skip the runtime
entry for `sizeOf` when the type argument is constant.

The runtime entry is still used when the type argument is generic.
Forcing the type argument to be constant and removing the runtime entry
will be done in follow up CLs.

Bug: https://github.com/dart-lang/sdk/issues/44621
Bug: https://github.com/dart-lang/sdk/issues/38721

TEST=test/ffi (almost all of them)

Change-Id: I5e855fa2b63a5c1b7fa70dbaa1b89c122a82da6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182264
Reviewed-by: Clement Skau <cskau@google.com>
2021-02-02 16:33:54 +00:00
Clement Skau dfd5413952 [VM] Adds Debugger break for Future.catchError
TEST=Added new Future.catchError pause-on-unhandled-exceptions test.

Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: Ieb3cf834eacad4f9b98ab2db0e5813e9bfa09747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180840
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-02-02 06:59:54 +00:00
Devon Carew f93a844060 [sdk docs] validate the sdk docs per commit
Change-Id: I0521297a1da229b190eb7ec6c7615da445ed5685
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181000
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-02-01 19:39:49 +00:00
pq 2ecc9b76c8 initial sdk API fix data
Some simple SDK API changes codified in fix data w/ accompanying tests.

Tests are in `tests/lib/fix_data` and run on the pkg bots.

Sample run:

https://ci.chromium.org/ui/p/dart/builders/try/pkg-linux-release-try/46526/steps?succeeded=true&debug=false
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8856735093298466576/+/steps/validate_SDK_API_data-driven_fixes/0/stdout


Change-Id: Id0959d6cde4003f114056c21b9969f2792f21a6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180940
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-02-01 18:47:59 +00:00
Alexander Thomas 48b9d645c0 [sdk] Mark List.empty as @Since("2.9")
2.9.0 is the first release that included List.empty:
https://api.dart.dev/stable/2.8.4/dart-core/List/List.empty.html (404)
https://api.dart.dev/stable/2.9.0/dart-core/List/List.empty.html (200)

Change-Id: Iddccfd9a38032da6353667fb032fcfcca26c2664
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181803
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-01-29 16:30:16 +00:00
Lasse R.H. Nielsen bb5b0ff0ce Fix typed data views throwing.
Fixes #43204

BUG= http://dartbug.com/43204

Change-Id: I93ee6931900b79ac6755431c90d2b203ccf94ff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181401
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-29 09:24:45 +00:00
Lasse R.H. Nielsen 4a484c88e1 Make ListMixin.take check that the argument is not null.
Fixes #41743, #30155
BUG= http://dartbug.com/41743

Change-Id: I223905a92b7353cdc50498d265a6dfe2f2f614d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160640
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-28 17:19:35 +00:00
Ryan Macnak a2a9bbbb0c [vm] Rename dart:_internal's is64Bit to has63BitSmis.
Uses of this property care about the range of Smis rather than the range of machine words.

TEST=ci
Change-Id: Ia2c4324590d3aab27d97da4ee40b0e701731e7e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181080
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-26 20:14:14 +00:00
Clement Skau c3ec3e53a1 [VM] Adds Future.then stack unwind. (3)
TEST=ASAN; Various 'causal' tests updated below.

Issues addressed in this revision:
- https://github.com/dart-lang/sdk/issues/44708 ASAN
- https://github.com/dart-lang/sdk/issues/44700 SegFault

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-asan-linux-release-x64-try,analyzer-linux-release-try,analyzer-analysis-server-linux-try,analyzer-nnbd-linux-release-try
Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
Change-Id: I8b8f6ee2e5d4ca2e6bea988ec1cd9f912ddf8240
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180186
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-26 14:02:39 +00:00
Parker Lougheed 3223072f09 Remove mention of dart2js from mirrors library documentation
Change-Id: I6abb182c19f903cdc8121f2a23eecae4330aea18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180320
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-01-25 10:08:23 +00:00
Alexander Aprelev ee37fff58c [io/http] Have http parser reply with error if Content-Length and Transfer-Encoding are both specified on http request.
Issue b/150476984

Change-Id: Iafc7154c84682678e4d7e3d614b74942b0d259b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180485
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-01-22 18:32:43 +00:00
Daco Harkes 90f3de0421 [vm/ffi] Mark dart:ffi as stable
Closes: https://github.com/dart-lang/sdk/issues/34452

We will still actively adding new features to `dart:ffi`. Please refer
to https://github.com/dart-lang/sdk/labels/library-ffi for open issues
and feature requests.

Related documentation PRs:
- https://github.com/dart-lang/site-www/pull/2873
- https://github.com/flutter/website/pull/5195

Change-Id: I59a23e462c859da5dcd2e5548fb6fe295c5d8532
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179765
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
2021-01-22 13:58:09 +00:00
Daco Harkes d74b2f4672 [vm/ffi] Deprecate Pointer.elementAt and sizeOf generic calls
The analyzer and CFE now report a warning on calls to
`Pointer<T extends NativeType>.elementAt()` and
`sizeOf<T extends NativeType>()` where `T` is a generic.

Adapted from https://dart-review.googlesource.com/c/sdk/+/178200 to
only deprecate but not error out on generic calls.

Does not roll forward `package:ffi` to a version with the `Allocator`
but keeps the generic `sizeOf` invocation. This causes extra warnings
in the pkg/front_end testcases.

Issue: https://github.com/dart-lang/sdk/issues/38721

TEST=tests/ffi/data_test.dart
TEST=tests/ffi/sizeof_test.dart
TEST=tests/ffi/structs_test.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: I8f41c4dc04fc44e7e6c540ba87a3f41604130fe9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180560
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-22 13:58:09 +00:00
Daco Harkes f74c9d43d3 [vm/ffi] Deprecate Pointer<T extends Struct>.ref generic calls
The analyzer and CFE now report a warning on calls to
`Pointer<T extends Struct>.ref` and `Pointer<T extends Struct>.[]`
where `T` is a generic.

Adapted from https://dart-review.googlesource.com/c/sdk/+/180190 to
only deprecate but not error out on generic calls to `.ref` and `[]`.

Issue: https://github.com/dart-lang/sdk/issues/38721

TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: I81353089d59f093730d63792e9dbcd0b2ff0c432
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180365
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-22 13:58:09 +00:00
Lasse R.H. Nielsen a7f2da3898 Update documentation of dart:io.
Change-Id: Ibbc692545af636e33cfa7f5946480d3640d95b5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178985
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-22 13:37:39 +00:00
Nicholas Shahan c3e56519fc [ddc] Add getGenericClassStatic runtime helper
Used in the SDK runtime library like the getGenericClass helper but this
is intended to be used when we statically know the type of the class to
be retrieved. Helps avoid breaks caused by an upcoming CFE change that
turns type literals into constants.

Change-Id: I262dd2dae347170050d2fe5cd2722ab132951036
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180265
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-01-22 02:24:17 +00:00
Lasse R.H. Nielsen 726904ac17 Add onError extension method to Future.
Provides better typing than `catchError`.

Change-Id: If0d4487b7c3a499160fb719740a1d65c0545024d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151512
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-21 23:13:56 +00:00
Daco Harkes 49ec189fb3 Revert "[vm/ffi] Change Pointer<T extends Struct>.ref to use s..."
Revert submission 177862

Reason for revert: breaks g3 without https://github.com/flutter/engine/pull/23808
Reverted Changes:
I50b3b4c31:[vm/ffi] Roll `package:ffi` to `Allocator` and `Op...
I3f5b08c08:[vm/ffi] Change `Pointer<T extends Struct>.ref` to...
I6141c193b:[vm/ffi] Disallow empty structs

Change-Id: I1bfe4d70a5f7f35039b8a01d599d33542872574c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180183
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-01-20 21:37:11 +00:00
Daco Harkes 2e8f9b85a6 [vm/ffi] Change Pointer<T extends Struct>.ref to use static type
This CL changes the semantics of `Pointer<T extends Struct>.ref` to use
the compile-time `T` rather than the runtime `T`.

This enables tree shaking of subtypes of Struct and optimizing `.ref`.

Issue: https://github.com/dart-lang/sdk/issues/38721

TEST=tests/ffi/vmspecific_static_checks_test.dart
TEST=tests/ffi/*struct*test_.dart

Change-Id: I3f5b08c08ec0799ef8aab3c4177e2ac70d25501c
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,analyzer-nnbd-linux-release-try,front-end-linux-release-x64-try,front-end-nnbd-linux-release-x64-try,benchmark-linux-try,dart-sdk-linux-try,pkg-linux-release-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177862
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-01-20 18:08:25 +00:00
Sigmund Cherem 54837aa59c [infra] refactor list of snapshots in sdk/BUILD.gn
This is to make it clearer that the full_sdk_snapshots are a superset of the
platform_sdk_snapshots.

Change-Id: Ib853c098d84bdc357a717d8338176faa4a35398d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179860
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-01-20 17:06:25 +00:00
Lasse R.H. Nielsen 186049d2b0 Avoid recursion in secure socket _tryFilter method.
Change-Id: If91859b008c76ed1dd4b86c06a563418757bc109
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180180
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-01-20 15:20:15 +00:00
David Morgan 88c1be7e3b Revert "Reland "[VM] Adds Future.then and Future.catchError stack unwinding.""
This reverts commit 9978a246c1.

Reason for revert: VM crashes in google3, b/177506826

Original change's description:
> Reland "[VM] Adds Future.then and Future.catchError stack unwinding."
>
> This reverts commit 978b838461.
>
> Reason for revert: Fix: https://dart-review.googlesource.com/c/sdk/+/179762
>
> TEST=Various 'causal' tests updated below.
>
> Original change's description:
> > Revert "[VM] Adds Future.then and Future.catchError stack unwinding."
> >
> > This reverts commit 8f2c47f24b.
> >
> > Reason for revert: We suspect this is causing VM crashes: http://b/177506826
> >
> > Original change's description:
> > > [VM] Adds Future.then and Future.catchError stack unwinding.
> > >
> > > TEST=Various 'causal' tests updated below.
> > >
> > > Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
> > > Change-Id: I1420d6163ac2e3b22e0971f7b0ad516895dded70
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176662
> > > Commit-Queue: Clement Skau <cskau@google.com>
> > > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> >
> > TBR=vegorov@google.com,cskau@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: https://github.com/dart-lang/sdk/issues/40815
> > Bug: https://github.com/dart-lang/sdk/issues/37953
> > Change-Id: I870f0202f43588f71a5d2b0f82338978b5a5dda9
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178998
> > Reviewed-by: Michal Terepeta <michalt@google.com>
> > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> > Commit-Queue: Michal Terepeta <michalt@google.com>
>
> TBR=vegorov@google.com,cskau@google.com,michalt@google.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: https://github.com/dart-lang/sdk/issues/40815
> Bug: https://github.com/dart-lang/sdk/issues/37953
> Change-Id: I8a1eb6679b01571b850499cac2dadc5bf9ef2dcd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179763
> Reviewed-by: Clement Skau <cskau@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Clement Skau <cskau@google.com>

TBR=vegorov@google.com,cskau@google.com,michalt@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/40815
Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: I1274bcb375bf6f9cb0609d372b0b451d51eb99c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180147
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2021-01-20 12:44:55 +00:00
Johnni Winther 07a6f9511d Revert "Makes _propagateToListeners not recurse unboundedly."
This reverts commit 073f792b59.

Reason for revert: Some g3 test failures, needs more investigation to figure out how to land. b/177972603

TEST=revert

Original change's description:
> Makes `_propagateToListeners` not recurse unboundedly.
>
> Change-Id: I85818282276e8a5ab4a639e98c238c2a822cab9e
> TEST=Added regression test.
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179770
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

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

Change-Id: If3b6a2ee5511a13fa2de19e70a3c52321007b1ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180142
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
2021-01-20 09:27:47 +00:00
Lasse R.H. Nielsen 073f792b59 Makes _propagateToListeners not recurse unboundedly.
Change-Id: I85818282276e8a5ab4a639e98c238c2a822cab9e
TEST=Added regression test.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179770
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-19 16:47:32 +00:00
Clement Skau 9978a246c1 Reland "[VM] Adds Future.then and Future.catchError stack unwinding."
This reverts commit 978b838461.

Reason for revert: Fix: https://dart-review.googlesource.com/c/sdk/+/179762

TEST=Various 'causal' tests updated below.

Original change's description:
> Revert "[VM] Adds Future.then and Future.catchError stack unwinding."
>
> This reverts commit 8f2c47f24b.
>
> Reason for revert: We suspect this is causing VM crashes: http://b/177506826
>
> Original change's description:
> > [VM] Adds Future.then and Future.catchError stack unwinding.
> >
> > TEST=Various 'causal' tests updated below.
> >
> > Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
> > Change-Id: I1420d6163ac2e3b22e0971f7b0ad516895dded70
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176662
> > Commit-Queue: Clement Skau <cskau@google.com>
> > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
>
> TBR=vegorov@google.com,cskau@google.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: https://github.com/dart-lang/sdk/issues/40815
> Bug: https://github.com/dart-lang/sdk/issues/37953
> Change-Id: I870f0202f43588f71a5d2b0f82338978b5a5dda9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178998
> Reviewed-by: Michal Terepeta <michalt@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Michal Terepeta <michalt@google.com>

TBR=vegorov@google.com,cskau@google.com,michalt@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/40815
Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: I8a1eb6679b01571b850499cac2dadc5bf9ef2dcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179763
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-01-18 12:15:49 +00:00
Lasse Reichstein Holst Nielsen 4563164eec Remove mentions of NullThrownError from documentation.
You can no longer pass `null` to, e.g., `StreamController.addError`,
so we shouldn't document what happens if you do.
In general, in sound null safe code, you cannot even attempt to throw `null`,
so the `NullThrownError` should go away when non-null-safe code stops being
supported.

Change-Id: I3dc7f5ac934b2af48095770767359e8720c3909a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179501
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-01-18 11:46:59 +00:00
jonahwilliams d4d3e3698c [dart:io] ensure Process.start throws with a stack trace
Change-Id: I8b5d585b10752a873632b3a7b9447214e2d38954
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179640
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2021-01-16 01:36:02 +00:00
Sigmund Cherem 9837afa509 [web] partial migration of native tests to support dartdevc
Most files are changed in two ways:

* add `self.` so that the code can run with "use strict" (which ddc
does by default when generating code)

* call the js-helper that installs the interceptor/type-extensions in
DDC on each test.

This was mostly done mechanically and gets about 50% of the tests under
dart2js/native running and passing in dartdevc.  There are, however,
many tests here that are dart2js-specific or for features we don't want
to prioritize at this time (like custom elements), so after this the
next step should probably be to reoarganize the tests and split them in
general native support vs dart2js-specific.

Change-Id: I37759d854f9f51c185789471454d37b6bc78af90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177821
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2021-01-15 02:16:42 +00:00
Sigmund Cherem 90e6fd4734 [web] Support for running native tests in dartdevc.
This consists of a few combined changes:
* support `@Native` on tests: This entails calling registerExtensions
  on user code, but only when running on native tests (which are explicitly
  added to an allow list).

* support for invoking external top-level methods also on native tests.

* support for running `applyExtension` later in tests. This is because
  tests introduce the JavaScript definitions after the calls to
  registerExtensions happen. Note: this wouldn't be necessary if we one
  day change how tests are loaded (e.g. if we can load the JavaScript
  portion of the test before the module compiled by dartdevc is loaded).
  That would entail more infrastructure work and given that this is only
  used for ~200 tests, it doesn't seem worthwhile at this time.

* ensure extension symbols are also stored in `dartx.*` from a native
  test. This is to ensure dynamic calls are fully supported.

* changes to the dart2js runtime to ensure the test code can run in both
  dartdevc and dart2js with the same API.

* one updated test: all native tests need to be updated and I'll follow
  up with those, but the changes on this test are included in this CL to
  illustrate how this all fits together.

After this change (and parent changes), you can now run:

  ./tools/test.py -m release -c dartdevk -r d8 dart2js/native/native_checked_arguments1_frog_test

Change-Id: I4c2615a80b0e7611aa6f57abaa55b4e03b42bfe4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177180
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2021-01-15 02:16:42 +00:00
Lasse R.H. Nielsen b837038cf9 Update dart:async documentation and fix null-safety mistakes in the documentation.
Large update to `Zone` which sorely needed it.

Change-Id: I5d398e4c401ea8b17c7706e7e01ae2e22137ce77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178620
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-14 16:40:53 +00:00
Michal Terepeta 978b838461 Revert "[VM] Adds Future.then and Future.catchError stack unwinding."
This reverts commit 8f2c47f24b.

Reason for revert: We suspect this is causing VM crashes: http://b/177506826

Original change's description:
> [VM] Adds Future.then and Future.catchError stack unwinding.
>
> TEST=Various 'causal' tests updated below.
>
> Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
> Change-Id: I1420d6163ac2e3b22e0971f7b0ad516895dded70
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176662
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,cskau@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/40815
Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: I870f0202f43588f71a5d2b0f82338978b5a5dda9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178998
Reviewed-by: Michal Terepeta <michalt@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-01-14 13:56:53 +00:00
Lasse Reichstein Holst Nielsen f93cf84590 Update documentation of dart:isolate.
Change-Id: If026cebc668603f80168dfe943646c0c0dc451e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178983
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-14 12:59:53 +00:00
Lasse Reichstein Holst Nielsen 434a97a3c1 Update documentation of dart:math.
Change-Id: Ice4a00c0dee37e88e4ee52ce76d7e7955e75cdb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178820
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-01-14 11:24:06 +00:00
Lasse Reichstein Holst Nielsen 1ebeb87a82 Update dart:typed_data documentation.
Update to using `///` and some minor tweaks.

Change-Id: Iaae63111952b56fa7631c969d5f43bff774216ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178801
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-01-14 11:10:17 +00:00
Daco Harkes 5d40d52fca [vm/ffi] Add Opaque type
Issue: https://github.com/dart-lang/sdk/issues/44622
Issue: https://github.com/dart-lang/sdk/issues/43974

TEST=samples/ffi/sqlite/lib/src/bindings/types.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: Ib9e72df6a07b1bc2b72a7db66f945652814baf51
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,analyzer-nnbd-linux-release-try,front-end-linux-release-x64-try,front-end-nnbd-linux-release-x64-try,benchmark-linux-try,dart-sdk-linux-try,pkg-linux-release-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178984
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-01-13 17:04:08 +00:00
Daco Harkes 4e2343c290 [vm/ffi] Introduce Allocator API
Introduces the Allocator API in `dart:ffi`.

This CL does not yet roll `package:ffi` to use `Allocator`, because that
breaks the checked in Dart in Fluter in g3. Instead, this coppies
`_MallocAllocator` from `package:ffi` into the ffi tests for testing.

This CL does not yet migrate off `allocate` and `free` in the SDK. That
is done in a dependent CL.

Issue: https://github.com/dart-lang/sdk/issues/44621
Issue: https://github.com/dart-lang/sdk/issues/38721

TEST=tests/ffi/allocator_test.dart
TEST=tests/ffi/calloc_test.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: I173e213a750b8b3f594bb8d4fc72575f2b6b91f7
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,analyzer-nnbd-linux-release-try,front-end-linux-release-x64-try,front-end-nnbd-linux-release-x64-try,benchmark-linux-try,dart-sdk-linux-try,pkg-linux-release-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177705
Reviewed-by: Clement Skau <cskau@google.com>
2021-01-13 17:04:08 +00:00
Lasse Reichstein Holst Nielsen 8a81fe235d Update dart:collection documentation for null safety.
Minor cleanups.

Change-Id: I8bd2efbec3aa0c7cf9651c1a2cfa7e436e09ab0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178204
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-13 12:05:14 +00:00
Clement Skau 8f2c47f24b [VM] Adds Future.then and Future.catchError stack unwinding.
TEST=Various 'causal' tests updated below.

Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
Change-Id: I1420d6163ac2e3b22e0971f7b0ad516895dded70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176662
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-13 08:00:14 +00:00
Lasse R.H. Nielsen ef8cc2c1cf Remove LateInitializationError.
As per planned breaking change to let platforms decide how they and what throw for late initiaization errors,
we no longer need a public `LateInitializationError` class. It's confusing to have one if some platforms throw
something else instead.

Removes the public abstract class. The dart:_internal implementation class `LateError` no longer implements it.
This is the only implementation of the public interface, and the class which platforms either throw directly,
or through front-end lowering of the feature.

Remove mentions in tests. All tests now just expect `Error`, some platform specific tests might test the message.

TEST=rewrote tests referring to LateInitializationError.

Change-Id: I54344a67f89ce101ed770412db134e12354cdcc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174928
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-12 20:21:33 +00:00
Stephen Adams 87ad206da2 [dart2js] Make JS string literals more uniform
More runtime and boilerplate strings use double-quotes.
This is more consistent with strings from codegen.

Change-Id: I53b6852fc3e8b644a530046aa1a135faf9ae3782
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178380
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-01-12 18:24:21 +00:00
Lasse Reichstein Holst Nielsen 2499451126 Update documentation of dart:convert.
Change-Id: I8c739b720a749b11035fa2841ebb024bf1d5b351
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178205
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-01-12 14:31:01 +00:00
Lasse R.H. Nielsen fe7efd5606 Update documentation in dart:core.
Fix null safety issues and tweak documentation where it can be improved.

Change-Id: Ia8cc20274ae151c454662bf5f137913787365a64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177960
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-12 13:06:41 +00:00
Ben Konyi d9ca0514bc [ Service ] Disconnect existing clients when DDS calls
_yieldControlToDDS

Instead of DDS failing to connect when there are existing clients
connected to the VM service, the VM service will now disconnect these
clients when _yieldControlToDDS is invoked.

If an existing DDS instance is already connected, existing clients will *not*
be disconnected and instead an error will be returned containing the URI of
the existing DDS instance.

TEST= runtime/observatory/tests/service/dds_disconnects_existing_clients_test.dart

Change-Id: I08e126d99f51ff14205f359a60ca802c27fd206d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178725
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2021-01-12 02:05:00 +00:00
Regis Crelier daef1f0dbf [VM/runtime] Turn error for missing entry point pragma into a warning.
Print a warning and continue execution after the signature of a function cannot
be verified, because it was not marked as entry point and therefore tree-shaken.
Keep reporting the error only if the flag --verify-entry-points was specified.

Add missing entry point pragma to `scheduleMicrotask` in `dart::async`.
See issue https://buganizer.corp.google.com/issues/177110012

TEST=CL to be patched in test roll of Flutter to Google3 for verification

Change-Id: I1e5f42d02a312363f3003480b053d881a9a58048
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178722
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2021-01-12 00:41:30 +00:00
Ben Konyi c42c76f590 [ VM / CLI ] Run DartDev isolate from snapshot when possible
This change tries to run from dartdev.dart.snapshot and falls back to
running from dartdev.dill if incompatible VM flags are provided.

Fixes https://github.com/dart-lang/sdk/issues/43969

Performance results:

dart test.dart (no CLI isolate): 0.167s
dart run test (from snapshot):   0.208s
dart run test (from kernel):     0.326s

TEST=pkg/dartdev/test/load_from_dill_test.dart

Change-Id: I3195886b86676580ef2a0221f0284328964ef061
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178300
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-01-11 19:41:50 +00:00
Alexander Markov 9d1a307954 [vm] Add specialized factory constructors for small list literals
Flutter gallery in release mode:
AOT snapshot size arm64 -0.22%, arm -0.21%
instructions size arm64 -0.46%, arm -0.4%

TEST=existing tests

Fixes https://github.com/dart-lang/sdk/issues/44391

Change-Id: I4733e91ecf4601c0bcde725cf9e97f5db0b8bc13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175821
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-11 19:32:30 +00:00
Alexander Aprelev a173599f4c [io/lookup] On iOS run both ipv6- and ipv4-lookup concurrently.
On iOS name resolution can take unexpectedly long because it waits for both ipv4 and ipv6 results and in some cases ipv6 lookup can take long. This CL runs explicit ipv4 and ipv6 concurrently and picks up first successfully resolved name it can connect to.

Fixes https://github.com/dart-lang/sdk/issues/41451

TEST=standalone/io/http_force_concurrent_ipv6_lookup_test

Change-Id: Ie9b7ca0493d945e2eeb8de1dec7bbacdeb902785
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177560
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-01-11 17:07:26 +00:00
Lasse R.H. Nielsen eaf5be7b80 Uri.https and Uri.http constructors queryParams type
Currently `Uri.http` and `Uri.https` factory constructors do not allow for `queryParameters` to be `Map<String, dynamic>`, but only `Map<String, String>`, when in fact the main `Uri` constructor does work with `queryParameters` as `Map<String, dynamic>`.

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

GitOrigin-RevId: 6fa130cc4325ae99d96260e8dc0a222398e7522f
Change-Id: Ia1ee0911ec4d80df75792a365af9ca143a729fa2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163620
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-01-11 15:22:06 +00:00
Regis Crelier b3bca1821c [VM/runtime] Decouple representation of function signatures from Function objects.
This fixes issue https://github.com/dart-lang/sdk/issues/43088

This CL improves on https://dart-review.googlesource.com/c/sdk/+/166920 by keeping the names of type parameters.

See go/dart-vm-signatures for motivation for this change.

TEST=existing suites

Change-Id: Ia82f1d322f72d07b2fb253cf914f9b868025c71e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176981
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-07 23:45:37 +00:00
Mark Zhou 5ee1ee3c04 [dartdevc] Adding support for deferred library checks in DDC.
Fixes #42491

Change-Id: I6afc084bb7b1ccf6c667cb241ab2ac20aa881af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177620
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-01-07 21:43:08 +00:00
Ryan Macnak 0a63d23c11 [vm] Don't allocate a backing store for maps until the first insert.
Empty maps are fairly common; delaying allocation of the backing store saves time and memory for empty maps. Non-empty maps probe an extra time for the first insert.

Most maps also have few associations, so reducing the initial backing store size also saves memory on balance. The best value for dart2js would be 2 associations, but this CL changes it to 4 as a compromise with other benchmarks on Golem.

Runtime as Score geomean              2.620%
MemoryUse geomean                    -5.233%
dart2js CompileSwarmLatest            0%
dart2js CompileSwarmLastedMemoryUse -10.51%

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/26081
Change-Id: I80a925f698f3df44fae5e97e1804c8dff2ce0c60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176583
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-06 17:49:31 +00:00
suragch 76114063f3 Fix InternetAddress.fromRawAddress unix socket documentation.
`InternetAddressType.unix` is the one that should be encoded as a valid
UTF-8 encoded file path, not `InternetAddressType.IPv4`.

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

GitOrigin-RevId: e89eb88ef1732fcc9011ecaf8e18da409d692eaa
Change-Id: Id4ff25921c9c9e0999f44ea90332a7d7cce5d628
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176620
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2021-01-05 13:53:28 +00:00
suragch cfe73b7fce Fix "set customize" typo in socket options documentation.
"set" or "customize" is fine, but not "set customize"

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

GitOrigin-RevId: 05068faace7f1ab59a4c2920f42cbb6a02305a74
Change-Id: I41618e72cc6cf4ae3267fa66dd1e1da7634c2aba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176640
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2021-01-05 13:50:59 +00:00
Daco Harkes 7e1d23bb29 [vm/ffi] Deprecate Struct.addressOf
Now that we have nested structs, objects a subtype of `Struct` can be
backed by either a `Pointer` or a `TypedData`. Having this accessor is
misleading.

Instead of passing a struct around (which could be backed by either),
the `Pointer<T extends Struct>` should be passed around and `.ref`
should be used everywhere when access to the backing pointer is
required.

Issue: https://github.com/dart-lang/sdk/issues/40667

Related issues:
* Optimize .ref #38648
* Support tree shaking of structs #38721

Change-Id: I3c73423480b91c00639df886bf1d6ac2e444beab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177581
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-01-05 11:47:48 +00:00
Srujan Gaddam d683f33f5b [dart:js_util] Add checks for functions in js_util
Closes https://github.com/dart-lang/sdk/issues/44145

Introduces assertions in js_util for `setProperty`,
`callMethod`, and `callConstructor` for when the provided
values are Functions but not wrapped with `allowInterop`.
Adds a test to check for assertions in each of those methods.

Change-Id: I7681cf81170d7975abc7e7dd4172f2c5673f203b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176740
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-12-29 22:29:05 +00:00
Daco Harkes b6b82dd3ac [vm/ffi] Support nested structs
This CL adds support for nested structs in FFI calls, callbacks, and
memory loads and stores through the Struct classes itself.

Nesting empty structs and nesting a structs in themselves (directly or
indirectly) is reported as error.

This feature is almost fully implemented in the CFE transformation.

Because structs depend on the sizes of their nested structs, the structs
now need to be processed in topological order.

Field access to nested structs branches at runtime on making a derived
Pointer if the backing memory of the outer struct was a Pointer or
making a TypedDataView if the backing memory of the outer struct was
a TypedData.

Assigning to a nested struct is a byte for byte copy from the source.

The only changes in the VM are contained in the native calling
convention calculation which now recursively needs to reason about
fundamental types instead of just 1 struct deep.

Because of the amount of corner cases in the calling conventions that
need to be covered, the tests are generated, rather than hand-written.

ABIs tested on CQ: x64 (Linux, MacOS, Windows), ia32 (Linux, Windows),
arm (Android softFP, Linux hardFP), arm64 Android.
ABIs tested locally through Flutter: arm64 iOS.
ABIs not tested: ia32 Android (emulator), x64 iOS (simulator), arm iOS.
TEST=runtime/bin/ffi_test/ffi_test_functions_generated.cc
TEST=runtime/bin/ffi_test/ffi_test_functions.cc
TEST=tests/{ffi,ffi_2}/function_structs_by_value_generated_test.dart
TEST=tests/{ffi,ffi_2}/function_callbacks_structs_by_value_generated_tes
TEST=tests/{ffi,ffi_2}/function_callbacks_structs_by_value_test.dart
TEST=tests/{ffi,ffi_2}/vmspecific_static_checks_test.dart

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

Contains a temporary workaround for
https://github.com/dart-lang/sdk/issues/44454.

Change-Id: I5e5d10e09e5c3fc209f5f7e997efe17bd362214d
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169221
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-18 09:34:35 +00:00
Kamil Rykowski dd47afa136 Fix typo in error message
Closes https://github.com/dart-lang/sdk/pull/44470
https://github.com/dart-lang/sdk/pull/44470

GitOrigin-RevId: f692093e550b1ac60683089db7911687559b6970
Change-Id: I21d25062cfa4b2575d2c1bc308da15d6c7c260ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176100
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-12-17 12:37:08 +00:00
Sigmund Cherem 368d9f375f web: fix js-number patches to avoid assignment errors
Change-Id: Ie4ae4b1aa1a67a0153168d30d27d16d005c564a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176483
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-12-17 04:35:53 +00:00
Devon Carew c7bd33106b [dart: api docs] fix two resolution issues in the dart core library docs
Change-Id: Ic36ff59dc0784d7fdf8a560272016b81880eebd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176067
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-12-16 23:31:13 +00:00
Lasse R.H. Nielsen e40ae3ba25 Add missing @Since markers on unmodifiable set additions.
Change-Id: I84e94736a425d45b6b1334e90f7991fa31070713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176240
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
2020-12-15 18:48:41 +00:00
Lasse R.H. Nielsen 478602ad79 Fix errors in Future implementation around Future<Future<X>>.
Previously, when completing a future with another future,
we always chained to the other future. This effectively awaits
the latter future and then completes the former with its result.
This is incorrect behavior if the former future is, say,
a `Future<Future<int>>` and the latter is a `Future<int>`.
In that case we *must not* await the latter future
because we can't complete the former future with an `int`.
We should just complete the future directly with the latter future
as a value.

We now check first whether to chain a `Future<T>` to another
future, and only does so if the latter future is a `Future<T>`
(or it's not a `T`, which shouldn't happen,
but currently does in some places).

Add test for behavior.

Change-Id: I57e27111c2fc7b7792dcf4ae9b7c1d5d504d0c0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/53602
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-12-14 16:34:28 +00:00
Stephen Adams 12548b3be1 [js_dev_runtime] 2.5.gcd(5) is an error
Change-Id: I1419f6a8b7b65e7b37502a1d7b96440ef5683e44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175942
Auto-Submit: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-12-13 18:34:46 +00:00
Stephen Adams cc3c70159d [dart2js] Convert first argument to main
- When `main` has arguments, use a callMain shim to convert first
  argument passed to `main` to a `List<String>`.

- Make js_runtime/preambles/{d8,jsshell}.js pass command line arguments to
  Dart `main`.

Change-Id: I8c04bbe49366e756cfe84d1c705767e0366ee74c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158373
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-12-11 01:29:28 +00:00
Oleksii Khomchenko 64226729c1 [corelib] Add Set.unmodifiable backed by an UnmodifiableSetView
UnmodifiableSetView does not have backend specific implementations
(simillar to UnmodifiableMapView, unlike UnmodifiableListView).

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

Change-Id: I041bb6dc95d6a67a395ca75581ffe8e5933acdc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164103
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-12-10 11:00:27 +00:00
Srujan Gaddam 8e663541c9 [ddc] Change is checks for JS types
Changes 'is' checks for JS types such that it no longer does an
instance of check and instead only checks to see if the object
in question is a JS object or appropriate subtype. This means that
any two @JS objects will pass an is check and therefore can be
casted as one another. This makes it consistent with expected
behavior and dart2js.

Also amends the README to reflect the unified behavior.

Change-Id: I11aa105d6cafbbafde482b27dcc1182c0960cce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173140
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-12-10 01:38:26 +00:00
Nicholas Shahan d0ee5dbe40 [ddc] Verify null safety modes of modules agree
Checks that the null safety mode of every module loaded matches the mode
of the SDK.

This relands https://dart-review.googlesource.com/c/sdk/+/173120 with
additional fix to correctly set the mode of a new component created
in the frontend_server.

Change-Id: I855b226f724ce0b6c83dbdc11ff6113853892dbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174881
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-12-09 21:12:20 +00:00
Lasse R.H. Nielsen b62ad8247f Switch order of socket tests to avoid timing issue.
Also fix one more place where ??= was appropriate.

Bug: https://github.com/dart-lang/sdk/issues/44414
Change-Id: I323bd0b82a1070a7e1341bee3a917564af45cafa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175360
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-12-09 16:19:00 +00:00
Stephen Adams 35c7ebba1f [js_runtime] Specialize JSArray.addAll for JSArray input
Change-Id: I80b648a1a7c1cafb871618ccf57901047a374c19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175344
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-12-09 05:23:08 +00:00
Nicholas Shahan 4c2edfd5b9 [html] Make cancel() always return synchronously
Before Null Safety, `_EventStreamSubscription.cancel()` used a trick
to run with synchronous timing even though it was typed to return a
`Future`. During the migration of the SDK to support Null Safety it
kept the synchronous timing in weak mode, but was changed to
asynchronous in sound mode so that the behavior matched the method
signature. In hindsight, changing the timing when opting into Null
Safety is problematic:

* A shared package has no control over what mode it runs in. Libraries
  may be opted in and run their tests with sound null safety but the
  apps they are used in could still be running in weak mode. This
  results in library unit tests that behave differently than the
  production app that deploys the code.

* This codepath can be triggered by EventTarget.dispatchEvent() from
  dart:html which should have synchronous timings for the event
  listeners before returning to the calling code. The asynchronous
  timing when running with sound null safety is inconsistent with the
  browser API.

This change reverses that migration decision and keeps the synchronous
timing in both modes. To support this in sound mode it returns a
special future value that is internal to the SDK and known to be used
for synchronous timing.

This change also removes the workaround introduced in DDC to avoid
warning/failing when `_EventStreamSubscription.cancel()` returned
null and the extra warnings/errors features were enabled in weak
null safety mode.

Change-Id: I6b08a2ada5b10120bea787ad59d1d58e6e181de5
Fixes: https://github.com/dart-lang/sdk/issues/44157
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175323
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-12-09 01:44:38 +00:00
Ryan Macnak 1b160f79fe [vm] Gracefully handle loads not solicited by prefix.loadLibrary().
TEST=flutter
Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: Ia0e99c5e84cdff8736c44e4e82ce40b045ed0207
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174563
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-12-08 22:14:25 +00:00
Alexander Markov bae438c033 [vm/corelib] Remove unnecessary isEmpty call from List._fromLiteral
VM doesn't call List._fromLiteral for empty list literals, so there is
no need in testing if elements are empty in List._fromLiteral.

Also, List._fromLiteral is always called on _List elements, so we can
use a more specific type for its parameter.

Fixes https://github.com/dart-lang/sdk/issues/44393

Change-Id: I2e58534c6d183c30673a68bc6705f5c64edc9f09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175280
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-12-08 00:00:28 +00:00
Lasse R.H. Nielsen 6e29700e16 Update List constructor documentation, deprecate constructor.
Emphasize that the operation is going away,
and mark constructor as deprecated.

TEST= Refactoring+deprecation only, covered by existing tests.

Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-07 16:20:28 +00:00
Lasse Reichstein Holst Nielsen 81c3e8cbb4 Address comments from https://dart-review.googlesource.com/c/sdk/+/174471
* Rename `completer` to `result` (its role, rather than repeating its type).
* Change &times; in non-dartdoc comment to the actual character.
* Throw on an unexpected source address argument type.

Also handle failing unix socket connections better.
The current code did not account for all possible return values
from the native connect functions. Likely, those other values never
occurred, but unless it's proven that they can't, not even in unsound
mode, the code should be prepared for them.
(And added missing `return` to the native code).

TEST= Refactoring, no change to tests.

Change-Id: Ie27670f62ae6ecc64dc045c28869e3d5ab218fda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175042
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-07 15:42:57 +00:00
Kabirou Agouda bf539b4aed Update list.dart
Line 745 .
Added the value of words.asMap() as a comment
it allows to have an idea of the result of the use of the asMap function.

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

GitOrigin-RevId: c197eb72523706216e92057c7c3b0dbe17e5c86b
Change-Id: I97693ffa4a9840245d340cc81e68d0d31eb926f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174940
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-12-07 11:46:57 +00:00
Alexander Markov f04757f6ea [vm] Specialize List.empty calls for growable and fixed-length lists
TEST=existing tests for List

Fixes https://github.com/dart-lang/sdk/issues/44388

Change-Id: I89eecb15b535cc5a3e1aeea350a306883b463b9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175003
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-12-06 23:31:55 +00:00
Ryan Macnak 28fe36c637 [vm, compiler] Recognize WeakProperty's accessors.
The layout of WeakProperty is defined in C++ instead of Dart. Add missing recognition of its accessors so the compiler can use direct field access instead of always going through natives. Compare LinkedHashMap.

Change the sentinel for WeakProperty lists to object null so that no special constructor is needed.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/44333
Change-Id: I8686383053c2c345c972b6615b514a1381e79fda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175001
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-12-04 22:25:12 +00:00
Alexander Markov 4457de2278 [vm/corelib] Shrink code size of inlined _GrowableList.add
Previously, _GrowableList.add used 2 calls to grow the list which
results in extra code generated for each inlined List.add call.

This change replaces

  _grow(_nextCapacity(len));

with

  _growToNextCapacity();

which reduces code size.

Flutter gallery in release mode
instructions size -0.32% (arm), -0.1% (arm64)
total snapshot size -0.19% (arm) -0.06% (arm64)

Change-Id: I8422757d147ecec5bdec60910c65c558c39fde1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175006
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-12-04 20:05:32 +00:00
Daco Harkes 224351bb92 [vm/ffi] Clarify struct documentation
Closes: https://github.com/dart-lang/sdk/issues/44355

Change-Id: I1a9676a16fcf61b776216626665a2802dcf64305
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175043
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2020-12-04 18:04:05 +00:00
Stephen Adams 6b6eccecb3 [vm] Fine-grained dispatch of List.of
Dispatch List.of to one of ten implementations so that the inner loop
is monomorphic for {_List,_GrowableList,_ImmutableList} x
{_List,_GrowableList} cases.

ListCopy.List.of related benchmarks show a nice gain, especially for
the longer lists where the monomorphic loop pays off (arm7):

ListCopy.List.num.unmodifiable.2    12.10%
ListCopy.List.num.from.2            18.24%
ListCopy.List.of.2                  19.19%
ListCopy.List.num.from.fixed.2      26.42%
ListCopy.List.of.fixed.2            34.63%
ListCopy.List.num.unmodifiable.100  68.80%
ListCopy.List.num.from.100          62.83%
ListCopy.List.of.100                66.39%
ListCopy.List.of.fixed.100          80.20%
ListCopy.List.num.from.fixed.100    75.12%

Bug: 32937
Change-Id: I5c7006969240a60e0c5797546db72b6b5caec748
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174880
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-12-03 22:33:11 +00:00
Alexander Markov 3a75dffd8a [vm/nnbd] Add check for repeated initialization of late final local variables
TEST=tests/language/nnbd/syntax/late_modifier_runtime_error_test.dart

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

Change-Id: I93776094914358600b3bd6ae6df649500fcff7b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174980
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-12-03 21:48:11 +00:00
Johnni Winther 87ef15787a [cfe] Handle write during late local initialization
In response to issue #44372

Change-Id: I6ad0730e662f7fcd8987a745cbab72dbb91c2045
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174923
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-03 16:41:53 +00:00
Lasse Reichstein Holst Nielsen 96dc4116e5 Update _NativeSocket.startConnection to avoid state errors.
The existing code is undocumented and has caused state errors
where a future is attempted completed more than once.

This rewrites the code, formalizes and documents the expected behavior,
which is slightly different from the previous behavior wrt. scheduling
new connections when existing connections fail.

Change-Id: I369fc5b70920954af4a066a179d751b72da35800
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174471
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-12-03 14:37:43 +00:00