Commit graph

496 commits

Author SHA1 Message Date
MarkZ 91d22a7e40 [ddc] Renaming dart_library.js to ddc_module_loader.js
This also removes deprecated references to the DDC module system as the "legacy" module system.

This is part of an ongoing effort to deprecate the AMD module system: https://github.com/dart-lang/sdk/issues/52361

Change-Id: Ic32c6c6a0b7bf2c3bf0326be42cc9a88db8e303e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348183
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-01-30 19:43:49 +00:00
William Hesse 74672eca0a [dart2wasm] Fix jsc path in testing support for jsc
The CIPD download puts the platform-specific executable for jsc
(JavaScriptCore) directly in the third_party/jsc directory.

Follow-up to https://dart-review.googlesource.com/c/sdk/+/347283

Bug: b/322134579
Change-Id: I6af151de10e28fee06f6ba64a288f12859516151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348642
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: William Hesse <whesse@google.com>
2024-01-26 13:31:00 +00:00
MarkZ 8edbcacfb0 [ddc] Removing some references to "legacy" DDC modules.
"DDC" is now the accepted name for the module system.

Change-Id: I655219ccc7cff7ff99b1311518ef6ed6e7d1b2a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348085
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-01-24 21:22:25 +00:00
Martin Kustermann 89060a64e9 [dart2wasm] Make dart compile wasm pass through -D & --minify flags to dart2wasm
This also fixes some code that was assuming the args parser returns
`Map<String, String>` for the `--define` multi-option, it's rather returning
a `List<String>`.

Forwarding these two flags will allow running some of our configurations
using `dart compile wasm` as opposed to
`pkg/dart2wasm/tool/compile_benchmark` (though the former is still
slower than the ladder).

Though since `dart compile wasm` is still a bit slower then the shell
script, we'll do that only for one configuration.

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

Change-Id: I74e9edb2f635f48faade8d843857be2aa7c6066f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347903
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-24 14:38:41 +00:00
Martin Kustermann 6788b733f3 [dart2wasm] Make dart compile wasm use AOT-compiled dart2wasm via subprocess
This reduces time for `dart compile wasm` on a hello world in

* `--no-optimize` mode from 8.2 to 1.8 seconds (0.6 sec via [0])
* `--optimize` mode from 9.2 to 3 seconds (1.6 sec via [0])

[0] pkg/dart2wasm/tool/compile_benchmark

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

Change-Id: I47093e747f343b542bc7faa34e102c62657c7b81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347902
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-24 13:20:15 +00:00
Martin Kustermann 3a314331a7 [dart2wasm] Add support for testing dart2wasm with JSC
JSC only supports `print()` but not `console.log()`.

=> The changes to `printToConsole()` are therefore extended
to check for `console.log()` as well as `print()`.
=> This is extending it to a broader subset of dart2js's print

Change-Id: I7efa697477aa60e473d01716b104fc1526035c67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347283
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-22 12:04:37 +00:00
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
Daco Harkes ae5db20deb [deps] Roll native_assets_cli to internal import
https://dart-review.googlesource.com/c/sdk/+/346761 can't land,
because then flutter_tools in g3 breaks.
flutter_tools in g3 can't be forwarded because
https://github.com/dart-lang/native/pull/886 isn't in g3 yet.

Landing https://github.com/dart-lang/native/pull/886 in g3
should work, because it shouldn't break flutter_tools.

Change-Id: Ida60ed22093ace535c00114fc8b088ba2100eb1a
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-win-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346960
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-18 12:50:21 +00:00
David Morgan 435cee17b7 [test] Skip chrome Gnome keyring, KDE wallet.
Prevents a popup on chrome start on my cloudtop; see:
https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md#chromium-annoyances

R=sortie@google.com

Change-Id: I3f1def07bb940dd8930f5b2eed81053c24775197
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346320
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-01-15 13:01:54 +00:00
Paul Berry 355d7e02fc Stop testing nnbd-weak and nnbd-legacy on analyzer.
After discussion with Siggi about
https://dart-review.googlesource.com/c/sdk/+/341020 (which removed a
lot of mixed-mode tests from the language test suite), we've decided
that these tests are worth keeping around, because they exercise
important "weak mode" runtime functionality on the web platform, and
weak mode is still used inside google3.

However, we would like to unblock removal of legacy support from the
analyzer (because this is _not_ used inside google3 anymore, and
there's a nontrivial cost to maintaining it). So, to ensure that
removing legacy support from the analyzer doesn't cause test failures,
we need to stop running these "weak mode" tests on the analyzer
platform.

The test runner already has the ability to recognize these tests and
skip them; it recognizes them by the comment `Requirements=nnbd-weak`
at the top of the test. We simply need to instruct the test runner not
to run these tests on the analyzer platform anymore.

This CL also disables running of `Requirements=nnbd-legacy` tests on
the analyzer. No such tests exist anymore, but since support for this
requirements comment still exists in the test runner, it makes sense
to include it in the effect of this CL.

Change-Id: Ib5d5eb7c1bf879581b21fa5093fa7fa6304005a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342080
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-12-19 02:19:39 +00:00
Ben Konyi f6205e0013 [ test matrix ] Run package:vm_service tests on VM configurations
Change-Id: I69eb125f0df46bdc3be65b99985bfcdaa0d51bfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337300
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-12-08 15:58: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
Ryan Macnak 09da512b67 [vm] Consistently apply --target_unknown_cpu to AOT compilation.
- Fixes new AOT snapshots in the SDK failing with SIGILL in ARM environments that don't support the integer division instructions.
 - Likewise fixes snapshot generated by `dart compile exe`.

TEST=local QEMU
Bug: https://github.com/dart-lang/sdk/issues/54198
Change-Id: Ifb998ced4e900a64ef02a464903a50954f6e0699
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339104
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-11-30 23:44:50 +00:00
Ryan Macnak bd5df6da60 [build] Enable building riscv64 with clang.
Change-Id: Ie09d92a4e23484b7c6d2963bb0d327e443a68e46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338641
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-11-30 18:09:49 +00:00
Ryan Macnak 9efab8cc7b [infra] Upload libc etc along with coredumps.
The locally available libraries will usually be a different versions than the libraries on the bots.

Change-Id: Ic1f954346e2ca7b5563b2a9f20f4c466d1f4f16a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338425
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-11-29 17:00:52 +00:00
Martin Kustermann 6e771a1ce9 [dart2wasm] Make tools/test.py -n dart2wasm-linux-jsshell ... work
Change-Id: I0a2678a5b141ab52597860380df7d44fd1f1db74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338381
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-11-27 15:51:55 +00:00
Ryan Macnak c1143082fe Include ARM64 when uploading d8.
Change-Id: I613ca948734a849c43f6f6d02cfd678d18fe7e03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336200
Reviewed-by: Alexander Thomas <athom@google.com>
2023-11-21 17:15:20 +00:00
Robert Nystrom 2ee771a4f6 Remove the legacy "_2" tests. \o/
I also cleaned up a bunch of places that referred to them.

Change-Id: I45f68818c892f8620ea04257885ffa3763374bb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335863
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-11-17 20:17:23 +00:00
Lasse R.H. Nielsen 5543293a16 Reland "Expire 3.0.0 experiment flags."
This is a reland of commit 6f29e7fce4

Original change's description:
> Expire 3.0.0 experiment flags.
>
> TEST=Existing tests covers.
> Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

TEST=Existing tests covers.
Change-Id: I384e77744c74774a250be413358a7fa176117167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332684
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-11-17 13:10:01 +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
Devon Carew 6917656134 [pkg] remove duplicate config from the analysis options files
Change-Id: I149a97bbe260600a3de664b28c4d212dd9adb889
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335862
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-11-14 00:37:53 +00:00
Sigmund Cherem 95738fa095 [infra] increase timeout for loading the sdk in ddc.
This increases the timeout from 30 to 45s when using require.js.
We noticed that many tests (>50) flake on firefox due to this timeout,
so we hope that adding a bit of extra time may help reduce the
likelyhood of tests flaking for this reason.

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

Change-Id: I3dd952d5dd42c8644f96a636df9a7cd486312ad6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335503
Auto-Submit: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-11-11 00:56:49 +00:00
Jacob Richman 933537b66b Trivial cleanup to make VSCode workspace for the SDK
free of diagnostics as long as you filter with "!TODO"

R=athom@google.com, jensj@google.com, natebiggs@google.com

Change-Id: I73cf3c5ef6dab81808330c4eb5f44cb62e753c81
Tested: manually verified that VSCode is warning free. No changes in functionality.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333903
Auto-Submit: Jacob Richman <jacobr@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Jacob Richman <jacobr@google.com>
2023-11-07 17:49:53 +00:00
Sigmund Cherem 2cb00aad5c [infra] allow to specify arch twice.
A recent change: https://dart-review.googlesource.com/c/sdk/+/333842
fixed a check in the test runner. The check fails when a flag
is provided to test.py but it is also implied by the configuration
name.

However, The web macos bots currently need to specify the arch flag,
even though it is implied by the named configuration. Without doing so
the sharding infrastructure seems to fail to assign the correct
architecture for the spawn bots.

This CL temporarily allows to continue specifying this flag to keep the
bots running. Ideally we should follow up with a infrastructure fix
to ensure this flag is not needed in the future.

This is being tracked in https://github.com/dart-lang/sdk/issues/53948

Change-Id: Ifba6a8924cbca9f3aca38933113abb168ff405d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333705
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-11-03 17:47:17 +00:00
Vyacheslav Egorov 7d898f2a84 [infra] Allow overriding named configuration options
When doing local testing of AOT configurations I need to
manually override use-elf property to shorten cycle time.

Currently this can only be done by editing test_matrix.json,
this CL adds a capability to achieve the same by defining
TEST_CONFIGURATION_OVERRIDES environment variable.

I also fix some incorrect checking code which never triggered before:
if you try (via CLI flag) to override an option which is already
defined by a selected named configuration you should get an error.

Change-Id: Ie9b7fa12bd441814ca662e7e820c4aa739471c22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333842
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-11-03 13:39:39 +00:00
Ryan Macnak 573fad4ff0 [test] Cleanup building Fuchsia packages/components.
Build one package with three elf_test_runner components: one for each of the binaries that the test harness invokes on the target. (Though currently only tests that use "dart" are setup.)

Create includable CML shards for the capabilites required by the AOT and JIT VMs.

Fold test_runner's fuchsia_cfv2.dart back into fuchsia.dart.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/38752
Change-Id: I7bd8d43d184cbcb11903c7aed77ce31fb30cb894
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332451
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zijie He <zijiehe@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-10-31 17:11:51 +00:00
Ryan Macnak 4fa5cadb36 [test] Switch Fuchsia testing to CFv2.
Bug: https://github.com/dart-lang/sdk/issues/38752
Change-Id: Id6519937cfa8430249d576c99aeb6bdb9f97dbb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332481
Reviewed-by: Zijie He <zijiehe@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-10-30 20:03:40 +00:00
Alexander Aprelev 6a464c9dee Revert "Expire 3.0.0 experiment flags."
This reverts commit 6f29e7fce4.

Reason for revert: broke g3 bot

Original change's description:
> Expire 3.0.0 experiment flags.
>
> TEST=Existing tests covers.
> Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Change-Id: Ied6f612dc922824ffdadc4660898f3b859922ff5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332582
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Alexander Aprelev <aam@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-10-27 16:50:09 +00:00
Lasse R.H. Nielsen 6f29e7fce4 Expire 3.0.0 experiment flags.
TEST=Existing tests covers.
Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-10-27 13:57:00 +00:00
Nicholas Shahan 6bafe2fbf7 [dart2js] Seal Object prototype in browser tests
Ensures there is no dependency on modifying the native JavaScript
Object prototype by preventing modifications when running browser
tests.

Change-Id: Ifb22018736f90b339b9c60bbab095fb3e1c483e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320842
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-10-26 17:00:21 +00:00
Jens Johansen cfd04d3b51 [test_runner] First batch test after compiler launch gets more timeout
The first test being compiled on a batch compiler pays for the cost of
the batch compiler startup, meaning it is more likely to time out, e.g.
see https://github.com/dart-lang/sdk/issues/53672.
E.g via
`tools/test.py '--progress=status' --report --time --write-results --write-logs --clean-exit -ncfe-strong-linux service/next_...`

I get output like this:
```
0:00:37.713771 - fasta - fasta-none release_x64/service/next_through_simple_linear_test/service
0:00:37.682524 - fasta - fasta-none release_x64/service/next_through_for_loop_with_break_and_continue_test/dds
0:00:36.805734 - fasta - fasta-none release_x64/service/next_through_create_list_and_map_test/service
0:00:36.589329 - fasta - fasta-none release_x64/service/next_through_simple_linear_2_test/dds
0:00:36.586428 - fasta - fasta-none release_x64/service/next_through_simple_linear_2_test/service
0:00:36.518832 - fasta - fasta-none release_x64/service/next_through_for_each_loop_test/dds
0:00:36.407107 - fasta - fasta-none release_x64/service/next_through_create_list_and_map_test/dds
0:00:36.259945 - fasta - fasta-none release_x64/service/next_through_for_each_loop_test/service
0:00:36.211573 - fasta - fasta-none release_x64/service/next_through_call_on_field_in_class_test/service
0:00:36.189456 - fasta - fasta-none release_x64/service/next_through_call_on_field_in_class_test/dds
0:00:35.974007 - fasta - fasta-none release_x64/service/next_through_for_loop_with_break_and_continue_test/service
0:00:35.921138 - fasta - fasta-none release_x64/service/next_through_simple_linear_test/dds
0:00:09.690812 - fasta - fasta-none release_x64/service/next_through_multi_catch_test/service
0:00:09.562068 - fasta - fasta-none release_x64/service/async_next_test/service
0:00:09.530882 - fasta - fasta-none release_x64/service/next_through_operator_bracket_test/dds
0:00:09.407169 - fasta - fasta-none release_x64/service/next_through_function_expression_test/dds
0:00:09.366673 - fasta - fasta-none release_x64/service/next_through_multi_catch_test/dds
0:00:09.327895 - fasta - fasta-none release_x64/service/next_through_function_expression_test/service
0:00:09.303926 - fasta - fasta-none release_x64/service/next_through_await_for_test/service
0:00:09.236295 - fasta - fasta-none release_x64/service/next_through_simple_async_with_returns_test/dds
```

where the first 12 (the really slow ones) each is the first test being
run on that particular batch compiler, where they both pay for the
startup cost of the batch compiler (~12 seconds on my machine when
launching 12 simultaneously which is the default on my machine -- it's
probably more on the bots) and for the jit not having warmed up yet:
E.g. the first test compiles in ~22 seconds, the second in ~9 seconds,
the third in ~6 seconds on my machine (again with 12 simultaneous runs).

To make it less likely that the first compile times out this CL adds
some extra time allowance for the first run after the bulk compiler is
started. For now it's 30 seconds, but it can be adjusted if needed.

Longer term we should probably start a batch compilation test by
aot-compilng the batch compiler (which, at least currently,
doesn't support asserts
(https://github.com/dart-lang/sdk/issues/53343)
which is unfortunate).
I'll leave that for a future CL.

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

Change-Id: Id3427223c46c1e7a34b401097a3f7d5f1321ad93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332220
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-10-25 11:09:38 +00:00
Zijie He 19bee4c09b [Fuchsia] Really running cfv2 test
Though it's still failing, the test-script integration has pretty much
finished.

```=== 298 tests passed, 40 failed ===```

Errors are mainly

```
Exhausted heap space, trying to allocate 32 bytes.
../../runtime/vm/object.cc: 2854: error: Out of memory.
```

This change requires https://crrev.com/c/4913284 and
`"fuchsia_sdk_version": "version:15.20231007.2.1",`
in DEPS.

Bug: #38752
Change-Id: I92a387f4289fce7d05d84e483560729301541c1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330025
Commit-Queue: Zijie He <zijiehe@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-10-20 17:08:31 +00:00
Ryan Macnak 99bb8aa4a5 [build, test_runner] Update to NDK 27.
Notably, this carries us across the gcc->llvm transition.

Change-Id: I46203749c64c7ef0f52de40abcd4a073517cb06f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330949
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-10-18 22:38:23 +00:00
asiva 9b521df35f [VM/Tests] Remove dart_2 and standalone_2 test directories
- Remove test directories standalone_2 and dart_2
- Remove all references to standalone_2 and dart_2 in test scripts

TEST=ci

Change-Id: I574868e274558efbbe12fe8b6408bbe77a888583
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330982
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-10-18 18:59:51 +00:00
Ryan Macnak 846654fca4 [test_runner] Account for cross builds from ARM64.
Change-Id: I382f25375f097066b6f3b0836da6871b993ca62f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330942
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-10-18 14:32:16 +00:00
asiva e0fa7f9d0f [VM] Remove observatory_2 directory and all references to it.
TEST=ci

Change-Id: I4e95e59fc909c01517ae59f39d04c38bb353b85a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330525
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-10-16 17:45:46 +00:00
Ryan Macnak 985c292cff [vm, ffi] Add Windows ARM64 to FFI unit tests.
This accepts the current results, including known bugs in handling of variadic arguments. Fixes are in a follow-up CL.

TEST=ci
Change-Id: I6a0bd11aeb1fe0a6980dd6ff974dc5a4b207fb97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329824
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-10-11 18:41:57 +00:00
Ryan Macnak 6ad59501fd [test] Remove extra timeout multiplier for Linux ARM64.
Bug: b/302156166
Bug: https://github.com/dart-lang/sdk/issues/52589
Change-Id: I9470dc13d3f41bf7f5e77c4168efeec7d17e9263
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329564
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-10-10 16:42:19 +00:00
Sigmund Cherem 6f090565aa [test_runner] include error stack in window.onerror if available.
According to the [Window.onerror MDN docs][1] an error object may be
provided as a 5th argument. This error object can be used to extract a
stack trace with more context about the error message.

[1]: https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event

With this change, we can get a more precise error on uncuaght exceptions.

This is an example of a before and after on a unit test failing in
ddc-chrome-linux.

Before:

```
  Runtime window.onerror:
  window.onerror called:

  http://127.0.0.1:46235/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:5082:
  Uncaught Error
```

After:

```
  Runtime window.onerror:
  window.onerror called:

  http://127.0.0.1:46235/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:5082:
  Uncaught Error
  Error: Expected a value of type 'FutureOr<FileSystem>?', but got one of type 'LegacyJavaScriptObject'
      at Object.throw_ [as throw] (http://127.0.0.1:46235/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:5082:11)
      at Object.castError (http://127.0.0.1:46235/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:5041:15)
      at Object.cast [as as] (http://127.0.0.1:46235/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:5385:19)
      at dart.NullableType.new.as (http://127.0.0.1:46235/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:7243:60)
      at _AsyncCompleter.new.complete (http://127.0.0.1:46235/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:31216:28)
      at http://127.0.0.1:46235/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:99073:19
```

Change-Id: If89c253d8e6edee9b7102269466b40b605951a6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328804
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-06 00:58:54 +00:00
Sigmund Cherem efc62a838e [test_runner] fix bug in regexp in stack trace deobfuscation
This logic is responsible for creating a readable deobfuscated stack
from ddc and dart2js JavaScript stack traces. The logic was removing the
query parameter of URLs, but accidentally matched multi-line strings and
applied the regexp in invalid contexts (like the error message itself).
Excluding `\n` from the regexp pattern prevents this issue.

Example input (obfuscated error):
```
window.onerror called:

http://127.0.0.1:35679/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:5082:
Uncaught Error
Error: Expected a value of type 'FutureOr<FileSystem>?', but got one of type 'LegacyJavaScriptObject'
    at Object.throw_ [as throw] (http://127.0.0.1:35679/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:5082:11)
    at Object.castError (http://127.0.0.1:35679/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:5041:15)
    at Object.cast [as as] (http://127.0.0.1:35679/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:5385:19)
    at dart.NullableType.new.as (http://127.0.0.1:35679/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:7243:60)
    at _AsyncCompleter.new.complete (http://127.0.0.1:35679/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:31216:28)
    at http://127.0.0.1:35679/root_build/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:99073:19
```

Example deobfuscation before (see truncated error and first frame was dropped accidentally):
```
window.onerror called:

out/ReleaseX64/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:5082:
Uncaught Error
Error: Expected a value of type 'FutureOr<FileSystem>:5082:11)
    at Object.castError             ../../../../../../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 127:3
    at Object.cast                  ../../../../../../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 818:12
    at dart.NullableType.new.as     ../../../../../../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart 425:9
    at _AsyncCompleter.new.complete ../../../../../../dart-sdk/lib/async/future_impl.dart 42:31
    at <fn>                         ../../../../../../dart-sdk/lib/html/dart2js/html_dart2js.dart 33424:16
```

but after (error and first frame recovered):
```
window.onerror called:

out/ReleaseX64/gen/utils/ddc/stable/sdk/amd/dart_sdk.js:5082:
Uncaught Error
Error: Expected a value of type 'FutureOr<FileSystem>?', but got one of type 'LegacyJavaScriptObject'
    at Object.throw_                out/ReleaseX64/gen/utils/ddc/stable/sdk/amd/dart_sdk.js 5082:11
    at Object.castError             ../../../../../../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 127:3
    at Object.cast                  ../../../../../../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 818:12
    at dart.NullableType.new.as     ../../../../../../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart 425:9
    at _AsyncCompleter.new.complete ../../../../../../dart-sdk/lib/async/future_impl.dart 42:31
    at <fn>                         ../../../../../../dart-sdk/lib/html/dart2js/html_dart2js.dart 33424:16
```

Change-Id: Id9f37efe9bdacc63aae3b24ebe0602a8ea7cf8fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328765
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-06 00:35:57 +00:00
Devon Carew e2fe203adc [deps] roll package:lints to the latest
Change-Id: I582f956cd4b712203c2f6dd630b4e1384040446d
Tested: analysis clean (this is a lint only related change)
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329400
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-10-05 03:36:59 +00:00
Zijie He a46ac84206 [Fuchsia] Allows FuchsiaEmulatorCFv2 to start daemon and emulator
This change updates the FuchsiaEmulatorCFv2 to start the daemon and
emulator before executing the tests.

Meanwhile, instead of "dummy", this change uses "echo" as the dummy
command to allow
`FUCHSIA_CFV2=1 tools/test.py --progress=status
-nvm-fuchsia-release-x64 ffi`
running.

This change requires
`"fuchsia_sdk_version": "version:15.20230909.2.1",`
in DEPS to function, which isn't included due to the CFv1
implementation currently running.

Bug: #38752
Change-Id: I5011b6ff39b73955002431650d973d6adcfa6246
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328766
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-10-03 22:56:39 +00:00
Alexander Thomas 9394b30b77 Fix incorrect file reference in license headers
Bug: b/286184681
Change-Id: I903528c4adfbc576644aec7541903df6b9633e26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325523
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-09-18 06:44:08 +00:00
Ryan Macnak 139ff289db [vm, compiler] Allocation canaries.
Before each allocation, check the memory hasn't been touched since page initialization. This more reliably detects the issue fixed in a4381f127c.

TEST=ci
Change-Id: I5c0ed0a18a32515eab2ae90110b5a7e7f48779dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325366
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-09-15 17:04:55 +00:00
William Hesse 8f556fcb8f [test] Disable Chrome event throttling in background tabs while testing
Timer events and perhaps other events are throttled when a Chrome tab
is in the background or not visible. This may be causing flaky timeouts
in Dart web tests that rely on many timers. In local testing, these
flags completely eliminated the problem.

IntensiveWakeUpThrottling is a web standard feature, and
TimerThrottlingForBackgroundTabs is a Blink-specific feature.

Bug: https://dart-review.googlesource.com/c/sdk/+/324203
Change-Id: I38904015b043768689be3a05bea5a50ad32df434
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325780
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-09-13 17:55:38 +00:00
Zijie He 5282f6e33f [Fuchsia] Create CFv2 support
This change created a CFv2 build target and provided two
implementations of the FuchsiaEmulator, so that I can continually work
on both CFv2 build and test script integration independently.

The v2 target can be built with
```
tools/build.py --os fuchsia --mode release fuchsia_ffi_test_package_cfv2
```
And v2 FuchsiaEmulator implementation can be triggered with
FUCHSIA_CFV2 environment variable.

Bug: #38752
Change-Id: I31936a2ca967fbfeb2bc5628e2f005aef6762687
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322583
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
2023-09-12 01:40:52 +00:00
Ömer Sinan Ağacan 5865e6db9f [dart2wasm,smith] Add options support in test_matrix.json, jscm builder
- Add dart2wasm_options syntax to test_matrix.json.

- Add a new builder for the JavaScript compatbility mode
  (`--js-compatbility`).

Change-Id: I32642e932f1d4a8a74b5b75f7783117520d51f02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322281
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-09-11 10:50:22 +00:00
Nicholas Shahan 3a65ac91f1 [ddc] Cleanup old "dartdevc" build targets
Use the new "ddc" targets everywhere and delete
the old targets.

Change-Id: I89d3351006a2c3eb0d1b9d526b868cbb676dce6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315561
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-08-29 21:33:48 +00:00
Ryan Macnak 708f098c4f [vm, compiler] Add option to suppress obfuscation of type names for some hierarchy.
This behaves like applying @pragma("vm:keep-name") to the hiearchy.

TEST=ci
Bug: b/285175418
Change-Id: Ibd543d294bebbfbb60f4e5d62d5e83f3aec841e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322582
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-25 18:55:32 +00:00
Zijie He 21ae9657a9 [Fuchsia] Import test scripts from chromium and use it to download image
The with_envs.py works with the test script by providing the required
environment variables.

This change in theory does nothing since the `product download` is in
12.20230413.0.1, but `run` is removed before that,
https://fxrev.dev/831319. So the DEPS cannot really download the images.
The issue will be addressed in a coming change.

Bug: #38752
Change-Id: Ib5f3d1d619921651208fa442201ba607a99e54d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319867
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
2023-08-22 19:59:25 +00:00