Commit graph

97105 commits

Author SHA1 Message Date
Jens Johansen cef9865586 [CFE/DDC] Fix leak caused by cached diagnosticReporter
In 8f4e5c8194 the `DiagnosticReporter` was cached in
`DevCompilerTarget` which introduced a memory leak.
Unfortunately our weekly bot that looks for leaks has been out of
commission, but is now coming back online.

This CL fixes the leak by overwriting the field every time, meaing we
don't save a reference to the first one (which is a leak).
Maybe ideally we shouldn't save it as a field at all, but that's a
potential for another day.

Change-Id: Ic740a212c436c475688a1de73c55a2344301e688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325260
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-09-12 06:11:28 +00:00
Zijie He 5282f6e33f [Fuchsia] Create CFv2 support
This change created a CFv2 build target and provided two
implementations of the FuchsiaEmulator, so that I can continually work
on both CFv2 build and test script integration independently.

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

Bug: #38752
Change-Id: I31936a2ca967fbfeb2bc5628e2f005aef6762687
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322583
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
2023-09-12 01:40:52 +00:00
Sam Rawlins 6f5606d442 Bump dartdoc to f5750f502fdbb887c93cd29aca1e573a92342c53
Change-Id: Iea45fb207114d9284fdba65857cea23f877c3b4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-09-12 00:31:40 +00:00
Sam Rawlins 84655ea85d analyzer: Move FileSystemEntity methods to FileSystemEntity
Change-Id: I029203dbca21e96e5e57d2b347b9577223d32b84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325324
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-11 23:54:30 +00:00
Kallen Tu f2e11bdeee [analyzer] Allow spreads between const lists and sets in the const evaluator
The change allows const lists to be in the spread of a const set and vice-versa. It also reports the correct error if we use a map in a list/set (and vice-versa) which is necessary when we combine all the error reporting in the `ConstantVisitor` to one location.

Adds some additional tests to make sure the behaviour we want is still working.

Change-Id: I0f64d58c857bd905ac8521346cd34a113b6d4a40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323780
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 23:39:30 +00:00
Keerti Parthasarathy 4a04ec3201 Wire up use of deprecated export.
Bug:48997
Change-Id: I440fb8ebfe63ae785571f7927c5cdab625eee0cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325363
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-09-11 23:24:19 +00:00
Sam Rawlins 02dba4189f linter: Move prefer_foreach tests
Change-Id: I0a6beae9d4983c8bef3445b569fc163c41f66faa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325361
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2023-09-11 23:17:30 +00:00
pq 2f90ee8cf1 validate @visibleForOverriding extension type targets
See: https://github.com/dart-lang/sdk/issues/53434

Change-Id: I931a7cdff990ca19f6ec3267340031ca5fa7b814
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325322
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 23:16:10 +00:00
Liam Appelbe d5555377ed Add changelog entry for NativeCallable
Bug: https://github.com/dart-lang/sdk/issues/53322
Change-Id: I458ea1a920f68e3de23008649748a24602bb5e0e
Fixes: https://github.com/dart-lang/sdk/issues/53322
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324180
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
Auto-Submit: Liam Appelbe <liama@google.com>
2023-09-11 22:25:06 +00:00
Tess Strickland 3f53d22d43 [vm/compiler] Create leaf runtime entry for memmove.
Instead of making a StaticCall to _TypedListBase.nativeSetRange
inside _memMoveN, make a CCall to the memmove leaf runtime entry.

Rename _TypedListBase._nativeSetRange to _setClampedRange, since
it's now only used when per-element clamping is necessary.

Fix the load optimizer so that loads of unboxed fields from freshly
allocated objects do not have the tagged null value forwarded
as their initial post-allocation value.

TEST=co19{,_2}/LibTest/typed_data lib{,_2}/typed_data
     corelib{,_2}/list_test
     vm/cc/LoadOptimizer_LoadDataFieldOfNewTypedData

Issue: https://github.com/dart-lang/sdk/issues/42072
Change-Id: Ib82e24a5b3287fa53099fffd3b563a27d777507e
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-kernel-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-release-x64-try,vm-aot-mac-release-arm64-try,vm-aot-msan-linux-release-x64-try,vm-msan-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-tsan-linux-release-x64-try,vm-linux-release-x64-try,vm-mac-release-arm64-try,vm-kernel-precomp-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324080
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-09-11 21:25:09 +00:00
Brian Quinlan 8a91749e42 Fix parsing of folded header field values.
Bug: https://github.com/dart-lang/sdk/issues/53227
Bug: https://github.com/dart-lang/sdk/issues/53185
Change-Id: Ibbdbdf9c8f2875e8f687244982810fffee20e69c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320920
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-09-11 21:13:58 +00:00
Ryan Macnak a4381f127c [vm, lib] Fix out-of-bounds access in BigInt.>>.
The library code and the intrisic code disagreed about the capacity of the result digits array. Compare similar adjustment for <<.

TEST=ci
Change-Id: I81395a242965d53de3a30f87637a6f1588300969
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325122
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-09-11 21:05:38 +00:00
Nicholas Shahan 1cce9b8052 [ddc] Avoid adding raw type parameters to type table
There is no need to add a single type parameter to the type table
because it is already represented as a local variable in the scope
where it appears.

Change-Id: I4553d54304a2e3b82e856b8511fdce81cda0653e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324901
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-09-11 21:00:47 +00:00
Jackson Gardner db214e8c81 Revert "[dart:js_interop] Re-enable type checks on external APIs"
This reverts commit 2a669c571f.

Reason for revert: Failing dart -> Flutter Engine roller. We need to make some changes on the engine side to prepare for re-enabling these checks.

Original change's description:
> [dart:js_interop] Re-enable type checks on external APIs
>
> External APIs when using dart:js_interop should only allow
> primitives, JS types, and other static interop types. This
> was previously checked in a more restrictive mode called
> "strict mode" but is not checked everywhere where dart:js_interop
> APIs exist.
>
> Change-Id: Ic82a3ec0bf6062c25d7f8933e503820a21bc191f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316867
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

Change-Id: I54caf06976e215b2b576cedfc0013ee79c6682f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324902
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-09-11 19:31:20 +00:00
Konstantin Shcheglov c47f1b02ab Augmentation. Support for top-level functions.
Change-Id: I5fff9739c8159678b63a393d5d4c00f55b45a007
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325125
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-09-11 19:08:12 +00:00
Nicholas Shahan 20c8756bc8 [ddc] Bump pubspec SDK constraint to 3.0.0
Update abstract classes into proper mixins since that how they are
used.

Change-Id: I8ce43f873a2aacab48d859de633f531f091e58e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325143
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-09-11 19:07:02 +00:00
Danny Tuppeny ccbc3d95dc [analysis_server] Add additional tests for file delete/create with overlays
Change-Id: Iec6a158f394611a84bce6e4bf107039fbf82241e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 18:26:15 +00:00
Danny Tuppeny f2eee8bf71 [analysis_server] Don't flush diagnostics for deleted files that have overlays
Fixes https://github.com/dart-lang/sdk/issues/53475

Change-Id: I5eaba2192e8d9d141cbee02f4c9bbe941db026f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325262
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 18:16:38 +00:00
Danny Tuppeny 3bf8a233a5 [analysis_server] Add a preview flag for surveys
Change-Id: Iaacdeb24a222df3cf6d730641c7c4cf7355f0f2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 18:08:06 +00:00
Danny Tuppeny c11697af90 [analysis_server] Migrate remaining LSP tests to new set() methods for capabilities
No functional changes, just flattening capabilities into using set...() methods instead of providing them inline to the `initialize` method.

Change-Id: I0182a7dfa6ad2a3b3d83519b7a90f296722d05b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324523
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 18:00:10 +00:00
Konstantin Shcheglov c3af85fe47 Augmentation. Support for fields.
Change-Id: I57a9975c3c6516a310fccd069a1231f139e58296
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325123
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-11 18:00:03 +00:00
Parker Lougheed f91a4cf1b0 [linter] Link to docs for more context on enhanced enums
Change-Id: Iacfda3ea97bfe7025f0d415f06ef2b342df37dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 17:52:07 +00:00
Parker Lougheed 08a1093cd4 [linter] Focus omit_local_variable_types on type itself
The lint was being reported on the entire expression, making it potentially hard to identify the source of the lint. This change moves the range to the type itself, now matching the existing behavior of the lint in for each loops.

Change-Id: Id4a7c487aadb6282515c7ef5bb0fd8ebf923d8eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 17:51:59 +00:00
William Hesse 979f5d097c [linter] Remove special handling of linter package in generate_package_config
The linter is moved from third_party to pkg, and the old copy has
been removed from DEPS for weeks now. Remove the workaround that
ignores an old copy of linter in third_party/pkg/linter.
Users who have updated without running gclient sync -D will
now get an error that they have two copies of the
linter package, and they will get a message that they should
run gclient sync -D when they run gclient sync.

This completes the migration of the linter package into the SDK
source repository.

This reverts most of https://dart-review.googlesource.com/c/sdk/+/321722
leaving a small refactoring cleanup in place.

Bug: https://github.com/dart-lang/linter/issues/4411
Change-Id: Id5cdb3485e42e78743303d64370bc9f7899ad00e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325301
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-09-11 17:18:05 +00:00
dependabot[bot] 79f650c4f8 Bump actions/upload-artifact from 3.1.2 to 3.1.3
Closes https://github.com/dart-lang/sdk/pull/53482

GitOrigin-RevId: 5044cd9750ccff25a4dfef3a680986bda3b16e9a
Change-Id: I5a1edba320c1e9eef1ecc2f499100d6f51857091
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325124
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-09-11 17:02:56 +00:00
dependabot[bot] d998492b9b Bump actions/checkout from 3.6.0 to 4.0.0
Closes https://github.com/dart-lang/sdk/pull/53483

GitOrigin-RevId: c1cb9106ffcb16dc9534172bf3354ad9954102cd
Change-Id: I66e543e1f9b7d784930cca736909dd0c327074e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325141
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-09-11 17:02:40 +00:00
Jake Macdonald 0ffd54738a add declarationKind for extensions and libraries, support augmenting extensions and add test
Change-Id: I510976cac641800e664e92e7db786962d539ec9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325021
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2023-09-11 15:56:23 +00:00
Parker Lougheed 0ac6f0846a [analyzer/linter] Remove linter rule maturity
Change-Id: I08a064acf5911ea20d1e3a90e9e54b5837296540
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325160
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-11 15:30:02 +00:00
Johnni Winther 4c1a94c0d3 [cfe] Embed tearoff in Extension(Type)MemberDescriptor
This simplifies handle the constructor/member and its corresponding
tearoff as a pair. Also it prepare for supporting tearoff of
extension type constructors and methods with the same name.

TEST=existing

Change-Id: Iea6cbc0250c8df6bd0f825068c1f3e865d938427
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324202
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-09-11 13:35:10 +00:00
Ömer Sinan Ağacan 5865e6db9f [dart2wasm,smith] Add options support in test_matrix.json, jscm builder
- Add dart2wasm_options syntax to test_matrix.json.

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

Change-Id: I32642e932f1d4a8a74b5b75f7783117520d51f02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322281
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-09-11 10:50:22 +00:00
Jens Johansen c49f87382b [vm] Use specialized int set in heap snapshot tool
Currently the heap snapshot tool uses a regular Set<int> for storing
ints between 0 and the number of objects (n).

This CL instead introduces a specialized int set backed by a Uint8List
where each bit represents a number between 0 and n.

This specialized set is then created to fit the number of objects, so
even an empty set takes the same amount of space as a full set: about
125 kb per million possible values (or ~6 mb per 50 million).

For small sets thats a lot worse than before, but for big sets it's a
lot better. Runtime is also a lot better.

"Benchmarks" on a snapshot that's ~1.5GB:

Runtimes:

Before:
closure roots (or all after the first one): ~30s, ~19s, ~20s
eval and: ~5.5s, ~6.3, ~5.6
eval or: ~7.3s, ~6.5s, ~6.4s
eval minus: ~4.5s, ~6.4s, ~6.5s

With CL:
closure roots (or all after the first one): ~7.7s, ~4.3s, ~4.1s
eval and: ~0.2s, ~0.3s, ~0.2s
eval or: ~0.6s, ~0.6s, ~0.6s
eval minus: ~0.3s, ~0.2s, ~0.3s


Memory usage:

Before:

after loaded:
$ grep -E "VmPeak|VmSize|VmRSS" /proc/588700/status
VmPeak: 10293036 kB
VmSize:  9896880 kB
VmRSS:   9260604 kB

after all = closure roots
VmPeak: 12354840 kB
VmSize:  9529612 kB
VmRSS:   8898088 kB

after 2 x closure all
VmPeak: 13068580 kB
VmSize: 12478236 kB
VmRSS:  11891620 kB

after 3 x eval and
VmPeak: 18377540 kB
VmSize: 18376520 kB
VmRSS:  17803032 kB

after 3 x eval or
VmPeak: 19621712 kB
VmSize: 18114376 kB
VmRSS:  17491808 kB

after 3 x eval minus
VmPeak: 21522780 kB
VmSize: 21522272 kB
VmRSS:  20907724 kB


With CL:

after loaded:
$ grep -E "VmPeak|VmSize|VmRSS" /proc/594718/status
VmPeak: 10293560 kB
VmSize:  9967036 kB
VmRSS:   9323404 kB

after all = closure roots
VmPeak: 10293560 kB
VmSize:  9805272 kB
VmRSS:   9137364 kB

after 2 x closure all
VmPeak: 10868740 kB
VmSize: 10867208 kB
VmRSS:  10199784 kB

after 3 x eval and
VmPeak: 10906236 kB
VmSize: 10905728 kB
VmRSS:  10238424 kB

after 3 x eval or
VmPeak: 10925496 kB
VmSize: 10924988 kB
VmRSS:  10257388 kB

after 3 x eval minus

VmPeak: 10944756 kB
VmSize: 10944248 kB
VmRSS:  10276672 kB
Change-Id: I8d0b65fa51ac2bd4696c4d2782c4423966a7fbae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324682
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-09-11 10:48:46 +00:00
Tess Strickland 959f21ab40 [vm/compiler] Use a block size of 16 bytes for ARM64 MemoryCopy.
TEST=vm/cc/IRTest_Memory, co19{,_2}/LibTest/typed_data,
     lib{,_2}/typed_data, corelib{,_2}/list_test

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

Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-aot-linux-release-simarm64-try,vm-aot-mac-release-arm64-try,vm-linux-release-simarm64-try,vm-mac-release-arm64-try,vm-aot-android-release-arm64c-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-linux-debug-simriscv64-try,vm-linux-release-simarm-try
Change-Id: Ife645a1d09be862d74e198162b124e657878280a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324683
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-09-11 09:24:19 +00:00
Vyacheslav Egorov 00d883f459 [vm/compiler] Improve integer equality comparisons
Consider for example the following two functions

    f0(int value) => value == 0 ? ... : ...;
    f1(List<int> list) => list[0] == 1 ? ... : ...;

before this change we would produce a `BoxInt64(value)` followed by
`StrictCompare` in `f0` and `UnboxInt64` followed by `EqualityCompare`
in `f1`. However the decisions should be reversed: when comparing
unboxed values we should lean on `EqualityCompare` and when
comparing boxed values when smis are involved we should lean
on `StrictCompare`.

This change adjusts specialization and canonicalization rules to achieve
that: we prefer to emit `EqualityCompare` when specializing and then
add rule to collapse it back into `StrictCompare` if we discover that
is going to be more optimal (e.g. allows to avoid boxing).

TEST=vm/dart/aot_prefer_equality_comparison_il_test

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-android-release-arm64c-try
Change-Id: I953a346f22702debc61b84b745d2a9fab58a9ca5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324981
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-09-11 07:56:47 +00:00
Nate Biggs b6e3c5cffd [dart2js] Sort holders before emitting them.
When serializing JS, we can sometimes end up changing the order we visit ModularExpressions. This can mean their indices are not stable against serialization and so the emitted code (and as a result hashes for that code) can change if the compiler did any serializing during the compilation.

We can make the order stable by sorting the holders before we process them.

This removes diff in hashes when running this (`--test-mode` forces serialization):
```
out/ReleaseX64/dart-sdk/bin/dart compile js benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart --out=om1a/m.js
out/ReleaseX64/dart-sdk/bin/dart compile js benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart --test-mode --out=om1b/m.js
```

Bug: https://github.com/dart-lang/sdk/issues/53466
Change-Id: Ibec88ff6acb71f1e96cbdb1d5ef4200d370cc3c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325100
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2023-09-09 01:50:52 +00:00
Paul Berry 1c6c8ef94d Ignore TODO in pkg/linter.
The analyzer team has decided to adopt the convention of using `TODO`
comments to document long term issues that should persist in the
codebase, and `FIXME` comments to document short term issues that need
immediate attention.  They may even consider adding a presubmit hook
to ensure that `FIXME` comments are only used during local
development.

Accordingly, it makes sense to suppress `TODO` comments from being
surfaced to the IDE "problems" view (since there are hundreds of them,
and they're not immediately actionable).  This makes VSCode's
"problems" view much more usable in "tree" mode.

(See also https://dart-review.googlesource.com/c/sdk/+/295662, which
made the corresponding change to the `analysis_server` and `analyzer`
packages).

Change-Id: I68734fdfc051ffe434c1ffc709e8b686f571d2c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325121
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-08 21:03:47 +00:00
Devon Carew 1fc52e514f [deps] revert bump of package:leak_tracker
Change-Id: I9cc16840391153ec735f95cafe3f9080335b0324
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325120
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-09-08 19:46:28 +00:00
Nate Biggs a503edf481 [cfe] Fix kernel (de-)serialization missing field offset on FieldInitializer.
We are experiencing diffs in Dart2JS source maps in `--test-mode` which does a serialization round trip. JS that should map to default parameters is instead mapping to the surrounding `Constructor` member since the FieldInitializer's offset is getting dropped.

This is affecting any Dart2JS split action build since those all end of serialiaing and deserializing the kernel. Any other tools using this serialization would also be affected.

TEST=Existing/will add in follow up.

Bug: https://github.com/dart-lang/sdk/issues/53466
Change-Id: Ibeccf9153c78e6c358806c7ded4dbc2dea49d8e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325020
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-09-08 18:53:39 +00:00
Nicholas Shahan 027f57227f [ddc, dart2js] Add results cache to isSubtype
Optimize repetitive calls to isSubtype with a caches to store pairwise
results.

There are currently two caches for sound and unsound results but in the
future that can be combined into a single cache once the library is
aware of error reporting. That single cache could stores "pass", "fail", 
or "fails when sound mode but passes in unsound null safety".

Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: I49e5794703fd58f1b2bba50e426e25146800fbb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323707
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-09-08 18:39:53 +00:00
Kenzie Schmoll 2ed87ffb02 Update DevTools rev to adfb08c95c626248b28cc60df3b085c12ad8758e
Change-Id: Ieda1de59dec0ba68b01ec0893c43c6c4015fe58e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324770
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-09-08 18:32:51 +00:00
Konstantin Shcheglov 2a758931aa Extension type. Fixes for activating rename refactoring.
Change-Id: Ie275fbb94789878ca96302635677823f24242284
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325080
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-08 18:13:51 +00:00
pq 8a5ddecfb3 + extension type target kind (and @optionalTypeArgs support)
Adds a new TargetKind for extension types and adds it to `@optionalTypeArgs`.

Change-Id: I7254c1299c296451b9adc5d1f8eceb50af66f039
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324769
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-08 18:09:01 +00:00
pq dd970ba17e de-duplicate mocked package:meta
(We should do the same for `package:flutter` but that will likely require some updates to the version stored in server.)


Change-Id: I262886a3522e19f86a7ba4ae46a50c48090c8d95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-09-08 18:05:48 +00:00
Devon Carew d6200f801e [deps] rev dartdoc, leak_tracker, lints, native, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (a32ba3a..adc76e6):
  adc76e6d  2023-09-06  Parker Lougheed  Take advantage of a few Dart 3 features (#3491)

leak_tracker (098bafc..4616c8b):
  4616c8b  2023-09-05  Polina Cherkasova  Note about OverlayEntry. (#142)
  fd7d70f  2023-09-01  dependabot[bot]  Bump actions/checkout from 3.5.3 to 3.6.0 (#141)
  c6c1004  2023-09-01  Polina Cherkasova  - (#139)
  0298e20  2023-08-31  Polina Cherkasova  Add a test specific rule. (#138)
  ea17fa4  2023-08-29  Polina Cherkasova  Increase version of leak_tracker_flutter_testing (#136)
  8f830d6  2023-08-29  Polina Cherkasova  Update pubspec.yaml (#135)
  8a54575  2023-08-29  Polina Cherkasova  Enable connection to vm service for flutter testing and define matcher for reporting for memory
allocations. (#128)
  88a19a7  2023-08-28  Polina Cherkasova  - (#133)
  2070856  2023-08-24  Polina Cherkasova  Add instruction to start tracking instances of ChangeNotifier earlier. (#130)
  eb6113a  2023-08-23  Polina Cherkasova  Measure how memory is consumed by a test. (#114)
  72264f7  2023-08-22  Polina Cherkasova  Fix misspelling. (#131)
  87c9e9e  2023-08-16  Polina Cherkasova  Add debugging construcstors to LeakTrackingTestConfig, per leak type. (#129)
  b29547a  2023-08-15  Polina Cherkasova  Create visibility for roadmap for leak_tracker. (#124)
  23b15b6  2023-08-15  Polina Cherkasova  Fix issue of using wrong settings for a phase. (#122)
  713f646  2023-08-11  Polina Cherkasova  Enable global configuration for leak tracking. (#121)
  19b01cf  2023-08-10  Polina Cherkasova  Create package leak_tracker_flutter_testing. (#119)
  02d0b2f  2023-08-07  Polina Cherkasova  Stop failing if object is disposed twice. (#117)
  2026379  2023-08-04  Polina Cherkasova  Remove not-published versions and increase leak_tracker version. (#116)
  9bb71c6  2023-08-04  Polina Cherkasova  Stop requiring registration of disposed objects. (#113)
  8939456  2023-08-04  Polina Cherkasova  Refactor dispatcher. (#115)
  6f54f5a  2023-08-01  Polina Cherkasova  Start vm service when needed. (#112)
  b045c5e  2023-08-01  Polina Cherkasova  Reorganize leak tracker for better performance. (#106)
  127b83c  2023-07-31  Polina Cherkasova  Update TROUBLESHOOT.md (#108)
  6dabd33  2023-07-31  Polina Cherkasova  Simplify and clarify instructions to fix leaks. (#107)
  c53db68  2023-07-25  Polina Cherkasova  Improve code structure. (#103)
  10cce1a  2023-07-24  Polina Cherkasova  Rename `gcCountBuffer` to `numberOfGcCycles`. (#101)
  3a061a4  2023-07-21  Polina Cherkasova  Improve doc comments. (#100)
  6e3f57c  2023-07-21  Polina Cherkasova  Fix and test cover case of customized `gcCountBuffer` (#99)
  2152aab  2023-07-21  Polina Cherkasova  Add details about hidden leaks. (#97)

lints (da44af3..8d5f750):
  8d5f750  2023-09-06  Devon Carew  move the list of lint rules from the readme to a separate rules.md file (#145)

native (a2dfedc..387f894):
  387f894  2023-09-06  Gabriel Terwesten  [native_toolchain_c] Default handling for PIC/PIE compiler flags (#121)
  0a4e5f8  2023-09-06  Gabriel Terwesten  Add support for defines to `CBuilder` (#120)

webdev (fc876cb..9487a45):
  9487a459  2023-09-05  Jacob Bang  Update README.md to use `dart pub` instead of `pub` (#2195)
  07367779  2023-08-31  Elliott Brooks  Pass the package config directly to the load strategy instead of depending on an app entrypoint
(#2203)
  0044d753  2023-08-24  Jonas Termansen  Fix conflicting webdev smoke package names. (#2202)
  6183f270  2023-08-23  Elliott Brooks  Allow client to specify a way to convert an absolute path into a g3-relative path (#2200)
  b244b899  2023-08-22  Elliott Brooks  Allow client to specify how to find the package config  (#2199)

Change-Id: Ic00adc68ec01cd0cc6e27be665436de5095d8d07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324801
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-09-08 16:51:40 +00:00
Daco Harkes 01b1291d54 [tool] generate_idefiles sanitizer argument
Change-Id: I6f93fdbce8f4cef6c606e8b43ae9e1e888772292
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325000
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2023-09-08 15:49:28 +00:00
Brian Wilkerson b8a89b66a6 Initial support for code completion in extension type declarations
Change-Id: I6acb71d0ac282135b6527431b162fad9a0dee8f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-08 14:30:20 +00:00
Johnni Winther 1da590fc3f Fix type promotion of late final fields on DDC and dart2wasm.
When the CFE compiles code for DDC or dart2wasm, it lowers late final
fields to synthetic getters. In order to ensure that accesses to these
fields can still be type promoted, a flag is added to the kernel
`Procedure` class, to indicate that a getter was produced by lowering
a late final field. When deciding whether a property access is
promotable, the CFE checks this flag; if it's set, it treats the
getter like a field.

Includes a language test validating the fix.

Fixes https://github.com/dart-lang/sdk/issues/53462.

TEST=tests/language/inference_update_2/late_field_test.dart

Change-Id: I98b81f04a3342d851060e5b2a7265323b93bb4e3
Bug: https://github.com/dart-lang/sdk/issues/53462
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324767
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-09-08 14:02:00 +00:00
Johnni Winther fefa87d1e6 [cfe] Make DartTypeVisitor(1) a pure interface
This splits DartTypeVisitor(1) into a pure interface and a
DartTypeVisitor(1)DefaultMixin with the base implementation. This is
a step towards avoid having an accidental default implementation where
a static error would have been preferable.

TEST=existing

Change-Id: Ieea9a773a9b70897a2db10cff8d721831a702a8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324780
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-09-08 11:59:41 +00:00
Johnni Winther e401b6f18a [kernel] Add sealed classes GenericDeclaration and GenericFunction
This adds a typed `TypeParameter.declaration` property to be used
instead of the `parent` property. The `declaration` property holds the
declaration (Class, Method, Extension, etc.) that introduced the
type parameter. `GenericFunction` is the subset of `GenericDeclaration`
that is defined through a `FunctionNode`.

TEST=existing

Change-Id: Ie89e7f5fa12a7966507a250cacc098eb0ce6b30b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323160
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-09-08 08:32:25 +00:00
Keerti Parthasarathy 5b44717c63 Fixes for organize imports
- consider prefix when sorting
- remove duplicates
- ignore comment if there is a line break

fixes b/299271413, b/299270948, b/299272871

Change-Id: I0e5e72ae0d326042ee1bec777189c645a52e9ed7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324840
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-08 04:50:15 +00:00
Ryan Macnak ac22e72d59 [test] Mark RISC-V pass-struct-by-value tests to avoid flaky status changes.
Bug: https://github.com/dart-lang/sdk/issues/48645
Change-Id: I3729c7df81ad2089224bf886a8c5345cc857f026
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324764
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-09-08 01:17:30 +00:00