Commit graph

101291 commits

Author SHA1 Message Date
Slava Egorov a17d709a1d Revert "[tools] Allow precompiling gen_kernel and compile_platform"
This reverts commit 5cda2a871c.

Reason for revert: broke Flutter build. 

Original change's description:
> [tools] Allow precompiling gen_kernel and compile_platform
>
> When iterating on core library changes or changes in the AOT compiler
> many seconds are wasted waiting on gen_kernel/compile_platform to
> parse Dart code. This happens because we are running these tools
> from sources on prebuilt Dart SDK.
>
> This CL allows SDK developer to opt-in into AOT compiling these
> tools by adding `precompile_tools=true` to their DART_GN_ARGS.
>
> AOT compilation is performed using prebuilt SDK - so these
> executables do not need to be recompiled if core libraries or
> VM changes reducing iteration cycles.
>
> pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
> contains `precompile_tools=true` and use precompiled
> gen_kernel.exe instead of running it from source.
>
> Using precompiled compile_platform takes vm_platform_strong.dill
> build from 20 seconds to 3 seconds.
>
> Using precompiled gen_kernel takes small benchmark build from
> ~10 seconds to 2 seconds.
>
> TEST=manually tested
>
> Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: Id3e4eb44d33516f31c165d9a1e55911e8d356e7f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367960
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-05-23 13:52:58 +00:00
Vyacheslav Egorov 945153584c [dartdev] Add --depfile option to dart compile
I would like to add an option to our BUILD
files to precompile gen_kernel and
compile_platform to speedup iteration cycles
when working on core library changes.

To make this robust I would like to use
depfile to track dependencies and know
when compile_platform should be
recompiled.

TEST=pkg/dartdev/test/commands/compile_test.dart
R=kustermann@google.com

Change-Id: Id674f7353342c8275a8a0c4a70e3f5eaeb7f05d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367023
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-05-23 12:58:29 +00:00
Vyacheslav Egorov 5cda2a871c [tools] Allow precompiling gen_kernel and compile_platform
When iterating on core library changes or changes in the AOT compiler
many seconds are wasted waiting on gen_kernel/compile_platform to
parse Dart code. This happens because we are running these tools
from sources on prebuilt Dart SDK.

This CL allows SDK developer to opt-in into AOT compiling these
tools by adding `precompile_tools=true` to their DART_GN_ARGS.

AOT compilation is performed using prebuilt SDK - so these
executables do not need to be recompiled if core libraries or
VM changes reducing iteration cycles.

pkg/vm/tool/precompiler2 is tweaked to detect when DART_GN_ARGS
contains `precompile_tools=true` and use precompiled
gen_kernel.exe instead of running it from source.

Using precompiled compile_platform takes vm_platform_strong.dill
build from 20 seconds to 3 seconds.

Using precompiled gen_kernel takes small benchmark build from
~10 seconds to 2 seconds.

TEST=manually tested

Change-Id: Ieec6ad4e1081023d140eb744f0a3cd0c754414ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367940
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-05-23 12:35:21 +00:00
Ömer Sinan Ağacan 6f10e620fa [cfe] Remove unused Target.extraDeclaredVariables method
Change-Id: I9bf04e657657173a8fbb31a2bd081c3de02a6ba6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367920
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-05-23 11:06:48 +00:00
Simon Binder 6b71aa1f3e [dart2wasm]: Add compile-time define identifying tool
Knowing whether Dart code is running in a WebAssembly context is useful
to potentially select different code paths exploiting differences in
JavaScript and WASM behavior or simply to report the information to
users (e.g. for crash reports).

Without such a constant, one has to rely on implementation differences
such as `identical(0, 0.0)` or check the available `dart:` libraries.
Both are error-prone, so having a reliable constant as an alternative
makes this easier.

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

Change-Id: Ia969641e4b78223c394cbf251805cf77a30cb0fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365822
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-05-23 10:51:50 +00:00
Jens Johansen 1eaa749e0e [kernel/CFE] Remove unneeded default in switches
This CL removes the "default" case when the switch must be exhaustive
and is exhaustive without the default. Found by modifying the CFEs
constant evaluator.

Change-Id: Iaba27864315875257502be8e74fc2ce34f6ce54d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367900
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-05-23 09:32:49 +00:00
Devon Carew 7b8d82bea3 [docs] refactor the gsoc docs and docs/readme.md file
Change-Id: Ic8a18064ecf3bc404ffd3601574352a75d362bbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367762
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Jonas Jensen <jonasfj@google.com>
2024-05-23 07:50:46 +00:00
Sam Rawlins 8e27428a96 DAS: Rename coveredNode to coveringNode; small changes
This is preparing _AbstractCorrectionProducer to be a sealed public
class for plugins:

* Move `_coveringNode` and `coveringNode` to
  CorrectionProducer from _AbstractCorrectionProducer; these are only
  used by CorrectionProducer subclasses.
* Seal CorrectionProducer; the ultimate subclasses should subclass
  either ParsedCorrectionProducer or ResolvedCorrectionProducer.
* Make CorrectionProducerContext final.

Change-Id: Iccbe0d92042eb826c6c53499e052c37442e312ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-05-23 04:17:49 +00:00
Sam Rawlins 15dd406dac DAS: Fix producers that can apply in bulk, but not really across file
This introduces CorrectionApplicability.automaticallyButOncePerFile,
used in just 4 producers:

* AddNullCheck
* MoveDocCommentToLibraryDirective
* RemoveLibraryName
* RemoveUnnecessaryLibraryDirective

Also fixes FixProcessorMapTest to actually test registered fixes.

Change-Id: I2ed2d8d6a030f04ea3fa969988719bb9d4c2f8fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367661
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-23 01:20:10 +00:00
Sam Rawlins c386ca52d7 Clean up ex-multitest: number/identifier_test
I convert the `noSuchMethod` tests to (imho) simpler tests of what
property access of `e` or `d` or `D` would look like on an int, via
extension getters.

The noSuchMethod test as it was written cannot be executed at runtime,
because (as of Dart 2, I think, maybe earlier), property access on
expressions is a compile-time consideration. And I think as a compile-
time error test, it's hard to see what it's testing.

Change-Id: I5c0ca728e6e812b8f35adb80b288be351c4b076a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367461
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2024-05-23 01:19:59 +00:00
Ben Konyi f4cc1eb648 [ docs ] Add documentation for DART_VM_OPTIONS
Change-Id: Icf66ff1f024c9f14bc8241b2b23f99f1ed8e0c45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367800
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-05-22 21:03:44 +00:00
pq 375310caa2 quick fix for REMOVED_RULE
Change-Id: If1995ff9938df8b08d12a2d7deaf9fc69e39a356
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-05-22 20:29:52 +00:00
Ben Konyi 0c547d2833 [ CLI ] Fix DART_VM_OPTIONS usage only resulting in printing of help message
Fixes https://github.com/dart-lang/sdk/issues/55767

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

Change-Id: I6a773acbd9fc21c086fc459c7cb983ea1ff11fcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367720
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-05-22 20:06:49 +00:00
pq af7355d34b quick fix for DUPLICATE_RULE
Change-Id: I49c75bcaa12eefc06b1e906983b482a51466c134
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367740
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-22 19:56:24 +00:00
Sam Rawlins 286715bda3 linter: Move no_literal_bool_comparisons tests
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I0a3831c2ba47ced728d9c71087e36e2c497fa1b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367141
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-05-22 18:43:58 +00:00
pq 58e6149a98 update fix status stats
Change-Id: I096871271a240b6af30d3c6d6e6afb5fe37f8a1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367660
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-22 18:42:55 +00:00
Ryan Macnak 53f1ed4095 [build] Fix ARM32 GCC build.
TEST=vm-gcc-linux
Bug: https://github.com/dart-lang/sdk/issues/52080
Bug: https://github.com/dart-lang/sdk/issues/55669
Change-Id: I94ecf1b7c74c23d0609844a1163d14454e80eebc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367502
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-05-22 18:06:01 +00:00
pq 4015ad7b2b quick fix for EXTRANEOUS_MODIFIER
Change-Id: I8ee50febb04758a227a25aa8635ec1396ca180d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-05-22 17:50:42 +00:00
pq 874f291ade fix bad key in error fix map
Change-Id: I08cc00a54f0325ce758447428e48308f3a8aafda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-05-22 17:05:08 +00:00
Danny Tuppeny f3be14c3b0 [analysis_server] Ensure errors are cleared from NotificationManager cache when flushed on client upon file remove
When a server plugins generates diagnostics, they're merged with the servers diagnostics (which are kept cached in `NotificationManager.errors`) and sent to the client.

When a file is removed, we tell the client to flush all results but we did not previously clear this cache. That meant it a plugin subsequently generates diagnostics (even if empty), we would merge with them with the last state of the server errors and send them to the client.

This clears errors from the servers cache at the same time as flushing them on the client.

Fixes https://github.com/Dart-Code/Dart-Code/issues/5113

Change-Id: I047c4531a38edaaad1362f9c7e7714a7e7ab705f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-22 16:36:58 +00:00
Danny Tuppeny 0f05924297 [analysis_server] Remove redundant solo_test tests
Checking for solo tests is now done as part of `verify_tests_test.dart` so solo tests currently produce two test failures.

This file did check one additional project that doesn't have `verify_tests_test.dart` does not (analyzer_cli) so it isn't exactly the same, but that project is going away (https://github.com/dart-lang/sdk/issues/48457) so it doesn't seem worth making `verify_tests_test` work there (there's a mismatch because it currently uses `all.dart` and not `test_all.dart`, but I suspect that filename may be coded into some bot configuration somewhere).

Change-Id: I7431ed0e141bab1898860f6fbe316833281d6fa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-05-22 16:34:31 +00:00
Daco Harkes 101faa6929 [tool] Fix tools/generate_idefiles.py after RBE migration
Closes: https://github.com/dart-lang/sdk/issues/55813
Change-Id: Ia724f291a8893c7ee8622c687ab8181f23d0c405
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367580
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-05-22 16:17:33 +00:00
Srujan Gaddam 751052e826 Update package:web rev to 7604578eb538c471d438608673c037121d95dba5
Includes 7604578eb5.

Change-Id: I7437304ee64cb71608ed36597d26921991faa3b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367520
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-05-22 16:02:28 +00:00
pq 643b9ae8f7 remove unused parser error codes
The error codes are not being generated and the mapping to `EXTRANEOUS_MODIFIER` in tests is unnecessary.

This logic is likely a hold over from when the analyzer had it’s own parser with temporary conversion logic to align it with fasta. With only one parser, these bits are stale and should be safe to remove.


Change-Id: I5b29f0081953c61771b313025595910eef055c2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367540
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-22 15:08:18 +00:00
arkare 69565652cc @JsonCodable() macro: escape field names with raw string
Closes https://github.com/dart-lang/sdk/pull/55799

GitOrigin-RevId: 297bb5fada9941d87bad51b70a6c8ec6f6c6e074
Change-Id: Ic21df065ac701764cb2e2d6b27a8364df7bf0c19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367361
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-05-22 15:03:04 +00:00
Paul Berry bd7ef48815 Change SharedRecordType abstract getters to return lists.
Previously these abstract getters were typed as returning
iterables. Although in principle, changing the return types to lists
constrains the implementations more, in practice it makes no
difference because the only implementations are in the CFE, analzyer,
and the mini_types shared tests, and those implementations already
return lists anyhow.

Changing the abstact getters to return lists will simplify future work
by allowing code that interacts with the base SharedRecordType class
to index into the lists rather than having to iterate through them.

Change-Id: Ia257400dbb7c89aabc468be15a939e6baa36e191
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367500
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-05-22 14:27:51 +00:00
Paul Berry 14c15d936a Fix detection of record field name mismatch in subtype matching.
Fixes #55802.

Bug: https://github.com/dart-lang/sdk/issues/55802
Change-Id: I9f9488cb09243679965ee891c45bee293af5056a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367462
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-05-22 14:22:00 +00:00
Paul Berry 50e6ea7f8c Inline LibraryBuilderImpl.nonNullable.
This method always returned Nullability.nonNullable. Inlining it will
pave the way for removing support for legacy libraries from the type
system, which will in turn make it easier to share type system logic
between the analyzer and front end.

Change-Id: I25757f6f7a65d65c72b28e57153ce0f06ffd38e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367441
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-05-22 14:19:48 +00:00
Danny Tuppeny e43bbe32fa [dds/dap] Fix flaky tests waiting for breakpoint resolved events on slow bots
This test shows up as flaky quite often. It's waiting for breakpoint Resolved events by just calling `await pumpEventQueue(times: 5000);` but it appears this sometimes doesn't get all of the events.

This change waits up to 5s for the events to arrive (because we unfortunately have no signal to know when they should have come through). I'm hopeful 5s is more than enough and this won't flake, but we could increase this as not - the goal of this test is not to verify performance but just ensure the events do arrive.

Change-Id: Ia2236b65bbb5d11e2a5519d49869c6b87202a940
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367301
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-05-22 14:13:56 +00:00
Stephen Adams fb057ea4e0 [js_runtime, js_dev_runtime] Implement microsecond field of DataTime
- Move DateTime implementation for dart2js and DDC into a shared place to reduce duplication.

- Add a _microsecond field to the web DateTime to track microseconds outside of the JavaScript Date.

- The cute dart2js optimization whereby `DateTime.now().millisecondsSinceEpoch` is compiled to `Date.now()` still works.

- Both implementations report better errors.

- Fixed VM bug with in-range sentinel.


Change-Id: I9156255bdb6ecc195500ae9bc88f91fb315b6297
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366963
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-05-22 05:18:52 +00:00
pq 177ad1a895 quick fix for DUPLICATED_MODIFIER
Change-Id: Ibcfbee84b8bcd67cab81741f65e701012f6a4ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367362
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-21 23:45:02 +00:00
pq 3972ab2213 quick fix for unnecessary_await_in_return
Change-Id: I30b0e48d7c5b93766580d23b35d7e2a6c8c9a44b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367341
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-21 23:44:58 +00:00
Kallen Tu bd8f87d477 [wildcard-variables] Test non-binding behaviour with top-level declarations.
Added a little section for late wildcard variables too.

This CL tests mixing top-level wildcard declarations with local wildcard declarations and the non-shadowing, non-binding behaviour.

Bug: https://github.com/dart-lang/sdk/issues/55652
Change-Id: I72e7cfb1b2d80a3934af355579c36252881cf3fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367241
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-05-21 22:15:11 +00:00
Ryan Macnak ffbbdb5a10 [vm, service] Treat the object id ring as strong during major GC.
The id ring was treated as a strong root during minor GC and a weak root during major GC. Before mark-through-new-space, new-space objects could not be collected during a major GC, so in practice the policy was that the id ring was strong for all new-space objects. After mark-through-new-space, new-space object can be collected during a major GC, so service ids could expire very quickly, especially for object just created using the service protocol and not otherwise reachable from the Dart program. Given that service id zones have still not been implemented, this makes it impossible to reliably interact with such an object.

TEST=ci
Bug: https://github.com/flutter/flutter/issues/148704
Change-Id: I0f15c00414f996fad49bcb137c7f1c15bb4955c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367440
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-05-21 21:29:49 +00:00
Devon Carew e5e2c925c0 [docs] remove older pages
Change-Id: I6567aa21fe036929fb036551901823dc2926468f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367480
Reviewed-by: Hossein Yousefi <yousefi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-05-21 21:10:29 +00:00
Konstantin Shcheglov 263820ad70 Macro. Issue 46392. Use the same Identifier for all augmentations.
Bug: https://github.com/dart-lang/sdk/issues/46392
Change-Id: Ib175cb3f0be6108c4f8b180526dd04e3ef3b2670
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-05-21 21:01:58 +00:00
Sam Rawlins c888e760f6 DAS: Simplify public API of CorrectionProducer and friends
* CorrectionProducer:
  * Remove `errorMessage`; unused.
  * Make `configure` abstract; it is only here for the doc comment.
* MultiCorrectionProducer: remove `typeProvider`, `typeSystem`.
* ResolvedCorrectionProducer: make `coreTypeBool` private.
* _AbstractCorrectionProducer:
  * Move `invalidNodes`; only used once.
  * Remove `strictCasts`; unused.
  * Remove `displayStringForType`; unnecessary convenience.
  * Move `mightBeImplicitConstructor` to be a private extension
    getter.
  * Move `nameOfType` to be a private extension getter.
  * Move `shouldWrapParenthesisBeforeAnd` to be a public extension
    getter.
* Move DartFileEditBuilderExtension to be a private extension.

Change-Id: Icd1e17ccf398fafd1d9fee88d4b6a430a2deb50a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367363
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-05-21 19:02:39 +00:00
Sam Rawlins 6c7452ac15 DAS: rename files with capital letters
Change-Id: Ib4d3da6f1dea130b56caf642c0e0a6a0a9a15e2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367400
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-05-21 17:55:04 +00:00
Ryan Macnak 9077bf991f [vm, gc] Incremental compaction, take 2.
- Fix missing store buffer flush when --marker_tasks=0.
- Fix passing untagged pointer to store barrier check on ARM/ARM64 (6bc417dd17).
- Fix passing uninitialized header to store barrier check on ARM64/RISCV (1447193053).

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/52513
Bug: https://github.com/dart-lang/sdk/issues/55754
Change-Id: Id2aa95b6d776b82d83464cde0d00e6f3b29b7b77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367202
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-05-21 16:33:00 +00:00
Ömer Sinan Ağacan fab56db71b [dart2wasm] Move common code generation routines to state_machine, fix sync*
This is the last part of the series of patches to implement missing
sync* features and fix bugs.

Move common code generation functions between async and sync* code
generators to the state_machine library, with the name
`StateMachineCodeGenerator`.

This class allows overriding parts that differ between the async and
sync* code generators.

Fixes tests:

- co19/Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_sync_t05
- language/sync_star/generator3_test/test1
- language/sync_star/generator3_test/test2
- language/sync_star/sync_star_exception_iterator_test
- language/sync_star/sync_star_exception_nested_test
- language/sync_star/sync_star_exception_test
- language/sync_star/sync_star_exception_current_test

Fixes #51343.
Fixes #51342.

Change-Id: Ife6eab43b2721b003ebf9bc0f03796748fd5df46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367041
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-05-21 14:53:58 +00:00
Martin Kustermann 4dd6ee661d [dart2wasm] Add extra build targets in V8 build documentation
Change-Id: Ibef9a043a1326651b123bb0a3748407c6cc87b18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366941
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-05-21 10:52:18 +00:00
dependabot[bot] aacbc973df Bump github/codeql-action from 2.13.4 to 3.25.5
Closes https://github.com/dart-lang/sdk/pull/55778

GitOrigin-RevId: bb823a15a06a1e75316354893423dd0a1f87eb5a
Change-Id: I3cffe1eded07a755e11960b2810c00e384302ef7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367143
Reviewed-by: Alexander Thomas <athom@google.com>
2024-05-21 10:44:50 +00:00
dependabot[bot] 42cb07fe23 Bump actions/checkout from 4.1.5 to 4.1.6
Closes https://github.com/dart-lang/sdk/pull/55777

GitOrigin-RevId: 532a4e4a81275f630fcc386e12fd0151b244667d
Change-Id: Ida871bd0a17421be9fb1cdf8f876e5693e83f79e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367142
Reviewed-by: Alexander Thomas <athom@google.com>
2024-05-21 10:44:21 +00:00
Ömer Sinan Ağacan 829261e2ba [dart2wasm] Move async compiler utilities to state_machine library
This is the second part of the refactoring to make sync* and async
compilers to reuse code as much as possible.

Move exception handler and label target types from `async` to
`state_machine` library.

This is a change from
https://dart-review.googlesource.com/c/sdk/+/366663, moved to a spearate
CL to make revieweing easier.

The end goal is to share code generation for async and sync* code
generators.

Change-Id: Ie38e4237bd89063ceba1700bf0a996e4839a396a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367040
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-05-21 10:09:14 +00:00
Ömer Sinan Ağacan 3863e78e80 [dart2wasm] Move yield finder to a shared library
- Generalize `YieldFinder` to consider both `await` and `yield` as a
  suspension point.

- Move it to `state_machine.dart`, reuse it in async and sync* code
  generators.

This is a change from
https://dart-review.googlesource.com/c/sdk/+/366663, moved to a spearate
CL to make revieweing easier.

The end goal is to share code generation for async and sync* code
generators.

Change-Id: I4c75c746f85b2fedf7c1117a20fcd32152573c6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367021
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-05-21 09:09:40 +00:00
Erik Ernst 035be2b0d4 Update Dart.g to clarify the association of metadata and its target AST
Change-Id: I02a3e155aab73d638ddbc20485db9db3dcbe6c9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365781
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-05-21 09:07:23 +00:00
Brian Wilkerson 1d0c90c145 Add documentation for more FFI diagnostics
Change-Id: Ie6b9f68e348a512ad84bd4f896564dd84cf30968
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366406
Reviewed-by: Marya Belanger <mbelanger@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-05-20 23:24:47 +00:00
Sam Rawlins 2f13e3d9a0 DAS: Use an enum to express how broadly a CorrectionProducer can be applied
We decided that the existing mechanism, three bool values that can be
overridden by an AbstractProducer subclass, was confusing as it might
give the impression that they are independent, and that any of the 8
possible combinations are valid. But really each author of a
CorrectionProducer just needs to answer one question: how broadly can
this correction be applied?

So to answer that question we decided (loosely in emails) to offer an
enum of a few values that more-or-less represent the sensible
combinations of the bool getters. And more specifically I decided in
this CL what those values should be.

In this CL I also remove the notion of a default value. Each
CorrectionProducer must indicate specifically how broadly it can be
applied.

This PR should functionally be a no-op; no applicability was increased
or reduced. I left comments intact. I left `TODO(applicability)`
comments where no comment is made to justify why a correction cannot
be made any more broadly than "only at specific location."

Change-Id: I3e3a12ee811b2b08f276ff755e7ff638f4fffabf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366740
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-20 22:35:49 +00:00
Ryan Macnak 1447193053 [vm, compiler] Fix use of StoreIntoObjectNoBarrier before header initialization.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/55754
Change-Id: Ie516be52a8edf620019f60b2ea0fd4f3eeeba533
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367203
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-05-20 20:56:20 +00:00
pq cf65fa73dd remove AstBuilder.enableNonNullable
Change-Id: Ifb7e049115297a34ed95a974b0a1e71540b54ce8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367148
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-05-20 20:08:25 +00:00