1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-08 20:16:39 +00:00
Commit Graph

224 Commits

Author SHA1 Message Date
Martin Kustermann
1fc755eb54 [dart2wasm] Remove sdk/bin/dart2wasm{,_developer} scripts
We already have a shell script that compiles dart code to wasm and
optimizes it. I think it's rather confusing to have multiple, they
contain somewhat duplicated code as well.

We therefore remove `sdk/bin/dart2wasm{,_developer}` (which is
not used by any CI but purely for developers) in favor of
`pkg/dart2wasm/tool/compile_benchmark`.

=> It support with/without binaryen
=> It support measuring size/time/memory of dart2was & binaryen
=> It supports running compiler with assertions

Some flags/vars are not supported anymore:

* `DART_VM_OPTIONS`: Has no effect (as there's no need to support this)
* `sdk/bin/dart2wasm_developer`: Pass `--compiler-asserts` to `compile_benchmark`.
* `-O`: Optimizes now by-default, pass `--no-binaryen` to `compile_benchmark` to disable
* `-O`: Doesn't implicitly pass `--inlining-limit=10`

Change-Id: Ice656d1bfc216a536522b254e2d52bd4cad73e8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347040
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-19 16:05:27 +00:00
Martin Kustermann
1d92908169 [dart2wasm] Have binaryen/wasm-opt flags in one place (dart compile exe), make all other places take it from there
Golem build configuration is setup in a way that includes the `pkg/`
folder entirely, so the shell scripts should have access to the
`dart compile exe` sources.

Change-Id: I5395413ce85f11098d14eacbd6ce392f665ddce5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347021
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-19 07:47:52 +00:00
Ömer Sinan Ağacan
7cceaebd49 [dart2wasm] Start using WebAssembly.String imports
Refactor `JSStringImpl` to use the js-string-builtins API[1].

When the module `WebAssembly.String` is not available we define a
"polyfill" with the previous imports, so this change is backwards
compatible.

Also updates some of the methods to use avoid multiple `this.length`
calls (which do an FFI call), and use unchecked getters when possible.

A new library `dart:_error_utils` is introduced for faster range and
index checks when the length (or max value) is known to be positive
(e.g. when it's the length of a string).

For now only `JSStringImpl` and `operator []` and `operator []=` of
`JSArrayImpl` are updated to use the new range and index checks. Rest of
the libraries will be updated separately.

[1]: https://github.com/WebAssembly/js-string-builtins

CoreLibraryReviewExempt: dart2wasm specific library change.
Change-Id: I9436def0cfe59c631f6f4e15ea06cc18a47a738e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335043
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-12-08 10:04:41 +00:00
Ömer Sinan Ağacan
0d50d07a08 [dart2wasm] Update d8 flags
Change-Id: Ibe1e6c32d1a46055d35dab32878ac958801c550b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335800
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-11-14 09:19:08 +00:00
Ömer Sinan Ağacan
75c975fe6d [dart2wasm] Remove stringref target
stringref target won't be used any time soon (probably ever). To help
with build times and avoid keeping it updated remove it for now.

Change-Id: I0df33b7ab2e19bae5090e8ea32ea6a3dc3751652
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334881
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-11-10 09:49:37 +00:00
Aske Simon Christensen
a2c47adfba Update Binaryen to a51bd6df919a5b79574f0996a760cc20cb05697e
This version fixes an issue with optimizing tuple-valued blocks, which
would arise when inlining functions with multiple return values.

Use the newly added `--type-unfinalizing` and `--type-finalizing`
options to improve the effectiveness of the TypeSSA and TypeMerging
passes.

https://github.com/WebAssembly/binaryen/issues/5923
https://github.com/WebAssembly/binaryen/issues/5933

Change-Id: I1d5bc1052a355bf404f81a420a2352270030fd4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327000
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2023-09-21 11:47:59 +00:00
Ömer Sinan Ağacan
3ee5bdfcf3 [dart2wasm] Add test configuration to test with wasm-opt
- Update dart2wasm script to accept a `-O` argument. When passed it also
  passed `--inlining-limit 10` to dart2wasm (unless it's already passed
  by the caller) and runs wasm-opt on the output, with the same
  arguments as `compile_benchmark`.

- Add new test configurations to run tests with optimized binaries.
  Example configuration: `dart2wasm-linux-optimized-d8`.

Change-Id: Ia7bd8d9c99d3a4baecb72b92b2ba38c0e92807c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326620
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-09-19 10:29:43 +00:00
Joshua Litt
9e37c2b480 [dart2wasm] Add JS compatibility mode.
The purpose of the wasm_js_compatibility target is to facilitate experiments with a JS compatibility mode for Dart2Wasm. Initially, we're just going to focus on typed data, but this will give us a place to experiment with moving List and String to JS as well.

In addition, someday down the road we hope to experiment with two additional compatibility changes:
1) Exclusively using double for all Dart numbers
2) Allowing undefined to flow as null.

The two major benefits of this approach are:
1) Much faster JS interop
2) To make it easier to bring up Dart2JS applications on Dart2Wasm

The only downside will be access overhead on the Wasm side, but the JS builtins proposal could potentially bring us close to parity with Wasm builtins someday.

Tested: Wasm specific trivial refactor.
Change-Id: I2c09426b6999507c1de6e584e9bc7072a088bda9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313240
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-07-18 19:34:38 +00:00
Aske Simon Christensen
5838562040 [dart2wasm] Add option and target for stringref.
This adds basic infrastructure for a stringref implementation in
dart2wasm:

- A `--[no-]stringref` option to the compiler
- An option in the `WasmTarget`, controlling the name of the target
- Separate sets of patch files for the two targets
- Separate platform dill files for the two targets

For now, the patch file contents are the same, and the compiler flag
is not used by the backend (only by the `dart2wasm` script to select
the appropriate platform dill file). Both of these will change as the
implementation progresses.

Tested: ci + manual check that the option selects the correct dill
Change-Id: I2c9bb95ba06fd3de3f7007703ef545e3f0c728ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310621
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-06-21 14:25:38 +00:00
Ömer Sinan Ağacan
2f27fc5ddf [dart2wasm] Update dart2wasm script
When DART_CONFIGURATION is not provided, search in output directory for
a configuration. Code copied from the `dart` script.

Currently the script only works without DART_CONFIGURATION on X64
systems, which is inconvenient when working on macOS or others.

Change-Id: I48c3e32f8824913932aee63e220e5152931b54db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310540
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-06-21 14:15:25 +00:00
Ömer Sinan Ağacan
c74387a3a2 [dart2wasm] New async implementation
This CL re-implements the async function compilation without using JSPI
or any other platform features.

This implementation is faster than the JSPI-based one in all benchmarks,
in some cases up to 200x (benchmark results at the end). So we remove
the JSPI-based implementation as there's no point in maintaining a much
slower implementation and supporting two implementations at the same
time (which is tricky because these implementations need different
libraries, all scripts need to support two modes etc.) that also
requires experimental platform features.

# Main changes

- A new pass `AwaitTransformer` transforms `await` expressions to
  top-level statements in form `var <fresh variable> = await <simple
  expr>`, where `<simple expr>` is an expression without `await`.

  After this pass all `await` expressions have the simple continuation
  of "assign the value of the awaited future to this variable and
  continue with the next statement". This simplifies `await`
  compilation.

- A new code generator `AsyncCodeGenerator` (inherits from
  `CodeGenerator`) compiles `async` functions. The `_YieldFinder` class
  is copied from `sync*` code generator but modified to handle `async`
  expressions.

- Mentions to the V8 flag `--experimental-wasm-stack-switching` is
  removed from all scripts and documents.

# Future work

- Control flow handling in `AsyncCodeGenerator` needs to be implemented
  in a similar way in `SyncStarCodeGenerator`. Doing this without
  duplicating a lot of code will require some refactoring.

# New passing tests

- co19/Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A05_t01
- co19/Language/Statements/For/Asynchronous_For_in/execution_A02_t02
- language/regress/regress23996_test
- language/sync_star/dcall_type_test

# Benchmarks

Current implementation:

```
AsyncLiveVars.LiveObj1(RunTime): 1586000.0 us.
AsyncLiveVars.LiveObj2(RunTime): 2114000.0 us.
AsyncLiveVars.LiveObj4(RunTime): 1972500.0 us.
AsyncLiveVars.LiveObj8(RunTime): 2212000.0 us.
AsyncLiveVars.LiveObj16(RunTime): 2238000.0 us.
AsyncLiveVars.LiveInt1(RunTime): 2362000.0 us.
AsyncLiveVars.LiveInt4(RunTime): 2470000.0 us.
AsyncLiveVars.LiveObj2Int2(RunTime): 2575000.0 us.
AsyncLiveVars.LiveObj4Int4(RunTime): 2820000.0 us.
Calls.AwaitAsyncCall(RunTimeRaw): 35676.15658362989 ns.
Calls.AwaitAsyncCallClosureTargetPolymorphic(RunTimeRaw): 38934.108527131786 ns.
Calls.AwaitAsyncCallInstanceTargetPolymorphic(RunTimeRaw): 42617.02127659575 ns.
Calls.AwaitFutureCall(RunTimeRaw): 2832.058906825262 ns.
Calls.AwaitFutureCallClosureTargetPolymorphic(RunTimeRaw): 3665.8125915080527 ns.
Calls.AwaitFutureCallInstanceTargetPolymorphic(RunTimeRaw): 4420.449537241076 ns.
Calls.AwaitFutureOrCall(RunTimeRaw): 3692.7621861152143 ns.
Calls.AwaitFutureOrCallClosureTargetPolymorphic(RunTimeRaw): 4625.346901017576 ns.
Calls.AwaitFutureOrCallInstanceTargetPolymorphic(RunTimeRaw): 4514.6726862302485 ns.
Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits(RunTimeRaw): 345172.4137931034 ns.
Calls.AwaitForAsyncStarStreamPolymorphic(RunTimeRaw): 697000.0 ns.
Calls.AwaitForAsyncStarStreamPolymorphicManyYields(RunTimeRaw): 704666.6666666666 ns.
Calls.AwaitForManualStreamPolymorphic(RunTimeRaw): 11010.989010989011 ns.
Calls.SyncCall(RunTimeRaw): 0.40275240996973316 ns.
Calls.SyncCallClosureTarget(RunTimeRaw): 0.3989591156672242 ns.
Calls.SyncCallInstanceTargetPolymorphic(RunTimeRaw): 3.2632549336335526 ns.
Calls.IterableSyncStarIterablePolymorphic(RunTimeRaw): 353.3980582524272 ns.
Calls.IterableManualIterablePolymorphic(RunTimeRaw): 332.1161825726141 ns.
Calls.IterableManualIterablePolymorphicManyYields(RunTimeRaw): 354.28067078552516 ns.
```

New implementation:

```
AsyncLiveVars.LiveObj1(RunTime): 11327.683615819209 us.
AsyncLiveVars.LiveObj2(RunTime): 10923.91304347826 us.
AsyncLiveVars.LiveObj4(RunTime): 10956.284153005465 us.
AsyncLiveVars.LiveObj8(RunTime): 11286.516853932584 us.
AsyncLiveVars.LiveObj16(RunTime): 11445.714285714286 us.
AsyncLiveVars.LiveInt1(RunTime): 11016.483516483517 us.
AsyncLiveVars.LiveInt4(RunTime): 11327.683615819209 us.
AsyncLiveVars.LiveObj2Int2(RunTime): 10918.478260869566 us.
AsyncLiveVars.LiveObj4Int4(RunTime): 10737.967914438503 us.
Calls.AwaitAsyncCall(RunTimeRaw): 1082.2510822510822 ns.
Calls.AwaitAsyncCallClosureTargetPolymorphic(RunTimeRaw): 1056.4124234100993 ns.
Calls.AwaitAsyncCallInstanceTargetPolymorphic(RunTimeRaw): 1134.1726210729273 ns.
Calls.AwaitFutureCall(RunTimeRaw): 865.6509695290858 ns.
Calls.AwaitFutureCallClosureTargetPolymorphic(RunTimeRaw): 841.3967185527977 ns.
Calls.AwaitFutureCallInstanceTargetPolymorphic(RunTimeRaw): 839.066957543212 ns.
Calls.AwaitFutureOrCall(RunTimeRaw): 397.9941096871766 ns.
Calls.AwaitFutureOrCallClosureTargetPolymorphic(RunTimeRaw): 406.17384240454913 ns.
Calls.AwaitFutureOrCallInstanceTargetPolymorphic(RunTimeRaw): 393.7472929873607 ns.
Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits(RunTimeRaw): 1095.0503723171266 ns.
Calls.AwaitForAsyncStarStreamPolymorphic(RunTimeRaw): 6643.426294820717 ns.
Calls.AwaitForAsyncStarStreamPolymorphicManyYields(RunTimeRaw): 7178.750897343863 ns.
Calls.AwaitForManualStreamPolymorphic(RunTimeRaw): 1456.23998835008 ns.
Calls.SyncCall(RunTimeRaw): 0.3919935321067202 ns.
Calls.SyncCallClosureTarget(RunTimeRaw): 0.3906669661780074 ns.
Calls.SyncCallInstanceTargetPolymorphic(RunTimeRaw): 3.1676143112814583 ns.
Calls.IterableSyncStarIterablePolymorphic(RunTimeRaw): 104.4932079414838 ns.
Calls.IterableManualIterablePolymorphic(RunTimeRaw): 104.57516339869281 ns.
Calls.IterableManualIterablePolymorphicManyYields(RunTimeRaw): 116.92487576731949 ns.
```

TEST=ci
CoreLibraryReviewExempt: Added entry-point pragmas.
Change-Id: I02fbd08141f51c00fb37b6fa0304dc25d6afdb71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301020
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-05-22 08:32:12 +00:00
Nate Biggs
5969da51d9 [dart2js] Update build infrastructure to move Dart2JS onto sound null safety.
Change-Id: Id172ab72e5d36899f699bb48f8ceb3609964efbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280221
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-02-22 17:19:43 +00:00
Joshua Litt
2248e04f8d [dart2wasm] Fix minor bug in run_dart2wasm_d8.
Change-Id: I2e6b45d206ea5c60adefe05203dca1579991d6ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278801
Auto-Submit: Joshua Litt <joshualitt@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-01-10 17:50:12 +00:00
Joshua Litt
6d0237a79b [dart2wasm] Generate js runtime at compile time.
This is necessary so we can start specializing JS method trampolines. Specializing JS methods will help reduce polymorphic behavior in JS trampolines for JS interop methods.

In the follow on CL we will start injecting specialized JS method trampolines directly into the runtime.

Change-Id: Ib12fb286f54cfb8a64c9f84e238433e8da2eeaa0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272441
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2023-01-10 13:16:29 +00:00
asiva
606a64a743 [3.0 alpha][VM/Runtime] - Flip flag to make strong null safety the default.
- Flip flag to make strong null safety the default
- Remove code that auto detects null safety mode from source files,
  it is necessary to specify --no-strong-null-safety to opt out.
- Retains sniffing of AOT/JIT snapshots and kernel files to determine
  null safety mode, the opt out has to be done when generating these
  file.

TEST=ci

Change-Id: If2c9608eedb7c46d9c3cd85e261ee9640e0d28eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261140
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-06 04:04:23 +00:00
Joshua Litt
b493cdfc1b [dart2wasm] Add runner script to streamline running wasm in d8.
Change-Id: I0f891d28419d0df55f94e0229ff33e87b791e7d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273280
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-12-02 19:55:16 +00:00
Johnni Winther
50ac2500a1 [dart2js] Handle private names correctly in K/J-model
The library wasn't taken into account when handling computing class
members in the K/J-model and not handled correctly when computing
applicable selectors. This made dart2js unable to handle members with
a name private to a different library than the enclosing library.

Fixes #33732
Fixes #49226

Change-Id: I5ba143d87662bbd42e0ff02355054e4a937be8f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252665
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-08-11 06:56:32 +00:00
Janice Collins
822cd1cbd5 Remove dartanalyzer from built SDK.
Bug: https://github.com/dart-lang/sdk/issues/48457
Change-Id: Ic0d038299712989b8445859590ff870ce3bdc13a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249662
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-07-01 17:43:20 +00:00
Sigmund Cherem
69249df50b [web] remove top-level scripts for dartdevc and dart2js.
This completes the breaking change that was previously announced in
https://github.com/dart-lang/sdk/issues/46100

Change-Id: Ie81665e7932fe00a8c1fee9f67ee8294cd4c89e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248342
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2022-06-14 18:29:17 +00:00
Aske Simon Christensen
6c7604291c [dart2wasm] Build platform dill and compile dart2wasm to AOT snapshots
This adds a --platform= option to dart2wasm to read the SDK libraries
from that dill file instead of compiling them from source every time.
If the option is not given, the SDK libraries are compiled, like before.

Also adds a "dart2wasm" build target, which will build the dart2wasm
platform dill and compile dart2wasm to two AOT snapshots (with and
without asserts). The dart2wasm scripts in sdk/bin are updated to run
via these snapshots and use this platform dill.

This speeds up test runs for the dart2wasm-hostasserts-linux-x64-d8
configuration by approximately 45x.

Change-Id: If2c7750a6eb39725310745f887792784d0dfc583
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243624
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-05-10 10:06:06 +00:00
Sigmund Cherem
659459ba13 [dart2js] fix reference to package_config.json in helper script
This will allow to remove the `.packages` file from the bots. See
for reference Jonas change here: https://dart-review.googlesource.com/c/sdk/+/240842

Change-Id: Ic4ec8d6192533756e0c7642240eea918e790f67f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243360
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-05-02 16:57:54 +00:00
Mark Zhou
db513ecc8f Moving ReleaseARM64 earlier in candidate search order
Fixes some issues with resolving SDK build dirs on M1 Macs, as some of our tooling implicitly builds DebugX64.

Change-Id: Ia890bbe2b552be5eaa6207fc5f930c0b0e7c4ffa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239731
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-04-01 15:56:56 +00:00
Sigurd Meldgaard
4cd91b983b Reland "Reland "Remove the pub top-level""
This is a reland of 7bb6841815

Original change's description:
> Reland "Remove the pub top-level"
>
> This is a reland of 872ffa85c2
>
> Original change's description:
> > Remove the pub top-level
> >
> > The old pub toplevel interface is still reachable via
> >
> > ```
> >  $ dart __deprecated_pub
> > ```
> >
> > That is what `flutter pub` is using.
> >
> > Part of https://github.com/dart-lang/sdk/issues/46100
> >
> > Bug: https://github.com/dart-lang/pub/issues/3292
> > Change-Id: I97a14f2458d0f67c7bf98a90664d504cfaba0e98
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229541
> > Reviewed-by: Jonas Jensen <jonasfj@google.com>
> > Reviewed-by: Michael Thomsen <mit@google.com>
> > Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
>
> Bug: https://github.com/dart-lang/pub/issues/3292
> Change-Id: I45b5bf93f30c8abad4558cb15b61289c6c786f65
> Cq-Include-Trybots: luci.dart.try:flutter-engine-linux-try,flutter-engine-linux-web_tests-try,flutter-frontend-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231943
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Reviewed-by: Michael Thomsen <mit@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>

Bug: https://github.com/dart-lang/pub/issues/3292
Change-Id: I132e965a7097cf438dd90e04012a782eb5489798
Cq-Include-Trybots: luci.dart.try:flutter-engine-linux-try,flutter-engine-linux-web_tests-try,flutter-frontend-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234283
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2022-03-07 12:16:28 +00:00
Aske Simon Christensen
6faa5f3bd0 [dart2wasm] Initial commit for the Dart-to-WasmGC compiler.
This is work in progress. Several language features are still
unimplemented or only partially implemented.

Instructions for running the compiler and its output can be found in
pkg/dart2wasm/dart2wasm.md. These procedures are preliminary and
expected to change.

The best version of d8 to use for this version of dart2wasm is 10.0.40,
as explained here: https://dart-review.googlesource.com/c/sdk/+/232097

This commit also adds a dart2wasm-hostasserts-linux-x64-d8 testing
configuration to run the compiler over the test suite.

The history of the prototype that this is based on can be seen here:

https://github.com/askeksa-google/sdk/tree/wasm_prototype

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

Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175728
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-02-16 11:11:14 +00:00
Siva Annamalai
d858c6aa44 Revert "Reland "Remove the pub top-level""
This reverts commit 7bb6841815.

Reason for revert: Flutter rolls are failing, please see https://github.com/flutter/engine/pull/31332

Original change's description:
> Reland "Remove the pub top-level"
>
> This is a reland of 872ffa85c2
>
> Original change's description:
> > Remove the pub top-level
> >
> > The old pub toplevel interface is still reachable via
> >
> > ```
> >  $ dart __deprecated_pub
> > ```
> >
> > That is what `flutter pub` is using.
> >
> > Part of https://github.com/dart-lang/sdk/issues/46100
> >
> > Bug: https://github.com/dart-lang/pub/issues/3292
> > Change-Id: I97a14f2458d0f67c7bf98a90664d504cfaba0e98
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229541
> > Reviewed-by: Jonas Jensen <jonasfj@google.com>
> > Reviewed-by: Michael Thomsen <mit@google.com>
> > Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
>
> Bug: https://github.com/dart-lang/pub/issues/3292
> Change-Id: I45b5bf93f30c8abad4558cb15b61289c6c786f65
> Cq-Include-Trybots: luci.dart.try:flutter-engine-linux-try,flutter-engine-linux-web_tests-try,flutter-frontend-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231943
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Reviewed-by: Michael Thomsen <mit@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>

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

Bug: https://github.com/dart-lang/pub/issues/3292
Change-Id: Ie64d894efac2b5d686f470e2465819c74dd917ff
Cq-Include-Trybots: luci.dart.try:flutter-engine-linux-try,flutter-engine-linux-web_tests-try,flutter-frontend-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232131
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-02-09 01:59:36 +00:00
Sigurd Meldgaard
7bb6841815 Reland "Remove the pub top-level"
This is a reland of 872ffa85c2

Original change's description:
> Remove the pub top-level
>
> The old pub toplevel interface is still reachable via
>
> ```
>  $ dart __deprecated_pub
> ```
>
> That is what `flutter pub` is using.
>
> Part of https://github.com/dart-lang/sdk/issues/46100
>
> Bug: https://github.com/dart-lang/pub/issues/3292
> Change-Id: I97a14f2458d0f67c7bf98a90664d504cfaba0e98
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229541
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Reviewed-by: Michael Thomsen <mit@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>

Bug: https://github.com/dart-lang/pub/issues/3292
Change-Id: I45b5bf93f30c8abad4558cb15b61289c6c786f65
Cq-Include-Trybots: luci.dart.try:flutter-engine-linux-try,flutter-engine-linux-web_tests-try,flutter-frontend-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231943
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2022-02-07 14:12:57 +00:00
Sigurd Meldgaard
0e67d987a1 Revert "Remove the pub top-level"
This reverts commit 872ffa85c2.

Reason for revert: flutter needs fixes:
https://github.com/flutter/engine/pull/31181
https://github.com/flutter/flutter/pull/97575


Original change's description:
> Remove the pub top-level
>
> The old pub toplevel interface is still reachable via
>
> ```
>  $ dart __deprecated_pub
> ```
>
> That is what `flutter pub` is using.
>
> Part of https://github.com/dart-lang/sdk/issues/46100
>
> Bug: https://github.com/dart-lang/pub/issues/3292
> Change-Id: I97a14f2458d0f67c7bf98a90664d504cfaba0e98
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229541
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Reviewed-by: Michael Thomsen <mit@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>

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

Bug: https://github.com/dart-lang/pub/issues/3292
Change-Id: Ida7ae463a78ece7ff9e5aef3fc2ef984a4ac1b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231081
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2022-02-01 12:03:05 +00:00
Sigurd Meldgaard
872ffa85c2 Remove the pub top-level
The old pub toplevel interface is still reachable via

```
 $ dart __deprecated_pub
```

That is what `flutter pub` is using.

Part of https://github.com/dart-lang/sdk/issues/46100

Bug: https://github.com/dart-lang/pub/issues/3292
Change-Id: I97a14f2458d0f67c7bf98a90664d504cfaba0e98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229541
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2022-01-28 10:04:54 +00:00
Sigmund Cherem
93e87899f4 [ddc] delete unused/unsupported internal scripts to run ddc.
All internal development uses pkg/dev_compiler/tool/ddb instead

Change-Id: I1a3cd9cef48063be16b2aa0c3bcb950e4c2b248d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229305
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-01-27 21:13:41 +00:00
Sigmund Cherem
5173fd2d22 [ddc]: Deprecate public dartdevc scripts
Change-Id: I1fdb19e21b4d787090d98cd519e002efebac5e4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229304
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2022-01-27 21:13:41 +00:00
Michael Thomsen
208e7bc2e2 Remove dartdoc commands
Part of previously announced deprecation, see:
https://github.com/dart-lang/sdk/issues/46100

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

Change-Id: Ic3eaa793149da412b7520b154a0909ee59fbfb5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228647
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-01-27 08:12:00 +00:00
Sigmund Cherem
8415b70e75 [dart2js] recommend using 'dart compile js'.
This is the first deprecation step, moving towards having dart2js
under the more general dart command line interface.

Going forward 'dart compile js' is the recommended way to invoke
dart2js.

This CL adds:
* an internal flag used to detect how was dart2js invoked and
  provide a warning when invoked in an unsupported way.
* ensures the flag is provided in the dart cli, as well as our
  (developer's only) scripts. These scripts will likely move to a
  different location in the future. Note that the `dart2js_sdk*`
  scripts are not providing this flag (these are the script that get
  eventually shipped with our built SDK), as such, invokations of the
  dart2js binary will show the new warning.

Change-Id: I96e40ecf01598eadab20dfc59114f5fff7438084
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229062
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-01-21 16:42:40 +00:00
Michael Thomsen
d9b69e907e Add deprecation warnings
This merely ports the changes already made to the other analyzer binaries:
https://dart-review.googlesource.com/c/sdk/+/219702

Change-Id: If848b164eff7d9bf166734aaad437749e44b04a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229143
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2022-01-20 11:46:27 +00:00
Konstantin Shcheglov
fd0908dea4 Remove sdk/bin/dartanalyzer_developer.
Change-Id: I148ea995a94929b763ae0cfae0cc1a1af4d43933
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228683
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-18 20:34:15 +00:00
Michael Thomsen
370a9d7b78 Mark dartdoc deprecated
Mark the `dartdoc` command as deprecated.
It's being replaced by the `dart doc` command.

Part of https://github.com/dart-lang/sdk/issues/44610

Change-Id: Ia0607cb53ef526388a749acb735fd6145149334e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221948
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2021-12-06 15:47:17 +00:00
Michael Thomsen
7da2117892 Initial 'dart doc' developer command
Initial 'dart doc' command for the unified 'dart' developer tool,
over time replacing the exiting 'bin/dartdoc' tool.

This is a second attempt after the previous got reverted:
https://dart-review.googlesource.com/c/sdk/+/217980

The first attempt, which was already reviewed, is
in patchset 1.

Change-Id: Id9e0e572944ba032c32f3cebec579ab23d0df036
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220744
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-12-06 10:26:09 +00:00
Michael Thomsen
f7af5c5256 Deprecate dartanalyzer command
Change-Id: I8d2fb8a5dbac0f81c8cad770ccfb2e3bbf2b0880
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219702
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-11-09 13:23:42 +00:00
Robert Nystrom
b927288ed1 Remove "dartfmt" entrypoint from the SDK.
Change-Id: I32a9f95d7b22d3311767ba22c350f197592abcab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215300
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2021-10-04 18:40:57 +00:00
Sigurd Meldgaard
ae81cd5dab Deprecate top level pub.
Also makes the `pub` shell script (and its .bat counterpart)
forward to a `dart __deprecated_pub` command that implements the
old top-level.

This allows us to get rid of pub.dart.snapshot saving ~15 MB in a
unzipped sdk.

The reason for not forwarding directly to `dart pub` is that the
interface is slightly different (for example there is no `dart pub --version`).


The only new commit in pub is: `3c2ce330 Expose toplevel as a command`


Bug: https://github.com/dart-lang/pub/issues/2736
Change-Id: I6eb08d120c4844b3a12bc29544df6a868cd6fcc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210582
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2021-08-24 08:34:58 +00:00
Michael Thomsen
6c5fb84716 Discontinue dart2native (use dart compile)
TEST=Existing tests updated to use dart compile

Change-Id: Ia3478069df2354a3bf057fedae0f1eea9415de95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210241
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-08-23 20:53:09 +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
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
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
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
Sigurd Meldgaard
00b7040dc8 Remove obsolete dartfix build target and scripts
The package was deleted in 224a997a23

Bug: https://github.com/dart-lang/sdk/issues/43863
Change-Id: I599ea7b594365ef244550c90f50bab15d116c937
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170696
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2020-11-13 09:18:36 +00:00
Alexander Aprelev
cd6c7ed56c [win] Use find.exe from %SystemRoot%/System32 to avoid conflicts with cygwin find.
Fixes https://github.com/dart-lang/sdk/issues/21770.

Change-Id: If54923d6f636901c3c3170a014138d85cb6560e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158484
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-08-14 18:22:17 +00:00
Leaf Petersen
d44457f79d [Core Libraries] Eliminate the fork in the core libraries.
Move the nnbd core libraries from sdk_nnbd to sdk, and updates
references in build files and elsewhere accordingly.

Change-Id: I09760fe1e006657aacdfe80f3b22fdf6f7e30a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151121
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-06-16 23:37:36 +00:00
Martin Kustermann
e82fedc345 [vm] Remove deprecated (and untested) ARMv5 support from the VM
Since we have no CQ/CI test coverage of ARMv5 and none of our customers
uses it, a breaking change request was made (see issue further down).

The breaking change has been approved and a corresponding email has been
sent out:

https://groups.google.com/a/dartlang.org/forum/?nomobile=true#!topic/announce/vRQja7di3FQ

This CL removes any armv5 related code from our codebase.

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

Change-Id: I9abf32f1980ca19a9cf882b43c9966b2127f89e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122540
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-23 14:44:33 +00:00
Clement Skau
0cada76a06 [SDK] Removes dart2aot.
Bug: https://github.com/dart-lang/sdk/issues/38834
Change-Id: Iff1247186271643ea557a0aaec1e6b8438676c59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121706
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-15 17:53:38 +00:00
Keerti Parthasarathy
6d468d1377 Add a script and target to run dartfix
Change-Id: I68df635359b898ef4b6054292f6523d81f46448a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121149
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-10-14 15:50:21 +00:00