Commit graph

7020 commits

Author SHA1 Message Date
Daco Harkes 29a3e27e6f [tests/ffi] Switch over Android & QEMU to nnbd tests
This CL switches over the bots that are manually configured to
run the `ffi_2` test suite to the `ffi` test suite instead.
This changes these tests from legacy to nnbd mode.
The suites being converted are the Android and QEMU FFI tests.

This CL does _not_ switch over the bots that run the default suites.

This CL also skips all FFI tests that use the Dart API symbols on
Windows precompiled. These tests will never work in that mode and
should be skipped instead.

Analysis of FFI test bots: go/dart-ffi-legacy-test-turndown

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

Change-Id: I4e21ad5a036b83d8240fc662ed1c159305f2e297
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-product-arm-try,vm-ffi-android-product-arm64c-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64c-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-precomp-ffi-qemu-linux-release-riscv64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277521
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2022-12-27 15:18:59 +00:00
Nicholas Shahan b84aa5a7f9 [ddc] Cleanup uses of ignored cli args
The `-k`, `--kernel`, and `--dart-sdk` flags are ignored by DDC.

Change-Id: Ic2bf5c87a26cab7dcbcfeafa39dae1ea1b20c711
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277180
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-12-22 21:50:08 +00:00
Nicholas Shahan b9469f452a [ddc] Always explicitly pass null safety mode
Add explicit mode flags for DDC related compiles.

Change-Id: Icb9e21a4b8786a0de620bcc387cafbe8d27d0e86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277042
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2022-12-21 23:35:45 +00:00
Kallen Tu 9c8749db96 [analyzer/cfe] Add an experiment flag for class modifiers.
Flag for 'base', 'final', 'interface' and mixin classes.

Change-Id: I51037678826527a36b6dae731f43c8f36fead215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276765
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-21 21:44:32 +00:00
Srujan Gaddam 27b4e28495 [dart:html] Rename emitters and regenerate dart:html
emitter is a module name, so we use a different name here to avoid
a collision when using the module name. This CL regenerates dart:html
after accounting for https://dart-review.googlesource.com/c/sdk/+/276560.

Change-Id: I1c9d3a54a5f37a5e42cd5b79bbc3d635b98c198e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276763
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-12-21 17:26:48 +00:00
Josh Soref b48dc3af7a Spelling tools
Closes https://github.com/dart-lang/sdk/pull/50773

GitOrigin-RevId: 8f729bf80cce3c39b788a61591f14db234297186
Change-Id: I5a07bf96a2f8920560983fda504000c39e598e05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276560
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-12-21 17:26:48 +00:00
Erik Ernst b7d998d372 Add missing metadata in partDeclaration of Dart.g
Bug: https://github.com/dart-lang/sdk/issues/50776
Change-Id: I3c81a675ca883d39e617d7eb5c71cce9c7b03562
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276640
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-12-20 09:52:53 +00:00
Lasse R.H. Nielsen 2274ce9b05 Retire experiment flags introduced in 2.18.
Change-Id: I660bbf09c758f88589a10b0334ddd34c0620460d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275244
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
2022-12-15 13:18:50 +00:00
Erik Ernst ba5f8da95d Update Dart.g to match the current pattern feature spec
This CL changes the Dart grammar in Dart.g such that it contains all
the grammar changes applied to the patterns proposal since the previous
update of Dart.g.

Change-Id: I9b5f0d9a092d30ce0055db99da5fdbe3b9b1d5dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275002
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-12-13 12:56:01 +00:00
Johnni Winther aa51913101 Rename 'views' experimental flag to 'inline-class'
This feature is about to be renamed from Views to Inline Classes and
we adjust the flag name accordingly. The rename PR hasn't landed yet,
but we update the flag now to unblock work on co19 tests.

Change-Id: Ib6981b99f8541ed75f3315059a8bbca02f3a4579
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275000
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
2022-12-12 22:22:39 +00:00
Michael Thomsen c9a3327c26 Tweak experiment wording
Change-Id: Ic86ab50f62d26d42d10cfcb314e06c6f5292747e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273840
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-12-10 12:15:47 +00:00
Brian Wilkerson dfe5194278 Remove some unnecessary ignore comments in tools
Change-Id: I7ee823a38e9fca09f1c2b0e5e77078c21c72251d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274733
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-10 05:01:50 +00:00
Srujan Gaddam 74bfe6c244 Add bindings emitter for web libraries
Adds a generator that reads the platform libraries dill and outputs
maps that correspond to the various bindings e.g. `@Native` values
that exist in the web libraries. These maps will be consumed during
the analyzer run for lints.

Change-Id: I5b5bf91ff0e32964b97c9e52be414ec84ff88765
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272720
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2022-12-09 19:23:31 +00:00
Sigmund Cherem c91b73eaf7 [3.0 alpha] Remove dart:html's deprecated document.registerElement & registerElement2 APIs
Change-Id: I07fc124c55d1aeb678f39a4d72d3b4f581025a10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273541
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-12-09 16:02:02 +00:00
Aske Simon Christensen fd12e2e4ae [benchmark] Test dart2wasm benchmark invocations.
Bug: b/260206997
Change-Id: I49e225d8420fc5b5c0123736d0d8069d4cecd108
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273842
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-12-08 11:56:56 +00:00
Sigmund Cherem e8906e65e7 [3.0 alpha][dart2js] No longer infer the null-safety mode from sources.
This prepares dart2js to default to sound null safety in Dart 3.0.

The compiler no longer infers the default mode based on the input
program, instead uses sound null safety unless
'--no-sound-null-safety' is specified.

On a separate change, we expect to remove the option of disabling
null safety.

Note: this change should also be reflected in the CHANGELOG, but
we've currently not included it to redeuce merge conflicts, as we plan
to land multiple 3.0-alpha changes in a short window of time

Change-Id: Id87498cc5976548ec89d1f36c60674b72406950a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270860
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-12-07 04:02:13 +00:00
asiva e70e2bc1b7 [Dart 3.0 alpha] Fix some test issues (legacy mode argument not passed in)
TEST=ci

Change-Id: Iebb31a509b99837e41cf3823ca366c1560777af6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273920
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-12-06 19:34:47 +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
Alexander Thomas 7e0d92d69d [3.0 alpha] Bump version to 3.0.0
Tested: Standard CQ.
Bug: https://github.com/dart-lang/sdk/issues/49529
Change-Id: I329b9940db7309c7e48f17eecd7a66d5b853a484
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271922
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-06 02:40:36 +00:00
Sigurd Meldgaard a890972aee Filter '#' characters from log in tool/manage_deps.dart
Change-Id: Icac7b594a942787477beda2979eb0e427d8dcece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273780
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-12-05 15:10:30 +00:00
Alexander Thomas 484c79bdd6 [spec_parser] Add OWNERS
Change-Id: Ie0946865371d9e35de0fff1c972732f96ea09e8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272662
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-11-30 14:01:10 +00:00
Sergey G. Grekhov 2d618d9734 [spec_parser] Allow negative numbers and symbols in a constant patterns
Change-Id: Idd0aaec42e1a92f57515dbb6bda27f1011c7d77d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272782
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-11-30 11:41:41 +00:00
Sergey G. Grekhov b1949bfa1f [spec_parser] Change logical pattern rules to '||' and '&&'
Change-Id: I0f973090b6fab0be0f9c774636b3cc4248dc2c22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272362
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-11-28 14:23:34 +00:00
Jonas Termansen d2d4ae0b61 [benchmark] Test --no-sound-null-safety on legacy web benchmarks.
Bug: b/241766173
Change-Id: I83b132fe1b7832d0520391a94d346d26db4f3766
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271101
Reviewed-by: William Hesse <whesse@google.com>
2022-11-23 11:52:02 +00:00
Ahmed Ashour 9bea89246a Fix grammar
Fixes #50509

TEST=ci

Change-Id: I7ca115bbe6f436e9df126afddcc08eaba79af2f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270740
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-21 20:07:29 +00:00
Alexander Thomas ae1ed9e469 [infra] Remove bullseye-updates from dockerfile
This made the docker build work for me locally. The "updates" list was
probably needed on jessie but isn't needed on bullseye anymore.

Change-Id: I88f257b928f6ef690dac9e7d450eaa4c2ea12b2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271102
Reviewed-by: William Hesse <whesse@google.com>
2022-11-21 12:43:36 +00:00
Alexander Thomas bc48c17c22 [infra] Upgrade Debian package builder to Bullseye
Change-Id: I21e1d01d3acb7d780294fd5cabf75da9dcebd32e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271080
Reviewed-by: William Hesse <whesse@google.com>
2022-11-21 10:49:32 +00:00
Erik Ernst f92206f682 Change pattern rules (rename extractor->object, add metadata)
This CL changes the spec parser grammar, Dart.g, such that its pattern
related rules correspond to the recent updates in the patterns feature
specification.

Change-Id: I8d07cdb4c7ce22e0625da5bc8224ca2cf57af095
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268920
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-11-16 17:56:11 +00:00
asiva 41a7bb964d [OWNERS] Fix VM owners file entries.
TEST=none
Change-Id: I976ba4243c8df005cf1ccdb24f313b70ab603c83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269340
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-11-11 20:25:03 +00:00
Kallen Tu 63b49dfc8e Deprecate checkValidIndex and avoid using it in the core library.
TEST=No new behaviour, existing tests pass.

Change-Id: Ia7a8e58543bd5e1d8dd14bd46c5083759333845b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259104
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-11-08 19:02:35 +00:00
Kallen Tu ab217c355f [analyzer/cfe] Add an experiment flag for sealed class.
Have a separate flag from patterns, even though sealed families are to be shipped with patterns -- keep the work separate for now.

Change-Id: Ic3996b81d9a61f2a3b1e5137e7cc32ecc8bdec9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267289
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2022-11-05 00:20:50 +00:00
Johnni Winther 5baa4af7d8 [analyzer,cfe] Add 'views' feature and support for 'view class'
This adds the 'views' feature flag together with parser support
for 'view class'. If the feature is not enabled, an error is reported.

TEST=pkg/front_end/parser_testcases/views/...

Change-Id: I813ac86a0e7de9f0a5729c6d7ae35b82d1258ae5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265780
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2022-11-02 11:09:59 +00:00
Jonas Termansen 5c57cfa043 [infra] Prepare debianpackage-linux for the new cherry-pick workflow.
The debian packages on the release branches are now uploaded to the
version directory only when the tools/VERSION file changes, allowing
cherry-picks to land asynchronously on the beta/stable branches via
gerrit without clobbering any existing release artifacts. This logic
matches the changes made to the recipe for the dart-sdk builders. This
change is required to enforce our data security policies for mandatory
code review on the beta and stable branches using the new release
pipeline workflow.

This change needs to be cherry-picked to beta and stable before
launching the new cherry-pick workflow to avoid clobbering artifacts.
This change is safe because it doesn't affect any aspect of the Dart
SDK except the final upload of .deb files that has been locally tested.

Match the dart-sdk builder logic by also uploading by git hash and to
the latest directory.

Bug: b/256599191
Change-Id: Ib0d4853482edd1bd68f459fc97410fe61b4981c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266685
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2022-10-31 17:22:38 +00:00
Erik Ernst 0c90e06932 Added pattern grammar rules
This CL changes $SDK/tools/spec_parser/Dart.g to include grammar rules
associated with the upcoming feature 'patterns'.

Change-Id: I3c8a5404471b0957d8e2a2b833156e02bbd3607b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266628
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2022-10-31 15:39:35 +00:00
Jonas Termansen 7edc7a63f1 [infra] Remove linux SDK builder test matrix entry.
Both the production and try builders for the Linux SDK have been
migrated to the new recipe that doesn't use the test matrix.

The tools/bots/dart_sdk.py script is is no longer use and is removed.

Bug: b/253079985
Change-Id: I85a122b6165858b3dd43e7a1baad1dcd23f32ecb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265341
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2022-10-28 11:11:47 +00:00
Srujan Gaddam c14c0fdda3 [pkg:js] Refactor export and mock tests to use Strings
Allows for tests to pass with dart2wasm. This CL also adds these
tests to the test_matrix.json.

Change-Id: I970ef26b0fb377095c3889e6f52bef256d618850
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264604
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2022-10-26 16:34:38 +00:00
Sam Rawlins 9896f1c647 Enable the unnamed-libraries experiment by default in 2.19.0
TEST=tests/language/library/unnamed_library_test.dart

Bug: https://github.com/dart-lang/language/issues/1073
Change-Id: I1c7fa7b4ee4450e344a7613525765e4ab590cc8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265381
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-10-25 21:10:57 +00:00
Daco Harkes 89d769765a Revert "[tools] verify_docs don't error on library annotations"
This reverts commit 97eaded1ed.

Reason for revert: It was not erroring on the annotation on the
library, but on the implicit import statement above it due to
template:top.

https://github.com/dart-lang/sdk/issues/50291#issuecomment-1290158070

Original change's description:
> [tools] `verify_docs` don't error on library annotations
>
> Dartdoc code snippets should be able to have annotations before the
> `library` keyword.
>
> Bug: https://github.com/dart-lang/sdk/issues/49803#issuecomment-1287044157
>
> Change-Id: I7ec0b6db296274a1173d10d900f7af38a1f2b552
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265321
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Auto-Submit: Daco Harkes <dacoharkes@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Commit-Queue: Devon Carew <devoncarew@google.com>

TBR=lrn@google.com,devoncarew@google.com,dacoharkes@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I379a1871a1acd4d1c66804c3948f38e45691fd55
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/49803#issuecomment-1287044157
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265324
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-10-25 09:35:18 +00:00
Daco Harkes 359dca76ad [tools] rev_sdk_deps.dart output commit message
This CL changes the output of the tool to have the desired commit
message, including title and reference to the script.

Also scan repos in parallel, reducing execution time from 19 to 4
seconds on my machine.

Change-Id: Ia5fe75c21dd3b217038337e31161d2b88d22026c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265282
Reviewed-by: Devon Carew <devoncarew@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-10-24 18:06:19 +00:00
Daco Harkes 97eaded1ed [tools] verify_docs don't error on library annotations
Dartdoc code snippets should be able to have annotations before the
`library` keyword.

Bug: https://github.com/dart-lang/sdk/issues/49803#issuecomment-1287044157

Change-Id: I7ec0b6db296274a1173d10d900f7af38a1f2b552
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265321
Reviewed-by: Devon Carew <devoncarew@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-10-24 18:01:55 +00:00
Alexander Markov 671717b578 [vm/aot] Support dynamic record field access in TFA
TEST=language/records/simple/dynamic_field_access_test

Issue: https://github.com/dart-lang/sdk/issues/49719
Change-Id: I811db5c649988cbadf7ab29e5c4c70366f55e86b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262845
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-10-19 17:49:47 +00:00
Alexander Thomas 0b26f4816b [testing] Remove --compiler=none from test.py
* Use dartk as the default compiler for runtime=vm.
* Status file entries for checking for the `none` compiler now either
  use dartk or are deleted.

Tested: Standard CQ and local testing.
Fixes: https://github.com/dart-lang/sdk/issues/50241
Change-Id: I7a08d3e491ae1c82a0348fb66ea7b557398f97e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264682
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-10-19 08:09:58 +00:00
Ryan Macnak 3e7a1703bb [infra] Increase sharding for vm-kernel-precomp-nnbd-linux-debug-simriscv64.
Change-Id: I3eb11e4eb2d3f2db5329df7245fbca969e2956f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263660
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-10-13 17:47:33 +00:00
Erik Ernst d2911decfb Adjust rules recordLiteralNoConst and recordType to include ()
This change is needed as a consequence of
https://github.com/dart-lang/language/pull/2422
where `()` was introduced as the syntax for the empty record as well
as the empty record type.

Change-Id: Ia8b3f590361343ca14355043c5898e7bd084c04e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261645
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2022-10-06 15:10:57 +00:00
Johnni Winther 99f60a5e66 [cfe,vm] Support 'records' experiment in the sdk
This adds support for the experimental 'records' feature in the sdk
by settings its experimental release version to 2.19 and opting the sdk
into the feature the allowed_experiments.

Change-Id: I7a30212e5724e5d8ae3208f177103764b9aed737
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262760
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-10-05 09:00:30 +00:00
Martin Kustermann ed5ad5c087 Add CLI tool for analyzing Dart VM heapsnapshots
This CL adds an interactive command line tool to analyze
heapsnapshots generated by the Dart VM.

The tool works by operating on sets of objects. It supports operations
like users, transitive closure, union, ...

An example usage that loads snapshot, finds all live objects, finds
the empty lists in them and prints retainers of the empty lists:

    ```
    % dart bin/explore.dart

    (hsa) load foo.heapsnapshot

    (hsa) all = closure roots
    (hsa) stat all
          size       count     class
      --------   --------  --------
       43861 kb    8371    _Uint8List dart:typed_data
         ...
      --------   --------  --------
      108904 kb  400745

    (hsa) empty-lists = dfilter (filter all _List) ==0
    (hsa) empty-growable-lists = filter (users empty-lists) _GrowableList

    (hsa) retain empty-growable-lists
    There are 5632 retaining paths of
    _GrowableList (dart:core)
    ⮑ ・UnlinkedLibraryImportDirective.configurations (package:analyzer/src/dart/analysis/unlinked_data.dart)
        ⮑ ﹢_List (dart:core)
            ⮑ ・...
    ```

For now the tool lives only in dart-lang/sdk.

TEST=pkg/heapsnapshot/test/*_test.dart

Change-Id: I671c2e3ca770e1a5aa3e590e850a5694070b4c3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261100
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-09-30 14:15:01 +00:00
Erik Ernst 263be7413b Update spec_parser to handle new features (super, anywhere, records)
This CL updates Dart.g and hence the spec parser to handle new features
added to Dart in 2.17.

Change-Id: I42d6534d933df9a30453f12643dcc90e4d86fa80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260821
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-09-27 14:10:53 +00:00
Alexander Thomas e87f2d895c [build] Switch builds to the ninja in DEPS
Note: this "upgrades" ninja to 1.11.1.

Change-Id: Idca0f8a2a67cf5d5dbe75661bb14de174012580f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261101
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-09-27 11:24:03 +00:00
Daco Harkes ce4973b3cd [tools] generate_idefiles.py support for Windows
Three improvements to the generated compile_commands.json on Windows.

1. Prevent the use of .rsp files by using `ninja -t compdb -x`.
   Start using the ninja from DEPS that supports the `-x` flag.
2. Remove the `ninja -t msvc` part of the the build commands. Clangd
   does not understand it.
3. Add the windows sysroots (which are set with `-e environment.x64`
   in the build).
   Currently, these are hardcoded to the ones shipped in depot_tools
   because the `environment.x64` is non-trivial to parse.

Bug: https://github.com/dart-lang/sdk/issues/50032
Change-Id: I897ded9e7c97abdf4dde738c275db36536e0b0c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260701
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-09-26 12:30:17 +00:00
Ömer Sinan Ağacan affc3392a0 [dart2wasm] Implement Wasm FfiNative support
This CL introduces a new kernel-to-kernel pass in Wasm backend to
compile `FfiNative`-annotated external functions to external functions
with `wasm:import` pragmas.

The new pass `WasmFfiNativeTransformer` extends `FfiNativeTransformer`.
Some `FfiNativeTransformer` methods made public to allow reuse in the
pass.

The conversion works like this: when we see a member like:

    @FfiNative<Int8 Function(Int8, Int8)>("ffi.addInt8")
    external int addInt8(int a, int b);

We generate a Wasm import using Wasm ABI types according to emscripten
calling conventions:

    @pragma('wasm:import', 'ffi.addInt8')
    external static WasmI32 addInt8_$import(WasmI32 a, WasmI32 b);

and convert the original member (`addInt8()`) to a wrapper function that
calls the Wasm import, converting the arguments and return values to
Dart types:

    static int addInt8(int a, int b) {
      return WasmI32.toIntSigned(
        addInt8_$import(
            WasmI32::int8FromInt(a),
            WasmI32::int8FromInt(b),
        ));
    }

Build, test, and CI changes:

- Test runner now uses `// SharedObjects=...` lines in dart2wasm tests
  to pass extra Wasm modules to d8 command used to run the tests.

  Support for `// SharedObjects=...` lines were already used in
  native/AOT FFI tests, not added in this CL. We just start to use those
  lines in dart2wasm tests.

- dart2wasm gn file updated with a target "test_wasm_modules" that
  builds FFI test Wasm modules to Wasm using emcc (emscripten C
  compiler).

- CI dart2wasm_hostasserts configuration updated to copy the Wasm files
  generated by the "test_wasm_modules" target to the shards.

TEST=tests/web/wasm/ffi_native_test

Change-Id: I6527fe4e2ca2b582e16d84fee244e9cbe6dee307
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252822
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-09-23 09:41:22 +00:00