Commit graph

97792 commits

Author SHA1 Message Date
Sigmund Cherem c439c97b80 [web] improve requestanimationframe test.
This test is flaky and causes timeouts 70% of the time in DDC.

The reasons are not clear at the moment, but I noticed that the
test was not properly using async-helper. This change may help
improve our investigation in the near future.

Change-Id: I834265dd6b898098ee7d5210ffe68ef0a6db74a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332280
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-27 01:56:08 +00:00
Sigmund Cherem 7cf0603208 [web] delete element_animate_omit_timing_test.
This test is 61% flaky in dart2js-chrome and 73% flaky in DDC.

This test is almost identical to
lib/html/element_animate_simple_timing_test (long ago it was a separate
case in the same file that used the html multi test configuration). The
only difference is that this test has no deadline for the animation to
complete, while the other test (which passes consistently) does.

My theory is that not including a deadline is the cause of flakiness and
without it, there isn't ,uch we can control to recover consistency. As
such, I don't think we should be including this test anymore.

Change-Id: I5451dbc7053ba0280a64e1bef2e03cc20465ad88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332170
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-27 01:54:25 +00:00
Stephen Adams cb52932c72 [tests, dart2js] Fix test using minified type names
1. Add `Object` and `Map` to the very short list of names that are
unminified in the app.

2. Tweak test to avoid testing minified name.

Change-Id: Ide0cedc2950b5392eb6963403a48c0f89cd1b50a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332368
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-10-27 01:36:28 +00:00
Stephen Adams 8ee403e86c [tests] Fix some tests for web numbers and dart2js production mode
Change-Id: I05a1814f2a2c5810f75708ba72bfafe137122f67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332486
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-10-27 01:16:28 +00:00
Stephen Adams e19e4bfaaf [tests/io] Avoid use of deprecated unmodifiable typed data view constructor
Issue: 53785
Change-Id: I47c854c1eafec8ffee30852a94eb6183c222442a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332264
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-10-26 22:46:39 +00:00
Konstantin Shcheglov 335aec593f Extension type. Issue 53868. Report an error when inherit a method and setter.
Bug: https://github.com/dart-lang/sdk/issues/53868
Change-Id: I5e79cef42453647797a89bed21cac46a318a0f4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332443
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-26 22:13:22 +00:00
Stephen Adams abf89a6803 [tests, dart2js] Make stack-trace tests work on dart2js
Change-Id: I0986f83f5dcc61e285d1f025449ddd0ed8961a0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332520
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-10-26 21:53:29 +00:00
Ben Konyi 5b390028f6 [ package:vm_service ] Migrate most of the Observatory expression evaluation tests
Change-Id: I2375d829aa8505dc0b69e5ce676dc9d983267bc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332122
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-10-26 21:43:48 +00:00
Devon Carew 29979649bd [analyzer] simplify the libraries.dart file
Cleanup and re-landing of https://dart-review.googlesource.com/c/sdk/+/317803.

Change-Id: I9fd679fdb111895ce662ecbe6d0fc5844909c3bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332441
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-10-26 21:43:31 +00:00
Sigmund Cherem 8f4d4391e1 [web] delete file_sample_api_test - a flaky and obsolete test.
This test has non-deterministic failures (rate 30% on mac, 10% on linux
and windows) caused likely by a data-race ([example log][1]). The test
has a write to set the contents of a file, and a corresponding read. The
error makes it appear as if the read occurred before the write
completed.

This API is part of the [createWriter][2] proposal, which was abandoned
early on (almost a decade ago) and documented as deprecated. As a result
I believe this test is providing coverage for obsolete functionality.
In fact, the API for the `write` returns void and appears synchronous,
but my guess is that it is not. There is no API to ensure the write
completes as far as I know. An alternative here would be to use timers
to add a significant delay between the operations.

It is also worth noting that the [requestFileSystem][3] API to access
the FileSystem (used here and in the fileapi tests) is also deprecated
and not supported in firefox or safari.

Given the flakiness issue and the fact that this API is already
deprecated, I'm not really seeing the value in keeping the test.

[1]: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8767600632278735009/+/u/test_results/ignored_flaky_test_failure_logs
[2]: https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry/createWriter
[3]: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestFileSystem

Change-Id: I92ad6399218c6a17cfa029a99b99afcfadde0035
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332282
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-10-26 20:52:19 +00:00
Konstantin Shcheglov cbc21d2738 Issue 53861. Use specific element kind name instead of generic 'class'.
Bug: https://github.com/dart-lang/sdk/issues/53861
Change-Id: Iea029c612da0c2556ecb29500f30573014f5b7ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332366
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-10-26 20:31:53 +00:00
Sam Rawlins 716b127a1a linter: ubcs: account for when clauses in if-like nodes
Fixes https://github.com/dart-lang/linter/issues/4795

Change-Id: I4cce15ddaf8a669921646fa81dd0e455859e46e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332361
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-26 19:56:58 +00:00
pq 95c40c924a introduce context_locator2 scaffolding
Straight copies of existing compilation units.

Change-Id: Icfe43f4eeb6363de6e048799746ee7911a8895df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-10-26 19:43:38 +00:00
Keerti Parthasarathy 334cb78156 Add a test for monorepo
Change-Id: I8405c0244c42640696767f0ac1ec31559c07e18a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332364
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-10-26 19:31:13 +00:00
Ryan Macnak 7c5b404eaf [build] Fix Windows linker warning about unrecognized flag.
Change-Id: Iac7536450998f5f841e56ee57e60b36c4e71dabd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332442
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-10-26 19:23:20 +00:00
Konstantin Shcheglov 059db5cb97 Extension type. Issue 53866. Allow the representation type to be the subtype of implemented extension type.
Bug: https://github.com/dart-lang/sdk/issues/53866
Change-Id: Ic3ac0556695c8ffbb8a4545777ea07a8b52c1e76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332363
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-10-26 19:23:11 +00:00
Robert Nystrom a096d44753 Roll latest dart_style into the SDK.
This adds support for formatting extension types. It doesn't change any
other formatting except for an exceedingly rare edge case of trimming
trailing whitespace from the first line of multi-line strings.

There is no need to coordinate this with a new pre-built SDK.

Change-Id: Ifd52f9901ba1597ce883c42d6a21329d87936c05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332365
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-10-26 19:07:23 +00:00
Danny Tuppeny 6299529e39 [analysis_server] Try to deflake will_rename_files test
Can't repro the failure locally this time, but my feeling is that maybe the overlay is being applied before the refactor starts. This adds pumpEventQueue to allow the refactor to start before sending the overlay change.

Change-Id: I8078b4cfe000d4155b965a384dbf116ef176fd48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332208
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-10-26 18:34:32 +00:00
Konstantin Shcheglov 49ef0be2bc Add ElementKind.MIXIN, use it for MixinElement.
Change-Id: Ie95c6c331ff437c4d6b99bfc7f9a3109f47c985b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332460
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-10-26 18:27:39 +00:00
Devon Carew afa7842594 Bump tar to 3383397b082c084c327587a293591fac74bc8af3
Changes:
```
> git log --format="%C(auto) %h %s" 748f6e6..3383397
 https://dart.googlesource.com/external/github.com/simolus3/tar.git/+/3383397 Prepare to release 1.0.2

```

Diff: 748f6e6802..3383397b08/
Change-Id: I9df8ba3aa3d1b4486275db031757721a1b29c92b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332080
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-10-26 17:58:16 +00:00
Tess Strickland 93b84b5b52 [vm/compiler] Simplify range analysis for IntConverter.
We can simplify and improve the range analysis in IntConverter if we
generalize based on the sizes and signs of the source and target
representations and whether the operation truncates or deoptimizes.

Adds RepresentationUtils::MinValue() and ::MaxValue(), which return the
minimum and maximum value (as an int64_t) for an unboxed integer
representation.

TEST=ci

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,vm-win-release-x64-try,vm-gcc-linux-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm-try
Change-Id: Ic8dc0d58059e30d85fb2816e15ab3c19fbee461c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332203
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-10-26 17:39:49 +00:00
Stephen Adams 163bd370a0 [tests, dart2js] Make test conditional on dart2js mode
Change-Id: Ibc1a99b4ad95e3df3b6fd85715cd8f0218235771
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332300
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-10-26 17:18:28 +00:00
Tess Strickland 56a17a3e85 [vm/tests] Fix vm/dart/regress_306327173_il_test for ASAN.
TEST=vm/dart/regress_306327173_il_test

Fixes: https://github.com/dart-lang/sdk/issues/53870
Cq-Include-Trybots: luci.dart.try:vm-asan-linux-release-x64-try,vm-aot-asan-linux-release-x64-try
Change-Id: I0f507175ad48c88294b626285b5025763c235b17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332420
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-10-26 17:03:18 +00:00
Nicholas Shahan 6bafe2fbf7 [dart2js] Seal Object prototype in browser tests
Ensures there is no dependency on modifying the native JavaScript
Object prototype by preventing modifications when running browser
tests.

Change-Id: Ifb22018736f90b339b9c60bbab095fb3e1c483e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320842
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-10-26 17:00:21 +00:00
Nate Biggs 23282457ad [dart2js] Small improvements in emitting JS.
- Remove unused Map in source map emitter logic.
- Buffer output writing for both JS and source maps. Previously we were only buffering the source map writes.

During local compilations of a large program combined these amount to a >100MB improvement in memory usage.

Change-Id: I633c2f81aa28744e30c6a706bb3927423b38a6e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331361
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-10-26 16:00:51 +00:00
Keerti Parthasarathy ed1842480c Revert "Add a pass to dart fix for pubspec changes"
This reverts commit 3c6ceb851a.

Reason for revert: This breaks flutter tests - running dart fix in the flutter_svg package adds a flutter_svg: any dependency line to pubspec.yaml.

Original change's description:
> 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>

Change-Id: I38a234b558d03c6c5c6c00f9ea55db7e1fbc7a89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332171
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-10-26 15:15:19 +00:00
Michael Thomsen d96c71b1f9 Link to dart fix docs
Change-Id: Ifc2f5c49744d796cb91d6fb207e799d5086c8a75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332207
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-10-26 14:13:43 +00:00
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