Commit Graph

107624 Commits

Author SHA1 Message Date
Tess Strickland 38ea3a8f5e Revert "[vm, gen_snapshot] Add app-aot-macho-dylib option for AOT snapshots."
This reverts commit 38ef28a058.

Reason for revert: Breaks build on debug mode 32-bit arches,
                   release mode simarm_x64

Issue: https://github.com/dart-lang/sdk/issues/60307
Original change's description:
> [vm, gen_snapshot] Add app-aot-macho-dylib option for AOT snapshots.
>
> This is the initial framework for creating snapshots as Mach-O dynamic
> libraries. Note that this framework is not 100% feature complete
> compared to generating Mach-O snapshots via assembly. In particular,
> the directly-compiled Mach-O dylib does not yet contain compact
> unwinding information.
>
> Other changes:
>
> * Adds UuidCommand to the native_stack_traces package's Mach-O reader,
>   which now appropriately returns the UUID as the build ID for Mach-O
>   shared objects.
>
> * Adds Utils::Basename(path) for portably retrieving the basename
>   from a path. (Returns nullptr for all arguments where it is not
>   currently implemented on Fuchsia or Windows.)
>
> * Adjusts vm/timeline.h to avoid pulling in <mach_o/loader.h> on MacOS,
>   as that interferes with uses of the namespaced Mach-O definitions
>   in platform/mach_o.h.
>
> * Only attempt to dlopen() a snapshot if ELF is the native format
>   for the host platform or the snapshot is not an ELF shared object.
>   If dlopen() is used, report the error message if it fails rather
>   than attempting to manually load the snapshot as an ELF shared object.
>
> * Fix the magic number stored in DylibAppSnapshot for loaded non-ELF
>   dynamic libraries.
>
> * Remove the detection of reverse-endian Mach-O magic numbers in
>   DartUtils::SniffForMagicNumber(), since all our Mach-O related code
>   assumes host-endian Mach-O files and so there's no point other than
>   to give a slightly better error message when failing.
>
> TEST=vm/dart/exported_symbols_test
>      vm/dart/unobfuscated_static_symbols_test
>      vm/dart/use_dwarf_stack_traces_flag_test
>      vm/cc/CanDetectMachOFiles
>
> Issue: https://github.com/dart-lang/sdk/issues/60307
> Change-Id: Idf5b49d6c6d035ab033509613212b95520d65965
> Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-mac-release-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415020
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

Issue: https://github.com/dart-lang/sdk/issues/60307
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-mac-release-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Iff2ab4c84a513a184784129f456bd357ae8e3a67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431220
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
2025-05-27 01:05:48 -07:00
Martin Kustermann 8ddfcbd396 [dart2wasm] Use String as return type of Record_<X>.toString()
This will ensure selector computation for `toString()` selector will
use more precise type.

Change-Id: I668197e58d25ac225fd8428dfaa5093e9090de2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431041
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-05-26 12:16:21 -07:00
Derek Xu fe46d2089f [package:vm_service] Add dot_shorthands_test
Fixes: https://github.com/dart-lang/sdk/issues/59875
Change-Id: I2653a6473a00cbf89b26872c7e50a34e6d486a22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431120
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2025-05-26 10:43:59 -07:00
Tess Strickland af5221f442 [test_runner] Convert boolean use-elf to an enum gen-snapshot-format.
Currently, the configuration code only has a boolean option, 'use-elf'
for specifying the output format for gen_snapshot. If false, then the
output format is assumed to be assembly.

Add a new GenSnapshotFormat enum and replace the old 'use-elf' option
with a new 'gen-snapshot-format' option. The new enum has two getters:

* snapshotType returns the appropriate string to pass to gen_snapshot
  via the '--snapshot-type' option.
* fileOption returns the name of the option used to specify the
  output path for the given format.

In addition, make it so the Configuration only has a non-null
genSnapshotFormat field if the compiler is Compiler.dartkp to avoid
spurious differences in Configurations that are created with different
GenSnapshotFormat values when the configurations in question don't
actually call gen_snapshot.

TEST=pkg/smith/test/configuration_test.dart (and the CI in general)

Change-Id: I7f17dc8d3a1bb6d4bf57750bc5ef4a16b8a78c11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429980
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-05-26 08:53:03 -07:00
Tess Strickland 38ef28a058 [vm, gen_snapshot] Add app-aot-macho-dylib option for AOT snapshots.
This is the initial framework for creating snapshots as Mach-O dynamic
libraries. Note that this framework is not 100% feature complete
compared to generating Mach-O snapshots via assembly. In particular,
the directly-compiled Mach-O dylib does not yet contain compact
unwinding information.

Other changes:

* Adds UuidCommand to the native_stack_traces package's Mach-O reader,
  which now appropriately returns the UUID as the build ID for Mach-O
  shared objects.

* Adds Utils::Basename(path) for portably retrieving the basename
  from a path. (Returns nullptr for all arguments where it is not
  currently implemented on Fuchsia or Windows.)

* Adjusts vm/timeline.h to avoid pulling in <mach_o/loader.h> on MacOS,
  as that interferes with uses of the namespaced Mach-O definitions
  in platform/mach_o.h.

* Only attempt to dlopen() a snapshot if ELF is the native format
  for the host platform or the snapshot is not an ELF shared object.
  If dlopen() is used, report the error message if it fails rather
  than attempting to manually load the snapshot as an ELF shared object.

* Fix the magic number stored in DylibAppSnapshot for loaded non-ELF
  dynamic libraries.

* Remove the detection of reverse-endian Mach-O magic numbers in
  DartUtils::SniffForMagicNumber(), since all our Mach-O related code
  assumes host-endian Mach-O files and so there's no point other than
  to give a slightly better error message when failing.

TEST=vm/dart/exported_symbols_test
     vm/dart/unobfuscated_static_symbols_test
     vm/dart/use_dwarf_stack_traces_flag_test
     vm/cc/CanDetectMachOFiles

Issue: https://github.com/dart-lang/sdk/issues/60307
Change-Id: Idf5b49d6c6d035ab033509613212b95520d65965
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-mac-release-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415020
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-05-26 08:52:26 -07:00
Chloe Stefantsova 6fa858cfe8 Enable 'getter-setter-error' flag in 3.9
TEST=existing

Change-Id: Ic4a5735adda7cf8ef1565b9356ca277d9b62b064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430720
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-05-26 08:08:31 -07:00
Chloe Stefantsova 4ff0b6426e [model] Add missing headers to unit test files in the CFE
Change-Id: I396bbe38dcc4cc65b4758458d6329cf26b31f09d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431040
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-05-26 08:07:24 -07:00
Ben Konyi aa65549771 [ DAP ] Handle incorrect RPCError returned by DWDS when an isolate is destroyed mid RPC.
Related issue: https://github.com/flutter/flutter/issues/156793

Change-Id: I5da61e9fe5d0aebfe851777a14196af165b8b1a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431060
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2025-05-26 07:26:40 -07:00
Johnni Winther 653502e4cb [analyzer] Compute default types for local functions
Default types are used in the exhaustiveness computation but were not
computed for local functions, leading to a crash during constant
evaluation. This adds computation of default types to
FunctionDeclaration and FunctionExpression.

Closes #54388
Closes #60264

Change-Id: I95eb2ae5b42e4fb5ab77088c915fe6088a1d4060
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427702
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-05-26 01:23:49 -07:00
Johnni Winther 651206e867 [analyzer] Add default type to ResolvedAstPrinter
This includes the default type of TypeParameterFragmentImpl. This is
done to enable direct testing of the changes in
https://dart-review.googlesource.com/c/sdk/+/427702

Change-Id: Ie36e717fed141ad4e532f4a7637aef8944b41ba1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430381
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-26 01:23:49 -07:00
Johnni Winther 9be682a950 [analyzer] Support ?.length on null
This adds support for constant evaluation of null aware access of length
on null. Null aware access of length on String was already supported in
both analyzer and CFE, and the spec has been updated to support it.

Closes #60509

Change-Id: Ie7e26d3e969bc82f5c65147f243350fbf4c68e67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429921
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-26 00:27:32 -07:00
MarkZ b4ac0a183b Adding support for non-hot-reloadable packages in DDC.
These packages can be specified with the `non-hot-reloadable-package` flag and will be compiled without their members being properly hot reloadable. In exchange, we can perform additional optimizations (such as avoiding levels of indirection/checks in anticipation of their being updated).

This additionally overhauls our memory compiler to use the incremental compiler for proper state-passing hot reload testing + adds tests for this functionality.

Change-Id: Ief65896410f32655f064bd15728703629faa4051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428343
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2025-05-23 17:37:20 -07:00
Nate Biggs e3e82c95cb [dart2wasm] Skip constructor entrypoints of dynamic callable anonymous mixins constructors.
These mixin constructors are now marked callable by the dynamic interface annotator: https://dart-review.googlesource.com/c/sdk/+/430002

However, they are not directly invokeable and trying to compile the constructor entrypoints causes dart2wasm to crash. So we explicitly skip them when considering dynamic callable constructors.

Note: This is blocking internal rolls as code patterns like this show up in our internal codebase.

Change-Id: I76383aec07bc53a0dbd1581c0577cba370d956f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430801
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Auto-Submit: Nate Biggs <natebiggs@google.com>
2025-05-23 15:37:33 -07:00
Devon Carew 3938cf634c Bump protobuf to d940c8de905439e292770ccf6c546477ae566462
Changes:
```
> git log --format="%C(auto) %h %s" deda288..d940c8d
 https://dart.googlesource.com/protobuf.git/+/d940c8d Update the generated code to improve readability and to better follow common Dart patterns. (1003)
 https://dart.googlesource.com/protobuf.git/+/ce05559 no longer generate empty enum or server files (1006)
 https://dart.googlesource.com/protobuf.git/+/976ebb8 add a script to update the vendored protos (1004)
 https://dart.googlesource.com/protobuf.git/+/c8954ea Refactor the vendored protos (1000)

```

Diff: https://dart.googlesource.com/protobuf.git/+/deda2883eb3c8437a89bdae524b732fffef6150c..d940c8de905439e292770ccf6c546477ae566462/
Change-Id: Ice01632fd6d2e1bfa9b0b175a2d26252f28fb833
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430920
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2025-05-23 14:59:41 -07:00
Keerti Parthasarathy eb9cc6f5c9 Remove duplicate logic in KeywordHelper
Change-Id: I32e7643f785228b99961e50bc2380bdcdffca1d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430881
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-23 13:32:00 -07:00
Roy c9ba43db45 [vm] Adding static_field_offset to Field objects.
This adds the offset of static fields within their field table.

TEST=vm/dart/analyze_snapshot_binary_test

Change-Id: I90b13760fa3203ca2e3c5611e3fd890a74c97728
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429880
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-05-23 12:45:41 -07:00
Alexander Aprelev 0f34fdde1d [gardening] Skip isolate_group_shared_callback_test on hot reload bots.
The test in reload is very slow in "--shared_slow_path_triggers_gc" configuration.

Fixes https://github.com/dart-lang/sdk/issues/60758
TEST=ci

Change-Id: I16e9ff1de273464a866db6db8fa839b7aa03dca8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430882
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-05-23 11:14:31 -07:00
Sam Rawlins b0b74b2810 Rename some loose ends w.r.t. "errorSeverity"
Change-Id: Id68fcd8bbbe45a95a294fd557ee4556c2af5c4c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430548
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-23 10:36:28 -07:00
Jake Macdonald 611d5a8a7c Bump tools to be0bd20c803377063c45904512f272fdda94e8c3
Changes:
```
> git log --format="%C(auto) %h %s" 36f5c9f..be0bd20
 https://dart.googlesource.com/tools.git/+/be0bd20c8 add an issue template for package:process (2099)
 https://dart.googlesource.com/tools.git/+/30ba94606 have package:lints use package:lints/recommended (2098)
 https://dart.googlesource.com/tools.git/+/694e25e0c Add package:process (2097)
 https://dart.googlesource.com/tools.git/+/55054d644 [benchmark_harness]: add a bench command (2091)
 https://dart.googlesource.com/tools.git/+/8f81c82a6 [benchmark_harness] Move Measure into its on lib (2092)

```

Diff: https://dart.googlesource.com/tools.git/+/36f5c9f9989e06e79323499914c50e78ab1a6621..be0bd20c803377063c45904512f272fdda94e8c3/
Change-Id: I23b90cc93240b84495d264568311471068405ede
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430460
Reviewed-by: Devon Carew <devoncarew@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2025-05-23 10:30:21 -07:00
Konstantin Shcheglov 19e911349f Fine. Fix for requirements on instance/interface elements with missing names.
Change-Id: Ide320ccc1bd146aba60a0d2bced405fc2612a027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-23 10:28:24 -07:00
Brian Wilkerson 2545c3eb31 Remove three more uses of NodeLocator2
Change-Id: I3e8fba0516bb0988ca0794991e980157dacb7231
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430860
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-05-23 10:22:17 -07:00
Konstantin Shcheglov d5e914ad09 Elements. Fix InstanceElementImpl2.name3, return firstFragment.name2, nullable.
Change-Id: Idd7239c1be692219f1f1ba735f475fe0141c0c6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430821
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-23 10:20:20 -07:00
Sam Rawlins 823b6668f6 analyzer: Rename ErrorSeverityTest to DiagnosticSeverityTest
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: I1361a28834cb95a8b7ad9f131132b7b77e888483
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430547
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-23 10:14:14 -07:00
Sam Rawlins 43e01310a4 analyzer_testing: Rename PubPackageResolutionTest.ignoredErrorCodes to ignoredDiagnosticCodes
Change-Id: I0a951ecbf8aa74d1c00df99e0f5bdab84bb00dde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430542
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-23 10:12:18 -07:00
Nate Biggs 9585877f18 Update Chrome and Firefox versions.
Chrome: 137.0.7151.40
Firefox: 138.0.4
Change-Id: I9251c10255fa86da8ad710757de324fb1e6cd678
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430840
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-05-23 09:45:24 -07:00
Kallen Tu 448c8aed6a [analyzer] Dot shorthands: Additional unit test for AMBIGUOUS_IMPORT.
Added a small unit test to make sure AMBIGUOUS_IMPORT with dot shorthands still produces the expected errors.

Bug: https://github.com/dart-lang/sdk/issues/59835
Change-Id: Ife115bfb1fd34f396c5b3d00cb4f4d75e933e963
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430562
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-05-23 09:32:50 -07:00
Alexander Aprelev 24211892c8 [gardening] Mark pkg/test_runner/test/update_error_cmdline_test Slow.
Fixes https://github.com/dart-lang/sdk/issues/60534
TEST=ci

Change-Id: Ia6786e83111250c627d95e901902a045cc548fe1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430820
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2025-05-23 09:16:26 -07:00
Daco Harkes dad805d596 [deps] Roll dart-lang/native
Change-Id: I3c6dfc3ca5a2b2059a3bb0805e16cdeee93d19fa
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430780
Commit-Queue: Moritz Sümmermann <mosum@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2025-05-23 08:46:50 -07:00
Nate Biggs cd3f2fb270 [dart2wasm] Add dynamic modules subtyping test.
Tests that types defined fully with dynamic modules type check correctly.

In WASM this ensures that the class ID ranges used for the type checks are correct.

Change-Id: I22aa528599eb918062e198b878ba2b4cdc901a06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430620
Auto-Submit: Nate Biggs <natebiggs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-05-23 08:28:51 -07:00
Konstantin Shcheglov 88e2419b0f Elements. Convert FunctionTypeImpl.parameters to List<FormalParameterElementMixin>.
Change-Id: Idfba32254b458c68f75618d276b824ad734e13ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430601
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-23 08:15:11 -07:00
Alexander Aprelev 6497b412e2 [vm/shared] Ensure dart mutator thread stack is walked during gc.
Fix asynchronous aspect of the test.

Fixes https://github.com/dart-lang/sdk/issues/60756
TEST=ci

Change-Id: Ife311d5663665e7fa6e8dd3977fc31f5ed22cc17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430580
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2025-05-23 07:23:22 -07:00
Tess Strickland 9a2234461a [vm] Use a non-native definition of the runtime function structure.
Attempting to use the native definition when available causes problems
when cross-compiling, and the original attempts to avoid this broke in
subtle ways. Instead, just make a non-native definition that mimics
the native definition and use that with reinterpret_casts when sending
uses of the non-native definition to Windows API calls that expect
a value of the native definition.

TEST=windows ci

Fixes: https://github.com/dart-lang/sdk/issues/60771
Change-Id: I347fcaf8cccd809a3d8e6f041cc7e360b0b8226e
Cq-Include-Trybots: luci.dart.try:vm-aot-win-release-arm64-try,vm-aot-win-release-x64-try,vm-win-release-arm64-try,vm-win-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,pkg-win-release-try,pkg-win-release-arm64-try,dart-sdk-win-try,dart-sdk-win-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430400
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-05-23 06:19:16 -07:00
Martin Kustermann 94a36d59ff [dart2wasm] Mark Closure.context as final
We also use the same variable to represent the type of the
context slot instead of repeating that type in several places.

Change-Id: Ia4d10db4781dfd78617d40279d37335eedeb7408
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430760
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-05-23 06:02:14 -07:00
Martin Kustermann 26da655ddf [dart2wasm] Remove duplicate code to call references
Change-Id: I304729f6ed19a75de16ddced15b3f47f894e9c49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430740
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-05-23 05:38:08 -07:00
Jens Johansen 3deffabce1 [CFE] Update flutter_gallery_leak_tester to use flutter/dev/integration_tests/new_gallery
For a few months the "original" flutter gallery has had compile errors
and the weekly bot has been a lot slower (and doesn't really test the
default "advanced invalidation").

This updates the compile target to the one in
flutter/dev/integration_tests/new_gallery which doesn't have compile
time errors.

Change-Id: I59aa701700bc6b3530d73d9c0474dbff525288c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430700
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-05-23 04:50:30 -07:00
Ömer Ağacan 91374ffb12 [dart2wasm] Minify more errors
Transform front-end generated `throw` expressions (as indicated by the
kernel node's `forErrorHandling` flag) to error throwing functions that,
in minify mode, throw without details.

ACX demo sizes: (`-O2 --minify`)

- Before: 12,841,863 bytes
- After: 12,396,399 bytes
- Diff: -445,464 bytes, -3.46%

Issue: https://github.com/dart-lang/sdk/issues/60432
Change-Id: I3c0bfebd5a9cb460af312dafb63b5a0c9aeda22e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430380
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2025-05-23 03:31:36 -07:00
Chloe Stefantsova 561f2a3cff [model] Update DEPS to use new benchmark data for CFE subtype checks
Change-Id: Id428e294952f810ece7f83e8afad23db1c0f0d5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429981
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-05-23 01:57:10 -07:00
Chloe Stefantsova 00acecdfbe [model] Upate bench maker and parser for recent type system changes
This CL includes changes to BenchMaker and test type parser that
include recent developments in the DartType system, such as extension
types and record types, outstanding existing features, such as
typedefs, and recent changes in the CFE type model, such as structural
parameters.

Change-Id: I16ca13273e83de7942abad67b8a2b67146fb24bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430661
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-05-23 01:57:10 -07:00
Sergey G. Grekhov 0ecaf302b9 [co19] Roll co19 to fb20d2b17e35c8fda50ca367c8efc4fb3dab040b
2025-05-23 sgrekhov22@gmail.com dart-lang/co19#3182. Update augmenting_declarations_A04_*.dart (dart-lang/co19#3197)
2025-05-22 sgrekhov22@gmail.com dart-lang/co19#3182. Add application order tests (dart-lang/co19#3196)
2025-05-22 sgrekhov22@gmail.com dart-lang/co19#3182. Update augmenting_declarations_A01/02_*.dart tests (dart-lang/co19#3195)
2025-05-22 sgrekhov22@gmail.com dart-lang/co19#3182. Update type_inheritance_A04/5_t*.dart (dart-lang/co19#3194)
2025-05-22 sgrekhov22@gmail.com dart-lang/co19#3182. Update type_inheritance_A02/3_t*.dart (dart-lang/co19#3193)
2025-05-22 sgrekhov22@gmail.com dart-lang/co19#3057. Add "diamond" inheritance case to promotion via assignment tests (dart-lang/co19#3179)
2025-05-20 sgrekhov22@gmail.com dart-lang/co19#3182. Update type_inheritance_A01_* tests (dart-lang/co19#3191)
2025-05-20 sgrekhov22@gmail.com dart-lang/co19#3182. Update scoping tests (dart-lang/co19#3190)
2025-05-20 sgrekhov22@gmail.com dart-lang/co19#3182. Add enums and extensions tests (dart-lang/co19#3189)
2025-05-19 sgrekhov22@gmail.com dart-lang/co19#3182. Remove `augmented` expression tests (dart-lang/co19#3188)
2025-05-16 sgrekhov22@gmail.com dart-lang/co19#3057. Add promotion via type test tests. Check top and bottom types and Null (dart-lang/co19#3165)

Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try
Change-Id: I0720274d910fb4e1385efeb038080995b35656f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430660
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2025-05-23 01:27:16 -07:00
Johnni Winther 27354572b4 [cfe] Add _createPropertyBuilder
This combines the creation SourcePropertyBuilder for fields, getters,
setters, enum elements and primary constructor fields through the same
method.

This prepares for combining getter/setter and final field/setter
pairs in the same SourcePropertyBuilder.

Change-Id: I664ccded46c79235281cbd0799f9567bfb451eb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430440
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-05-23 01:26:42 -07:00
Martin Kustermann 226a667ef9 [dart2wasm] Add const bool.fromEnvironment('dart.tool.dart2wasm.minify')
We add the `dart.tool.dart2wasm.minify` environment define (analogous to
how dart2js exposes `dart.tool.dart2js.minify`).

We make `package:expect/variations.dart` then expose to tests what
guarantees they can assume, namely

   * `readableTypeStrings`
   * `preciseErrorsWithDetails`

Change-Id: I43da09ed924ca9137721f4d70b7a494e01bf36e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430680
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-05-23 01:26:38 -07:00
なつき 4fb584d1ad [docs] Fix build documentation for Android
Closes https://github.com/dart-lang/sdk/pull/60766

GitOrigin-RevId: 0e5b924cc62ecdaa01f671dc1c3a92a5ba156567
Change-Id: I5b63b7b764ffd39b990367ff68dcd013c64203c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429842
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-05-23 00:49:40 -07:00
Stephen Adams 29d5395c49 [dart2js] Fix side-effects bugs
Make the `HInstruction.sideEffects` field final.  The instruction owns
the mutable SideEffects objects so it would be dangerous to make the
field reference a shared SideEffects object.

Update the side effects of an interface call when the target becomes
known. We were essentially missing any benefit of inferred
side-effects for instance members.

Change-Id: I46da1d87e166864cd7fa4cee01f209bcc19986af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430546
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-05-22 19:49:10 -07:00
Brian Wilkerson 816b974c15 Report the number and sizes of library cycles
Reported in the report created by the diagnostic pages.

Change-Id: I44de39b8388101d8ef5c5d0ecd5d50c1a1f559cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430600
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-05-22 17:27:20 -07:00
Sam Rawlins 2dc94ee84a analyzer: Rename DiagnosticCode.errorSeverity to DiagnosticCode.severity
Change-Id: I244a96a940f82902a20e817fd13fe32026607ce3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430581
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-22 17:25:01 -07:00
Nate Biggs 7d199f2171 [dart2wasm] Enable compiler asserts for dynamic module tests.
Fixes several asserts that were throwing when running with dynamic modules enabled.

Bug: https://github.com/dart-lang/sdk/issues/60743
Change-Id: I6bcd3723ecdee784b3d1603e1c87a47e3703a7f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423261
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-05-22 16:48:22 -07:00
Nate Biggs 63ee73a2ed [dart2wasm] Fix dynamic modules bugs.
- For direct calls in selector branch, ensure 'if' branches have correct inputs.

- For overrideable selectors, the receiver type cannot be known in the main module so use 'top' type. Technically we could do better if selectors tracked interfaces they targeted. Then we could take the LUB of all those classes. But this would be a significant refactor for a small benefit.

- Type checks on classes defined in the main module should use the class ID ranges from the main module rather than those from the dynamic submodule. This only applies to non-dynamic module extendable types (otherwise we'd use the RTT checks). So we know the class can only exist in one of the range sets, not both.

I discovered (1) from running Flutter which led me to create this test which uncovered (2) and (3).

Change-Id: I80f39835f66aa7cf0cff527341e3f4a948a7a0cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430360
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-05-22 16:15:58 -07:00
Daco Harkes 09cdebdd59 [deps] Roll dart-lang/native
Change-Id: I9d879a328bf1a741ba3b23d282aefa6e670c9ca5
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430500
Reviewed-by: Liam Appelbe <liama@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2025-05-22 15:33:11 -07:00
Konstantin Shcheglov 4e2569294e Fine. Rename recording methods in RequirementsManifest.
Change-Id: I3402e9b641978cd3004cc5d2be4b8b303fddf8a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430541
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-22 14:55:02 -07:00
Brian Wilkerson b55b2bb092 Refactor the performance reporting support
This CL contains no functional differences; it just reorganizes the code.

I expect to be adding data to the collected report, and I decided that
it would be better to break the massive method up before doing so in
order to improve overall readability.

I also wondered whether we might want to structure the data in a similar
way. For example, the top-level map could have entries corresponding to
each of these methods, each of which has a value that is a map
containing the data collected by that method. I don't know whether this
would make the output easier to read or whether the current form is
depended on anywhere, but it's something to consider for the future.

Change-Id: Id0ef3c2f64b00ea58069c496e7c485c7b3f163c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430560
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-05-22 14:06:00 -07:00