Commit graph

11031 commits

Author SHA1 Message Date
Brian Quinlan a75e857df5 Add a Platform.lineTerminator static method
Bug: https://github.com/dart-lang/sdk/issues/52379
Change-Id: Ic3a7f06252f8a69dcfdb29c00f16557c34529652
CoreLibraryReviewExempt: Aske is on holiday
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297260
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-05-18 19:57:58 +00:00
Christian Findlay e43939dd5d Some work on the issue #40614 now that we have soundness
Closes https://github.com/dart-lang/sdk/pull/52383

GitOrigin-RevId: 70014d0575d1623c1f777fab479cfa93088efa2a
Change-Id: Ibf4ad3d862b07873317785389799ee8dfc80290f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303161
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2023-05-17 18:25:11 +00:00
Lasse R.H. Nielsen 066106d19a Make Uri.base see IOOverrides changes to current directory.
Fixes #39796.

Tested: Case added to `io_overrides_test.dart`.
Bug: https://dartbug.com/39796
Change-Id: Id72f75f972f59f4f9b7d17e79b4bcffd6d79f2c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304006
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-05-17 17:27:13 +00:00
Tim Sneath 578dd70fae Tighten introductory text
Closes https://github.com/dart-lang/sdk/pull/52065

GitOrigin-RevId: f1b58633b1069f129d8c88ac7fca1bc9a48f3beb
Change-Id: I4af2e3b69711e4a393c154a98b4a4e5a26e8a03e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295700
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2023-05-16 13:55:23 +00:00
mnordine 2369a3be0f Fix bool.parse() examples
Closes https://github.com/dart-lang/sdk/pull/52389

GitOrigin-RevId: 4987894e85a28e18b183eb45a111d47444d305db
Change-Id: Ib68581d7966c0fb24ccd9070054ea9aaadd2e17d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303221
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-05-16 11:16:16 +00:00
Srujan Gaddam 5225b3d408 [ddc] Remove @staticInterop runtime type in favor of erasure
While we can't modify the kernel ASTs due to modular compilations, we
can change the type we emit instead of using a runtime @staticInterop
type. This CL refactors the erasure so that DDC can use it to emit
JavaScriptObject instead of StaticInteropType.

Change-Id: I9cbeaa2127e50702d2bdf6aeedb2744b7ece33c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295392
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-05-16 01:37:28 +00:00
Nicholas Shahan dd6257a2d3 [ddc] Support dynamic calls of generic functions
Adds the ability to call functions/methods/tearoffs with
generic type arguments when running with the new type system.

Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: I28b8cdad56d614a6b9904995634c0cef67d88ebc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296960
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2023-05-16 01:12:54 +00:00
Nicholas Shahan adc2935ff4 [ddc] Remove __proto__ use from records.dart
Issue: https://github.com/dart-lang/sdk/issues/52372
Change-Id: I05806656ac9ce2c1ddee233ec836b0a8d0aed464
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303143
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-05-16 00:32:56 +00:00
Nicholas Shahan e61a6175ee [dart2js][ddc] Remove __proto__ use from dart:_rti
Issue: https://github.com/dart-lang/sdk/issues/52372
Change-Id: I86c5545c7e4c7d6c3636a849e8d67066f8155662
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303443
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-05-15 23:47:08 +00:00
Nicholas Shahan 334a552d96 [ddc] Remove use of __proto__ from subtype check
Issue: https://github.com/dart-lang/sdk/issues/52372
Change-Id: I2aed1970164be1e2d4ee525891eaa452e59cd6f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303142
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-05-15 23:46:06 +00:00
Nicholas Shahan f0c14f5b9a [ddc] Remove __proto__ use from debugger.dart
Issue: https://github.com/dart-lang/sdk/issues/52372
Change-Id: I1caa35917ab0b7f0db06da08f70ddffb7bb5653b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303141
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-05-15 22:49:06 +00:00
Nicholas Shahan 3b0e3b98af [ddc] Remove __proto__ use from operations.dart
Issue: https://github.com/dart-lang/sdk/issues/52372
Change-Id: Idc1d64243438d8cd289c64c7df8e9293ab45a548
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303140
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-05-15 20:22:22 +00:00
Nicholas Shahan 4adf002b1d [ddc] Remove __proto__ use from js_array.dart
Issue: https://github.com/dart-lang/sdk/issues/52372
Change-Id: I65ddae15e31ea85a431a62c8b4454710503fd30f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303085
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-05-15 18:57:43 +00:00
Daco Harkes d360edf2f3 [pkg][vm] Native Assets builder
This package contains the logic for building native assets.

This package is the backend that invokes toplevel `build.dart` scripts.
For more info on these scripts see https://github.com/dart-lang/native.

This is a separate package so that dartdev and flutter_tools can reuse
the same logic without flutter_tools having to import dartdev.

Some design decisions:

* We don't yet have `build_dependencies`, so we use the ordinary
  dependency graph for ordering of native assets builds. (If there is
  a cycle we refuse to run.)
  Bug: https://github.com/dart-lang/pub/issues/3794
* Builds are cached based on all the configuration provided by the
  caller. Environment variables are ignored in caching. This CL also
  contains a unit test that invokes the build by not passing through
  environment variables. However, for Windows we need to pass through
  at least `SYSTEMROOT` for MSVC to run correctly. So we might need
  to further explore if we can/want to lock env variables down.
  Bug: https://github.com/dart-lang/native/issues/32
  Bug: https://github.com/dart-lang/native/issues/33

Run tests:
```
dart tools/generate_package_config.dart && \
tools/test.py -n unittest-asserts-release-linux pkg/native_assets_builder
```

Bug: https://github.com/dart-lang/sdk/issues/50565
Change-Id: I133052d7195373e87d20924d61e1e96e3d34ce8f
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300203
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Hossein Yousefi <yousefi@google.com>
2023-05-15 13:49:30 +00:00
Nicholas Shahan d7fc9ca3cc [ddc] Add get and set proto inlined helpers
The helper methods make it easier to call the JS version of
`Object.getPrototypeOf()` and `Object.getPrototypeOf()` from the
SDK libraries. The body gets inlined directly to avoid extra method 
calls in potentially hot code paths.

Start using the setter when setting base and extension classes.

Issue:https://github.com/dart-lang/sdk/issues/52372
Change-Id: I6ca70cbf1936f76f24c8843e51c1c47e9bfe659c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303009
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-05-12 23:38:38 +00:00
Mark Zhou 383115fdbf [ddc] Renaming real deferred loading to DDC deferred loading
Change-Id: I9d2848288c76db0cc0427439a0bbc2e291a1df8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303001
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-05-12 17:54:55 +00:00
Nicholas Shahan f2aa312e17 [ddc] Implement new record types
Update the format of the shape keys to better match the format used in
the dart:_rti library. This change applies to the current runtime type 
system as well.

Change-Id: I87d2af2aaf2b9dbe012fae60a64718d264a3a18c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295721
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-05-12 17:23:07 +00:00
Lasse R.H. Nielsen a826699931 Have Uri give better error message for invalid Windows path.
CoreLibraryReviewExempt: Trivial change to error path.
Change-Id: Iadfb80eeb1e6c58686ed9741a88f369e130ed9e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302780
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
2023-05-11 16:43:28 +00:00
Daco Harkes e5bb28bc4d [vm/ffi] Pointer.asTypedList finalizer
TEST=tests/ffi/external_typed_data_finalizer_test.dart

Closes: https://github.com/dart-lang/sdk/issues/50507
CoreLibraryReviewExempt: https://github.com/dart-lang/sdk/issues/52261
Change-Id: I1a82dcca15961b28c0de64637970fe38a39286e5
Cq-Include-Trybots: luci.dart.try:vm-asan-linux-release-x64-try,vm-aot-asan-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-qemu-linux-release-arm-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-aot-win-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-aot-mac-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301001
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-05-10 11:38:57 +00:00
Nate Bosch 2829b2cfce Mention non-sent Done event for paused listeners
Closes #19095

The current doc implies that the future will complete before listeners
have received the events, but a paused listener will instead block
completion.

Change-Id: Ic24ff9e46d269664f89c670eb60084821a824278
CoreLibraryReviewExempt: Doc change without behavior changes.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302101
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-05-09 20:44:54 +00:00
Brian Quinlan 86abdd7dae Avoid allocations during SameSite value parsing
Change-Id: I092d5ab68a19dd4f512739d6bd29f75f2a8b2744
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301734
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-05-09 18:01:19 +00:00
Mark Zhou b6870138ee [ddc] Extending library-to-module resolution to include libraries referenced in the current component
Required for upcoming deferred loading changes.

Our previous only stored this resolution logic for all componets except the
current component, which resulted in some empty deferred loads when referencing
modules in the main component.

Also adds a small type signature update missed in a previous commit.

Change-Id: I8511a39b26e1864919cc4882a6c008d2010354a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299381
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2023-05-05 01:14:41 +00:00
Joshua Litt 80e7018919 [dart2wasm] Minor JS interop optimization.
Change-Id: I4255100dcfea350d818d05794fb5fff2c3345b86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301502
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2023-05-04 20:03:08 +00:00
Srujan Gaddam 0383b389db [dart:js_interop] Expose dart:js_interop through dart.dev
Closes https://github.com/dart-lang/api.dart.dev/issues/91

dart:js_interop_unsafe is documented, but dart:js_interop is not.
Also updates library documentation for both libraries.

CoreLibraryReviewExempt: Documentation of backend-specific library.
Change-Id: I0faff9f7d7fed134e203558de53ad3313eb43b31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301260
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-05-04 17:41:53 +00:00
Sun Jiao f9ccf90c97 [http] support SameSite in Cookies.
Closes https://github.com/dart-lang/sdk/pull/51457

GitOrigin-RevId: 4e0bece11ae2c1b7b7eac5a43293ae43682e22d2
Change-Id: I0fe39aede037b713b5a3fdbf7950a4a44a02ea1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283984
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-05-02 23:51:22 +00:00
Lasse R.H. Nielsen 6c86fc44a6 Reland "Fix bug in Completer.complete."
This reverts commit 212d5e3a31.
This reapplies commit 3688a4723c.

CoreLibraryReviewExempt: Refactoring and relanding.
Change-Id: I9b52ef4073bfff50699919f8a5b85e5ff66d0c3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258929
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
2023-05-02 19:33:57 +00:00
Srujan Gaddam c4d354dc2a Reland "[pkg:js/dart:js_interop] Move annotations to dart:_js_annotations"
This reverts commit 4919729f00.

This CL also adds back in logic to handle older package:js versions to avoid
failures in our static checking. It also supports dart:js_interop's @JS
annotation since it can now be used for @staticInterop classes.

CoreLibraryReviewExempt: Reland of backend-specific library changes.
Change-Id: I104653a9a6b2593f6bab658808287e2074c18550
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294130
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-05-02 15:24:18 +00:00
Nicholas Shahan b4c5f310d7 [ddc] Implement a safe toString for records
Change-Id: I5120be0567591ded3604cf9edc2af8f617781874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295140
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2023-05-01 23:23:11 +00:00
Nicholas Shahan 9a3588cc26 [ddc] Move record implementation out of types.dart
This implementation is for creating record values, and isn't related to
the type system. Moving to a new file so it can persist after switching
to a new runtime type information library and deleting types.dart.

Change-Id: Ib2d0c621a194d139fb20d12c30b606e8012dfb48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295106
Reviewed-by: Anna Gringauze <annagrin@google.com>
2023-05-01 23:23:11 +00:00
Stephen Adams 9434135939 [js_runtime] Capture LateError stack with fewer runtime frames
Using `new Error()` in the direct throw-helper results in fewer
frames.

Bug: b/279093088
Change-Id: I066b06adb5f872b71809e821e18e77d69ff0cd4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300060
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-05-01 22:39:38 +00:00
Nicholas Shahan b9c371dbfb [ddc] Add support for dynamic calls
Splits out some implementation from the
[orignal CL](https://dart-review.googlesource.com/c/sdk/+/266545)
to simplify the review.

Does not include support for dynamic calls of methods with
type parameters. That support will be added separately.

Addresses some feedback by removing the changes that expose more
internals of the Rti class and creates a static method to
retrieve the information needed to perform the dynamic checks at
runtime.

Change-Id: I4999cd172e7a327025eadc9346d3082093160bfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285883
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-05-01 20:43:42 +00:00
Nicholas Shahan 9c3395600b [ddc] Add conditionals that throw with new types
Purposefully adds the indentation without any implementation to create a
baseline for future changes. The reviews are easier when you can see
there are no diffs in the code for the current runtime type system.

Change-Id: I42438b3fa19263ad3fb8e4e9d5cca6da088fdcdf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296062
Reviewed-by: Stephen Adams <sra@google.com>
2023-05-01 20:43:42 +00:00
Johnni Winther ff0079b94b Reland "[cfe] Enable verification in platform compilation"
This relands https://dart-review.googlesource.com/c/sdk/+/299100

The fix is in patchset 2

Change-Id: I505f3d9c67625cac24ecf60f0eb3d0617d2e847d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298821
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-05-01 07:35:41 +00:00
Joshua Litt 47b7c1f31d [js] Add js_interop_unsafe library.
CoreLibraryReviewExempt: Web only library.
Change-Id: I4d6007e0731ecae81fcc614168baee7d5e662fd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293743
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-04-27 18:51:49 +00:00
Nicholas Shahan a7854364a6 [docs] Fix small typo in code example for Function
Change-Id: Ia762b823c51724229c0eb452a02885ff0f8bc7af
CoreLibraryReviewExempt: Changes documentation only.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299140
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-04-27 17:07:38 +00:00
Alex Li fae49c0514 Improve comments of Directory methods
Closes https://github.com/dart-lang/sdk/pull/52194

GitOrigin-RevId: d6684f771db36b917b30d789785f3f883a76fad3
Change-Id: Ie6a172e7bf818368fe5557fec8b7b9eb1e7de8b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298841
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2023-04-27 09:40:30 +00:00
Oleh Prypin 7bbf7ff43e Revert "[cfe] Enable verification in platform compilation"
This reverts commit 20e0ddf130.

Reason for revert: breakages in google3

Original change's description:
> [cfe] Enable verification in platform compilation
>
> Closes #32530
>
> Change-Id: I5a44e211a4b203e4879dbc8f6bf4bbec5abf51f3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298820
> Reviewed-by: Jens Johansen <jensj@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Nicholas Shahan <nshahan@google.com>

Change-Id: Idb2c30d93ad385431734c4a4e884d3d53be76b2b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/299040
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Oleh Prypin <oprypin@google.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-04-27 08:43:00 +00:00
Johnni Winther 20e0ddf130 [cfe] Enable verification in platform compilation
Closes #32530

Change-Id: I5a44e211a4b203e4879dbc8f6bf4bbec5abf51f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298820
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-04-27 07:34:39 +00:00
Devon Carew 7a5061e71a [docs] fix a grammar issue in the sdk readme
Change-Id: I566740cc36cbc85b16ece550b31481755b86524a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298720
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2023-04-26 18:25:55 +00:00
Srujan Gaddam 1d28f8e821 [dart:js_interop/ddc/dart2js] Implement JS types using @staticInterop
Currently, dart:_js_types types are all typedefs in the web backends.
This leads to inconsistent semantics, since you can statically pass
Strings to JSString, for example. You cannot do this in dart2wasm.
In order to ensure consistent semantics, we reify these types using
a custom @staticInterop lowering. They all get erased to their
respective Dart type. When we have inline classes, these types
should be implemented using inline classes.

Note that Interceptor will not work for this use case. The reified
type of JS primitives are Dart types e.g. String, bool, and therefore
can not be casted to Interceptor.

In order to do this, the eraser is refactored and the JS backends use
shared erasure code to either erase/emit types.

Tests are added to make sure you need to go through a conversion or
cast to pass Dart objects to JS types.

CoreLibraryReviewExempt: Backend-specific internal library changes.
Change-Id: I5942be628102919ec167f094cfe10fced606363c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295105
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-04-26 15:55:54 +00:00
Stephen Adams 70615d5970 [dart2js] Update TODO with issue number
Change-Id: I0191298058f8ceb68eaec91c0c00c8576799a634
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298180
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-04-25 18:19:06 +00:00
Lasse R.H. Nielsen d440905d5a Reestablish abstract on HttpProfiler.
Class used to be abstract, but lost it when made `final`.
There is no reason to allow instantiation, it's all static members.
Restablishing the `abstract` before we release 3.0, so we don't have to go through any extra steps.

The class is public, exported by `dart:io`. (Should probably also be documented.)

Change-Id: Ic1a3e1a777ecbdcf535b92dbcdd88f55a65e9cbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297463
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-04-25 14:41:19 +00:00
Stephen Adams 45efccb5e0 Remove left-over patch declarations for List constructor.
This CL replaces https://dart-review.googlesource.com/c/sdk/+/296900

The `List` constructor is removed in Dart 3.0.
Some of the `@patch` implementations were not removed.

This is *high priority*. It seems the left-over `@patch factory List` constructor did not cause any errors, instead it *added* a constructor  to `List` that can be used in web compiled code. Even if `List` doesn't have such a constructor in the SDK code proper.
The VM and analyzer will say the invocation is an error, but dart2js happily compiles it and runs.

(It used to be that patches couldn't add public members, that security seems to have been removed.)

Also removes code which tries to detect "the unnamed List constructor",
which is no longer a thing, and a number of invocations of the constructor, where it's not clear that the test is aware that the constructor no longer exists, and is not marked as `@dart=2.x` with x < 12.

TEST=ci

Change-Id: I4ffaf3ae2c4e75ca06e7ba0bf19187b6376f3888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297100
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-04-22 00:38:28 +00:00
Brian Quinlan 69f71e90ea Remove 'abstract' from 'class Platform'
Bug: https://github.com/dart-lang/sdk/issues/52138
Change-Id: Ibef54f5369d4b9374e9d58939ee26c853021bf74
CoreLibraryReviewExempt: Partial revert of 9c702bc72e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297160
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-04-21 23:44:29 +00:00
Stephen Adams 2a66f966f3 [dart2js] Rename dart:_async_await_error_codes -> dart:_async_status_codes
Change-Id: I6b47f08791544eabc09bb05a81bbd0154bc39cb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296704
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-04-21 00:01:51 +00:00
Ben Konyi aef551ac35 Reland "[ Observatory ] Disable serving Observatory by default"
This reverts commit fa0c81efe1.

Requires https://github.com/flutter/flutter/pull/123556/ to have landed.

TEST=Existing tests

Change-Id: I40b9e11a89fd66ec511d31a385192e577899fca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296640
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-04-20 18:16:09 +00:00
Derek Xu afa3594ca1 [VM/Timeline] Support flow events in the Perfetto file recorder
This supports flow events reported through dart:developer, but does not
support ones reported with Dart_TimelineEvent in dart_tools_api.h. That
will have to be supported in a future CL.

TEST=CI, manually verifying that flow arrows appeared on flow events in
the trace viewer for traces recorded with our Perfetto recorder

Change-Id: Ic75a8ce277b436a609c027c2c0d4e94b51031aa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280740
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2023-04-20 16:42:23 +00:00
Nicholas Shahan 2a56d8ba84 [ddc] Fix RecordImpl instanceof test
The `instanceof` operator needs a reference to the JavaScript class
instead of the Dart Type. This avoids an issue when changing the
type representation in the new runtime type system where the two
are no longer interchangeable.

Update the parameter name for `_jsInstanceof()` which which was
probably the remnants of a copy paste.

Change-Id: I1d3fcf1915fb3e189ad7f3e130e101009ee50381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296341
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-04-19 21:32:33 +00:00
Lasse R.H. Nielsen b0260187e7 Remove base from StreamView.
It's not *needed* for safety or soundness, and it forces
subclasses to be `base` whether they want to or not.

Bug: https://github.com/dart-lang/async/issues/238
CoreLibraryReviewExempt: Removes a modifier, no implementation effect.
Change-Id: I72ec1ddb3b05b746c08437b0b8173c9e71673fc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296280
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-04-19 17:41:29 +00:00
Alexander Markov 9cf26fc3cd [vm] Fix handling of exceptions thrown from Iterable.iterator during yield*
TEST=language/sync_star/sync_star_exception_iterator_test
Fixes https://github.com/dart-lang/sdk/issues/52083

Change-Id: I6f26189b5d5df1c1804cd6cd7a64f72bdbe55f94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295922
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-04-19 13:50:19 +00:00