Commit graph

97915 commits

Author SHA1 Message Date
Danny Tuppeny 28456ae716 [analysis_server] Fix LSP "Fix All" command for part files
The original code here called getResolvedLibrary() and then _fixErrorsInLibrary which meant if it was invoked in a part file it would do nothing (it found no resolved library) and in a container file it would also fix the part file (because _fixErrorsInLibrary enumerates the units).

This fix splits _fixErrorsInLibrary in two so it can fix libraries and units and calls the unit version from the LSP Fix All command.

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

Change-Id: Iea72c572b6e442f6846f5ba823194b30142606db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332242
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-26 14:11:12 +00:00
Vyacheslav Egorov ac32223cea [vm/compiler] Improve CreateArray compile type
If we have constant type arguments include them
into the type.

This CL also expands IL tests framework with the
capability to match CompileTypes.

TEST=vm/dart/regress_53817_il_test

Bug: https://github.com/dart-lang/sdk/issues/53817
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-product-x64-try,vm-aot-linux-release-arm64-try,vm-aot-linux-release-simarm_x64-try,vm-aot-obfuscate-linux-release-x64-try
Change-Id: I48722b002d9cd436dbc8ca3c9afbefa124f18996
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331900
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-10-26 12:40:02 +00:00
Vyacheslav Egorov a97f85ef0e [tfa] Make kPrintStats runtime configurable
Currently we have to ask users to run TFA from source
(which requires a lot of dances with figuring out
command line and checking out Dart SDK).

However statistics printing does not impose any runtime
overhead (as opposed for example to kPrintTimings
which tracks timings) so it can be runtime configurable.

Inspired by https://github.com/flutter/flutter/issues/136529

TEST=tested manually

Change-Id: Ie496d6babb1e8cbbbb9a665b14656ea334a2eeed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331881
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-10-26 11:19:24 +00:00
Johnni Winther 931e27753a [cfe] Support inherited combined member signatures
This add support for inherited combined member signatures, both from
source and from dill.

Change-Id: I163f2b30c3242ba98692d7e9b52ef93fd0d6a903
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332201
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-10-26 09:56:05 +00:00
Johnni Winther 4b2cf0744d [cfe] Add TypeDeclarationType and asInstanceOf
This add a common sealed superclass TypeDeclarationType for
ExtensionType and InterfaceType and uses it to add a common
asInstanceOf method to ClassHierarchy.

Change-Id: I7294e41069b063305c3bd4e384ff90614a3936a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331981
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-10-26 08:46:48 +00:00
Tess Strickland 3a41ee6d8d Revert "[vm/compiler] Consistently use PointerBase.data values as FFiIntPtr."
This reverts commit 5c4fd50667.

Reason for revert: breaks ffi/data_test on ARM bots

Original change's description:
> [vm/compiler] Consistently use PointerBase.data values as FFiIntPtr.
>
> Also if converting an unboxed int with only non-negative values
> that fit in 32 bits to a uint32, then keep the range from the value.
>
> TEST=regress_306327173_il_test
>
> Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try
> Change-Id: Id9e7c2d5f477e560822a02574739c57d77b5a6d1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332202
> Reviewed-by: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

Change-Id: I35f6b3b03c9d2dec0f35005f850dab7f2dd54515
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332205
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-10-26 08:11:11 +00:00
Stephen Adams 8ab032574a [observatory] Avoid deprecated UnmodifiableUint8ListView
TEST=ci
Issue: 53785
Change-Id: I1e3696b32b165813f895dfafb9da8fd50bb41ffc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332263
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-10-26 01:31:29 +00:00
Sigmund Cherem e557275397 [web] mark deferred/many_parts_test as slow.
This test has failed with a timeout in a flaky manner: 48% on windows,
13% on linux bots. Unlike other timeouts, this is a legit slow test
because the compiler takes too long to build it. That seems justified
given that this is a stress test for deferred loading, so it is expected
to be slow.

This CL updates the status file for non host-asserts configurations, since the
hostasserts configuration already has 4x budget.

Change-Id: Ie6b53a8c7ef5f6c9b9c6748386db2ae505c2eca2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332281
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-10-26 01:25:55 +00:00
Sigmund Cherem 744231d16e [web] delete native_gc_test.
It seems to me that this test doesn't provide value for the JS backends.
The test was first introduced 11 years ago to investigate and fix GC
issues in Dartium that happened across the Dart/DOM boundary (see
https://github.com/dart-lang/sdk/issues/1448).

While the test works in many configurations, this test is flaky in
dart2js-firefox (37%) and DDC (8-14%).  I haven't investigated the
reasons behind the timeouts, but given the origins of the test, it
doesn't seem worth fixing it.

Change-Id: I3eaf2273209b587ce5ecfcf4a2bbbd9cb8b990fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332167
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-26 01:17:20 +00:00
Sigmund Cherem a7104c813f [tests] update periodic_timer tests to reduce flakiness.
These tests check for lowerbounds on the time it took to fire an
event. Unfortunately, browsers may complete events ahead of time.
This has caused these tests to be flaky in dart2js and ddc [1]

In a local experiment, we've seen timers complete +-15ms from
the expected time. Most often they are around +-5ms, but those more
extreme cases do happen. Recent flakiness logs show some good samples:
* off by 1ms: [2] and [3]
* off by 4ms: [4]
* off by 13ms: [5]

This CL makes two adjustments to reduce flakiness:
* account for the fact that timers may complete early (checking that
  they are >= than the expected timeout - 40ms)
* increase intervals to 50ms in order to prevent overlap between two
  events in the worse scenario that both happen on the extreme variances
  (+15ms and -15ms respectively).

[1]: https://dart-current-results.web.app/#/filter=lib/async/periodic_timer,dart2js,ddc&showAll
[2]: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8766776511992750881/+/u/test_results/ignored_flaky_test_failure_logs
[3]: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8766798962026535617/+/u/test_results/ignored_flaky_test_failure_logs
[4]: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8767378609439308945/+/u/test_results/ignored_flaky_test_failure_logs
[5]: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8767357850408867553/+/u/test_results/ignored_flaky_test_failure_logs

Change-Id: Ib46d6f33f5c2b1458f393e8b4c75c84453e73024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331210
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-26 00:56:43 +00:00
Brian Quinlan 097c84f11b [io/doc/test] Modify the Windows symlink resolution behavior so that resolving a link that points to a non-existent file results in a type of notFound, which is consistent with all other platforms.
Bug:https://github.com/dart-lang/sdk/issues/53684
Change-Id: I1b594e1a85906d1f510358eec71792ea15ab801b
CoreLibraryReviewExempt: VM- and doc-only
Tested: unit tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331841
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-10-25 23:14:38 +00:00
Ryan Macnak 10a5df43af Roll perfetto to 13ce0c9e13b0940d2476cd0cff2301708a9a2e2b.
This fixes the build on gcc 13.2.0.

Change-Id: I53559e05a6dc372a4ae324de4f24f366212b40b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332162
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-10-25 22:34:39 +00:00
Kallen Tu 40aacb3482 [analyzer] Mark const iterables unknown if there is a unknown bool in an If Statement entry
Bools from environment such as `dart.library.js_util` are represented as unknown bools. They currently produce a `NON_BOOL_CONDITION` error when used in if statements in const lists, which is not the behaviour we want.

This CL marks iterables with these unknown bools in if statements as unknown and avoids other calculations like `==` upstream.

Bug: https://github.com/dart-lang/sdk/issues/53363, https://github.com/dart-lang/sdk/issues/51607

Change-Id: Ibd3e6dbc6a507c93516bc2782d59d0e1e452f17d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326261
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-25 22:31:32 +00:00
Ryan Macnak aac74693f5 [build] Avoid GN warning about use_rbe being set but never declared.
Change-Id: Id4ae1a6edf1a757eac3916079345cf3926f71b16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332164
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-10-25 21:15:05 +00:00
Paul Berry bbfe9b1ec9 Kernel: Remove Procedure.isLoweredLateField flag.
This flag used to be used for field promotion (to ensure that lowered
late fields are promotable, provided that they are private and final
and don't have a name that conflicts with something else
non-promotable). However, as of
https://dart-review.googlesource.com/c/sdk/+/330168, the logic for
determining when a Procedure is promotable now operates solely by
checking for all the conditions that prevent promotability. Lowered
late fields are now promotable because there is no reason for them not
to be.

Change-Id: I15982acef6fe8c46334fb859306bca1417a2ca64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331207
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-10-25 20:47:26 +00:00
Ben Konyi 3570e9692b Bump webdev to 25f17cda837042e8b4f7aec5192c68bef0d3c387
Change-Id: Ie088d8037dd15fa1c02e78a1e37ecd24161d8779
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332121
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-10-25 20:46:29 +00:00
Stryder Crown 574e95c9ce Update add_missing_switch_cases code template
Closes https://github.com/dart-lang/sdk/pull/53835

GitOrigin-RevId: 9e2382db10cabc24564135700d933d206f82c301
Change-Id: I2842f0c2b5007fba749bdba8067f77ef31cdb6a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331843
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-10-25 19:42:02 +00:00
Paul Berry c23ac067eb Improve the behavior of "why not promoted" when field promotion disabled.
If the user attempts to promote a property, and their language version
does not permit field promotion, the "why not promoted" logic now
checks whether the language version is the sole reason for the failure
in property promotion. In other words, it checks whether the property
would have been promotable *if* field promotion had been enabled. If
it would, then the context message displayed to the user explains that
the property did not promote because field promotion is not supported
by the current language version.

However, if there is some secondary reason why the property failed to
promote (in other words, if the property would not have been
promotable even if field promotion had been enabled), then the context
message now favors the secondary reason.

Rationale: imagine a user is maintaining a package that doesn't yet
support SDK version 3.2, and that package contains some property
that's non-promotable both because the language version is prior to
3.2 *and* for some other reason (e.g., because the property isn't a
private field). It would be quite frustrating if the user saw a
context message suggesting that the property would be promotable in
SDK 3.2, and then went to a lot of effort to bump their minimum SDK
version, only to discover *after* the bump that the property is still
not promotable.

In the process of making this change, I discovered that the CFE
doesn't support field promotion in patch files. This is because patch
files aren't listed in `SourceLoader.sourceLibraryBuilders`, so the
logic in the `FieldPromotability` is never invoked for those
files. Since patch files are an artifact of SDK development, and will
never be used by end users, it doesn't seem worth going to extra
effort to add this support. However, I've taken care to make sure that
the "why not promoted" logic recovers gracefully in patch files (by
simply not generating a context message).

Change-Id: I6c0d1c0f4b8a7690f6f775408cb5e857b2dd7b03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330241
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-10-25 19:41:26 +00:00
Stephen Adams b4bae467d4 [typed_data] Deprecate unmodifiable views
CoreLibraryReviewExempt: Reviewed in https://dart-review.googlesource.com/c/sdk/+/321922
Bug: #53785
Change-Id: I23a064e76a4b359e804f41676b3b775dd02ea183
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331723
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-10-25 19:14:06 +00:00
sgrekhov 79d359ed45 [io/doc] Fix typo in File.createSync() documentation
Change-Id: Id077d3c56b6e9835821cf9d4463df34c626ffb32
CoreLibraryReviewExempt: documentation update
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331920
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-10-25 19:11:30 +00:00
Tess Strickland 5c4fd50667 [vm/compiler] Consistently use PointerBase.data values as FFiIntPtr.
Also if converting an unboxed int with only non-negative values
that fit in 32 bits to a uint32, then keep the range from the value.

TEST=regress_306327173_il_test

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try
Change-Id: Id9e7c2d5f477e560822a02574739c57d77b5a6d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332202
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-10-25 18:47:49 +00:00
Nicholas Shahan 89886de2e8 [tests] Seal native Object in benchmarks test
Run the seal_native_object.js preamble before any other code when
trying to benchmark dart2js compiled code.

Change-Id: Iec95dd3189869738185bce34f5202be4db0b90f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330669
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-10-25 17:40:21 +00:00
Ryan Macnak b8c6c4d187 [vm, ffi] Handle MultipleNativeLocations that aren't just byte copies.
TEST=ffi/*structs_by_value*
Bug: https://github.com/dart-lang/sdk/issues/48645
Change-Id: I28a139aec3370be9799279325717057d7034b341
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332141
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-10-25 15:57:12 +00:00
Sigmund Cherem 4bcb0950f1 [web] fix improperly migrated tests.
These tests had bugs intronduced during the the null-safety test
migration. Surprisingly the failures didn't show up on some
configurations because the tests were previosly not using the
async-helper wrapper. As a result, the test was logged as completed and
passing before it was done executing. Together this was the cause why
these tests failed in d8 and flaked in firefox.

This CL fixes both issues. A few notes:
* web_2 tests didn't have bugs, but this CL also adds asyncHelper to
  match
* it's quite possible that many of these `is` tests are optimized away
  in dart2js. I added a couple `confuse` calls when the trivial tests
  were highlighted by the analyzer directly (not based on whether or not
  dart2js optimized them away).

Change-Id: I8f58c0b0b850023764524f57201eada89a5c0d6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332062
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-25 15:37:50 +00:00
Konstantin Shcheglov d07ab72fb9 Stop using deprecated 'element2' that will be removed.
See https://dart-review.googlesource.com/c/sdk/+/311461

Change-Id: I7c2b7ff227fef838f10657bdd9f18da98f48f5ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332061
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-10-25 14:21:42 +00:00
Johnni Winther e06536af2e [cfe] Create combined member signature stub
This create a stub for combined member signatures from multiple
inherited non-extension type members and adds these to the
extension type declaration.

A sealed [TypeDeclaration] superclass is added to [Class] and
[ExtensionTypeDeclaration] to support accessing the enclosing type
declaration from a [Member].

TEST=existing

Change-Id: Ic01535d27a14187d37b00868e7e90fe73558b051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331181
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-10-25 14:16:00 +00:00
Konstantin Shcheglov 4a81a3db21 Enable null safety by default in Blaze.
See https://critique.corp.google.com/cl/566566302

Change-Id: I393ee348b30571ebab7e5c3c98d456794727a4ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332000
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
2023-10-25 14:13:39 +00:00
Ben Konyi fa6253ec11 [ package:vm_service ] Cleanup for 13.0.0 release
This change includes:
 - Removal of deprecated methods and constants
 - Removal of dependency on package:expect for testing, instead copying
   over the minimal amount of functionality needed for testing from
   package:expect into pkg/vm_service/test/common/expect.dart
 - Removal of classes and interfaces that are now found in
   package:vm_service_interface
Change-Id: I21c2d228e615f97e64dd98b6512bf2e533916454
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331760
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-10-25 14:02:42 +00:00
Daco Harkes bd57548de1 [vm/ffi] Fix FFI callbacks on iOS 17
The new Secure Page Table Monitor in iOS on A15 and A16 does not allow
`vm_remap`ping memory pages that are manually created. It only allows
remapping pages which come directly from a signed binary.

Manually copying the pages is supported in JIT mode.

TEST=manually tested locally in a local-engine build

Bug: https://github.com/flutter/flutter/issues/136980
Change-Id: I94d87f753a50648486f46fe728dd8358038971fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332241
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-10-25 14:00:02 +00:00
Tess Strickland 87f62aedad [vm/compiler] Fix range analysis for IntConverter.
Before, converting a Uint32 to a Int32 would just clamp the range
to be within the possible Int32 range. However, that's not what the
IntConverterInstr represents in this case: in this case, it's just
a reinterpretation of the bits as signed instead of unsigned.

For simplicity's sake, the initial fix for this is to keep the range
[x, y] if it is 0 <= x <= y <= kMaxInt32, and otherwise just use
the full Int32 range.

Also add a version of Range::Full that takes a Representation instead
of a RangeSize, so that the ranges for unsigned unboxed ints can be
made more precise. Previously, they'd be overapproximated by the next
largest signed representation instead.

Also check that we're never trying to create a range for x->untagged,
and that untagged->x just uses the full range for x.

TEST=vm/dart/regress_306327173_il_test

Fixes: b/306327173

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try
Change-Id: Ic60d24be016844deda56ee477a6950a315b8506f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332040
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-10-25 13:54:38 +00:00
Kevin Chisholm 844fe6d955 [docs] Merge stable changes into main changelog
Change-Id: Ibd756739a08fd7e44b32ec7f5d8eccf29c666895
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332182
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-10-25 12:22:12 +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
Chloe Stefantsova 0e2ed5ab7a [cfe] Report an error on optional positional or named parameters in extension type declarations
Part of https://github.com/dart-lang/sdk/issues/49731

Change-Id: I49e813f9573b2b66950e8aae572591b65b62e2ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331260
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-10-25 10:26:38 +00:00
Ryan Macnak 379f8cac14 [vm] Fix build for gcc 13.2.0.
TEST=local build
Change-Id: I32e400efb0f6d5e41b894f495ae2e77352f6f5fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332142
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-10-25 08:38:28 +00:00
Chloe Stefantsova b791861f75 [cfe] Make 'flatten' aware of extension types
Part of https://github.com/dart-lang/sdk/issues/49731

Change-Id: Ic7175ebab22f7b9e956030616350e79d1837a1df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331942
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-10-25 07:41:38 +00:00
Chloe Stefantsova 255f260ede [cfe] Report error on await of extension type that is not a future
Closes https://github.com/dart-lang/sdk/issues/53207
Part of https://github.com/dart-lang/sdk/issues/49731

Change-Id: Idad31c3286108aa3dc75b4b3d7f5364674641582
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331980
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-10-25 07:41:18 +00:00
Brian Wilkerson 3659b3e585 Recover from exension type declarations with no representation field
Change-Id: I2fdd0c281ba8a8458248d00b91a0cb1abfed02da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331749
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-10-24 23:27:59 +00:00
Nate Biggs 9542aa442a [dart2js] Add back private indices for entity maps.
After further review the slight increase in memory usage is minimal and worth the improvement in runtime for each phase.

The new indices follow the same format as before, we assign each entity an index when it is registered into the entity map. However these new indices are only used by the entity maps and not as part of the serialization format for those entities. The index only exists to make look ups faster in the "map". As such, I've made the field private to prevent/discourage outside use of it.

Change-Id: I7a7c20a2dd51b01d2390bb4401545821a1014832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331360
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-10-24 22:49:38 +00:00
Dan Chevalier c7f122ee9e Initial Implementation for Service Extension Router
This instance of service_extension_router has been hooked into DDS seperately. The vm_service and DDS tests still worked with the integration.

There will still be some iteration and discussion to be had, but I'd like to get this up as the initial version.

Bug: https://github.com/dart-lang/sdk/issues/53300
Change-Id: Ic72b770a61b2fc61fbd7c4b47ff8996a90f78665
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331820
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2023-10-24 21:58:21 +00:00
Nate Biggs 1df418af1a [dart2js_info] Add 'main-only' option to info diff.
New option will only include diffs in the "main" output unit for the provided builds. Only sub-library entities have an output unit. Libraries do not have an output unit because there is no code associated with the library itself and a single library's contents can be spread across multiple output units.

Mutually exclusive with the 'package-only' flag because that one only prints libraries and 'main-only' includes no libraries.

Change-Id: I4d5abe54daa8e09d892dd2e2fc2b840f0705ad86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332120
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-10-24 21:38:42 +00:00
Devon Carew 540b3a899a [deps] rev dartdoc, lints, matcher, protobuf, tools, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (f7e9b17..53da3e1):
  53da3e1d  2023-10-23  dependabot[bot]  Bump actions/checkout from 4.1.0 to 4.1.1 (#3544)
  62d5469d  2023-10-23  Sam Rawlins  Support extension types in sidebars and categories (#3537)
  69abd0f0  2023-10-22  Sam Rawlins  Refactor file-gathering logic (#3539)
  e9c61d1d  2023-10-22  Sam Rawlins  Convert some late final fields to getters in Accessor, Annotation, Constructor (#3534)
  adcdc8b7  2023-10-20  Parker Lougheed  Update package:lints to v3 (#3542)
  41f02622  2023-10-19  Sam Rawlins  Greatly simplify ModelCommentReference (#3541)
  50e4b679  2023-10-19  Sam Rawlins  Remove use of NodeLocator2 (#3538)
  b2de813c  2023-10-19  Sam Rawlins  Remove support for deprecated leading new in comment references (#3529)
  b350c688  2023-10-19  Sam Rawlins  Bump to 7.0.1 (#3540)
  5256e2fb  2023-10-19  Sam Rawlins  Remove unused warnings (#3533)

lints (975c687..2cf8403):
  2cf8403  2023-10-23  Devon Carew  add no_wildcard_variable_uses; rev to a new major version (#165)
  7b0f556  2023-10-23  Parker Lougheed  Remove mention of no_wildcard_variable_uses from changelog (#164)

matcher (356e5f6..7512f80):
  7512f80  2023-10-23  Michael Goderbauer  Specify language in neverCalled docs for nicer formatting in docs (#230)

protobuf (050c162..3528fad):
  3528fad  2023-10-24  Ömer Sinan Ağacan  Use `setRange` when copying output chunks to the final buffer in `CodedBufferWriter` (#887)

tools (15cc9c7..da6bb18):
  da6bb18  2023-10-24  Elias Yishak  Enum + event constructors added for doctor events (#178)
  e3dd149  2023-10-24  Elias Yishak  Use futures list internally to manage send events (#184)

webdev (1bd434b..6e324af):
  6e324afb  2023-10-24  Ben Konyi  Add dependency on `package:vm_service_interface` (#2262)
  8429a79f  2023-10-20  Elliott Brooks  Only notify chatroom when daily stable testing fails (#2259)
  3463d169  2023-10-19  Elliott Brooks  Remove Chrome 115 extension error (#2258)
  fdebc06e  2023-10-19  Elliott Brooks  Reset Webdev to 3.2.0-wip after release (#2260)
  9cffb896  2023-10-19  Elliott Brooks  Reset DWDS to 22.1.0-wip after release (#2256)
  07c70c6c  2023-10-19  Elliott Brooks  Prepare Webdev for release to 3.1.0 (#2255)

Change-Id: Ieae3aadcc804a270867d7935b702987cf1f6d51c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332060
Reviewed-by: Elias Yishak <eliasyishak@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-10-24 20:32:48 +00:00
Sam Rawlins a6edca6db7 Only report unnecessary_cast when the cast type is exactly the static type
Fixes https://github.com/dart-lang/sdk/issues/44411
Fixes https://github.com/dart-lang/sdk/issues/48984
Fixes https://github.com/dart-lang/sdk/issues/49269
Fixes https://github.com/dart-lang/sdk/issues/49550
Fixes https://github.com/dart-lang/sdk/issues/52086

The "prefer type annotations on local variables over upcasting" that this used to cover can be covered with a new lint rule: https://github.com/dart-lang/linter/issues/3786

Change-Id: I6a112732269e918a7faacc399bccebe13de8462d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-10-24 19:55:39 +00:00
Nate Bosch 7ba47c6040 Remove some now unnecessary casts
Flow analysis has improved and issue #40041 is resolved. These
`FutureOr<T>` conditionals are promoting to `Future<T>` or `T` and no
longer need an explicit cast.

R=lrn@google.com

Change-Id: I925db6d7f52aad54c88434ff02e1d0ae4e72278b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331206
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-10-24 19:09:22 +00:00
Ryan Macnak dbc43757d0 [vm] Fix Windows build.
TEST=build
Change-Id: If243f875127430e27dd2b8821be412ae71e430e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332001
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-10-24 18:35:04 +00:00
Ben Konyi d0df26e11e Update webdev to 6e324afb1802ce25428c72871beb9c8faa19d036
Change-Id: Ia41c8220bace69d020066bad91d064b0692a9e7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332020
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2023-10-24 18:10:13 +00:00
Danny Tuppeny 5e255e0110 [dds/dap] Switch to using isGetter isntead of checking _kind
Both VM and DWDS populate isGetter now so we don't need to check this internal field.

There are existing tests verifying this behaviour.

Change-Id: Ia0f0d74167c718ec66a692523c1f255d63eed654
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330784
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-10-24 17:39:36 +00:00
Danny Tuppeny c5f60241a8 [dds/dap] Don't provide DAP sourceReferences for non-existing scripts
This adds a check that scripts exist before we create a sourceReference to assume we can download them.

I don't have a good way to test this (in the Dart SDK) because this never happens for Dart - we can always download the scripts. However this code is triggered in Flutter because of https://github.com/flutter/flutter/issues/128880 - we can't find the source so we will try to set it up for downloading.

Fixing that would avoid the need for this change (and make the behaviour more consistent with Dart), but in the meantime I think it's better that we don't produce sourceReferences for sources that don't exist.

Change-Id: I4de3f6e87fe3ff867a1ff7e6d3a5d79f7bf9fa1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330780
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-10-24 17:35:42 +00:00
Kenzie Schmoll 549c1eea11 Roll DevTools into SDK and bump to devtools_shared 5.0.0
Change-Id: I9c38d6be70816de14bb6b9818e6aa550b11c1a34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331748
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-10-24 17:09:20 +00:00
Keerti Parthasarathy 3c6ceb851a Add a pass to dart fix for pubspec changes
Fixes #48997

Change-Id: I543a550247920e121837f2bc6c75b5c1acecc670
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331740
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-24 16:44:07 +00:00
Keerti Parthasarathy 0323445167 Add extension type support for create method fix
Bug:49741
Change-Id: I8687dbf3fe0532bd04163a42104bbdddd0d173fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331742
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-24 16:43:30 +00:00