Commit Graph

2104 Commits

Author SHA1 Message Date
Ryan Macnak 47d300538b [test] Avoid slow initialization in large_constant_index_test on simulators.
Bug: https://github.com/dart-lang/sdk/issues/62512
Change-Id: If183af259a41549c17615949fad03c16dfce5bae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475901
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-01-27 14:11:14 -08:00
Ryan Macnak 1d91605c25 [vm, compiler] Handle 32-bit constant indices for Load/StoreIndexedInstr on ARM64 and RISC-V.
This extends the set of indices that are not processed by the register allocator to match X64. This avoids slowness in the register allocator for large list literals. For some cases, it also reduces code size.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/62411
Change-Id: Iab71a6dea2f2f75b06c51e4b23626bc991e1a20f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475720
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-01-26 14:37:58 -08:00
Tess Strickland 8cbf864289 [vm] Add LC_ENCRYPTION_INFO(_64) load command to iOS snapshots.
When uploading to the App Store, the program must contain an
LC_ENCRYPTION_INFO segment in the Mach-O header so the App Store
can appropriately modify it for its purposes without changing the
header size and/or offsets/addresses in the rest of the shared object.

By default, the load command is only added to iOS snapshots, but
it can be added to any Mach-O snapshot using the --macho-encryptable
command line option.

TEST=vm/dart/use_macho_options_test

Cq-Include-Trybots: luci.dart.try:vm-aot-mac-debug-x64-try,vm-aot-mac-debug-arm64-try,vm-aot-linux-debug-x64-try
Change-Id: I4e79fd9cfb9ba9d49707ec209eca3fee1cefc28c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475040
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2026-01-26 06:34:51 -08:00
Alexander Aprelev af7c390044 [vm/shared] Skip runtime deep-immutability check for statically known types.
Fixes https://github.com/dart-lang/sdk/issues/61078
TEST=StreamingFlowGraphBuilder_DeeplyImmutableTypeCheck*

Change-Id: I4116d5f51f3247d50d4e7fc0f87e04238a6e3151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/474563
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-01-22 12:53:50 -08:00
Alexander Markov 0970fb57fe [tests] Update stress_test_list.json after tests were moved
TEST=ci

Change-Id: I4730bdd58e18051d6f07f2af1b70560434bde790
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475121
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-01-22 08:40:07 -08:00
Tess Strickland e283e135ef [gardening] Adjust status file info for moved tests.
Tests from language/vm were moved to vm/dart/language, so move the
related lines from the status files.

Also fix the list of tests for the stress test trybot.

TEST=ci on vm-aot-dwarf-linux-product-x64
           vm-aot-obfuscate-linux-release-x64
           vm-appjit-linux-debug-x64
           vm-appjit-linux-product-x64
           vm-appjit-linux-release-x64

Cq-Include-Trybots: luci.dart.try:vm-appjit-linux-release-x64-try,vm-appjit-linux-product-x64-try,vm-appjit-linux-debug-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-obfuscate-linux-release-x64-try
Change-Id: I48eb25207551c0a9ba637023d36497f184c4a4b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/474700
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2026-01-21 04:58:13 -08:00
Ryan Macnak 97a00247f8 [test] Disable TSAN thread leak detection for more tests that call exit.
Cf. cee7000c1a.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/62405
Change-Id: I03d6bd34e57c249f0e62ae87179614b9871e0436
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/474483
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-01-20 14:47:53 -08:00
Lasse R.H. Nielsen 8d1ed4b750 Move VM-specific tests out of tests/{language,corelib}.
Change-Id: Iaeae638d2e3fb46409f04982975e78ad4c4eebe5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472865
Auto-Submit: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2026-01-19 04:17:22 -08:00
Alexander Aprelev eb75c53d95 [vm/shared] Perform deeply-immutable initialization runtime check.
When an initial value is assigned into a class tagged as deeply-immutable, perform runtime check of that value. This is needed to support proper initialization of the closures as part of deeply-immutable classes.

BUG=https://github.com/dart-lang/sdk/issues/61962
TEST=run_isolate_group_run_test

Change-Id: I550746c0d22ca06ffb89959e8384cc9e6d28d590
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468200
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-01-14 08:42:22 -08:00
Ryan Macnak a50083ef29 [test] Reduce size of field scaling tests.
Bug: https://github.com/dart-lang/sdk/issues/62370
Change-Id: Ic2c7c849821d7fb44e8652744f6089987b2ae094
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471327
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-01-12 09:40:50 -08:00
Alexander Aprelev 118d84fedd [vm/unsendable] Fix field handling in finding retaining path for unsendable values.
BUG=https://github.com/dart-lang/sdk/issues/62371
TEST=ci

Change-Id: I0fa7a931c4866cb43faee228f2d60f4e701e751a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471621
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-01-09 07:44:49 -08:00
Alexander Markov 1c4a218105 [gardening] Mark vm/dart/heap_snapshot_referrers_test as Slow if using sanitizers
TEST=ci
Closes https://github.com/dart-lang/sdk/issues/62333

Change-Id: I72259a22da099076a9c2e8597b2881ddd7ccba07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471522
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2026-01-08 09:19:40 -08:00
Alexander Aprelev a949c74530 [vm/shared] Ensure stores into shared static variables are checked.
Closures going into shared variables in particular have to be confirmed to capture appropriate values.

BUG=https://github.com/dart-lang/sdk/issues/62179
TEST=run_isolate_group_run_test

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-dyn-mac-debug-arm64-try,vm-aot-dyn-linux-debug-x64-try
Change-Id: I27416773fd77077018739ea4dbcc6e4695e67be8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469103
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-12-22 07:53:44 -08:00
Ryan Macnak 7bb5e4c192 [build] Fix Windows ASAN build to actually use ASAN.
Bug: https://github.com/dart-lang/sdk/issues/62263
Change-Id: I77a44aeff0a0685730ff3e5c897e338ddc5561a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464781
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-12-17 14:08:00 -08:00
Ben Konyi 4cbf367b94 [ dart2bytecode ] Skip more tests that depend on dart:mirrors
Change-Id: I3dadc31c7cb2ba351ec797d8a851d82bf5bab232
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468920
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2025-12-17 11:54:43 -08:00
Ryan Macnak 674a42d292 [vm, compiler] Check for ASAN and MSAN violations from Dart generated code.
Inform ASAN and MSAN about reads and writes through FFI pointers or external typed data. Previously we only informed MSAN about writes, which was enough to prevent false positives in foreign code, but gave false negatives for Dart code. This mostly uses the same machinery used for TSAN, and replaces some of the existing MSAN unpoison calls.

Also fixes some marshalling of compounds by value that generate loads extending past the end of the compound.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/62221
Change-Id: Ia3573edb5a0aec32b6a57035a63e8f323a655ecc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467401
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-12-17 07:37:29 -08:00
Alexander Aprelev 011f0259f9 [vm/shared] Ensure that shared fields initialization is mutex-guarded even without experimental flag.
Shared fields have to be properly initialized even when experiment is not enabled.

TEST=shared_finalthreadlocal_init_test on a loop
BUG=https://github.com/dart-lang/sdk/issues/62238

Change-Id: Ib8d32bd2553cdcbefeea657e4dd2b75db18d31d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467921
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-12-15 08:22:10 -08:00
Ryan Macnak 091b726ddf [test] Disable profiler on GC tests.
TSAN's vector clocks become more expensive as the number of threads that touch a variable increases. The Mac/Windows/Fuchsia profilers will sample threads by suspending it and accessing it from another thread.

Cf. 13507d2594.

Change-Id: Ib303e09f04ecfdcd3b78906f850ddc2033e7b27e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/466900
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-12-08 14:28:30 -08:00
Ryan Macnak ebfddebc74 [test] Disable detect_stack_use_after_return in sanitizer leak test.
TEST=asan
Bug: https://github.com/dart-lang/sdk/issues/62095
Change-Id: I2556dbbd9101bd83ac00c261f1659e552130b143
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/465805
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-12-03 13:55:41 -08:00
Ryan Macnak f19440c37b [vm, compiler] Use Zicond for IfThenElse.
TEST=locally increase baseline to RVA23
Change-Id: Ib28ee2edeea087b19b2cd146134d0dcf93c3fe0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/465482
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-12-03 10:16:04 -08:00
Ryan Macnak 7708addac2 [vm, compiler] Add --target-address-sanitizer.
The throw stub will need to be different under ASAN.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/62095
Change-Id: Idd079fbab22d1c3f29c0d7e216998d54a521545c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464786
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-12-01 16:15:39 -08:00
Ryan Macnak 1d1527adf9 [vm] Report the current sanitizer in the compiler environment.
TEST=ci
Change-Id: I56585a1fdb1bb6b92eab706fd0a66f78888bc55d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464620
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-12-01 15:10:50 -08:00
Martin Kustermann 1f906f9069 [gardening] Skip vm/dart/use_macho_reduce_padding_flag_test on reload/rollback tests
Change-Id: If9f86d0d5466ae6149ae522b3e09cf577d3f2972
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/465060
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-11-28 06:22:52 -08:00
Ryan Macnak 85f97d54ee [test] Make tests more reliably detect races under TSAN.
Bug: https://github.com/dart-lang/sdk/issues/61974
Change-Id: I27ad40af61becc558a8d1650a7f45a1484aecc0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464600
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-11-25 17:06:20 -08:00
Slava Egorov 473149f0b1 [io] Fix Process::Exec stdio handle inheritance
The code for inheriting stdio handles was not taking into account that
some of the stdio handles might be the same causing them to be
duplicated in the list of inherited handles. However passing duplicate
handles in PROC_THREAD_ATTRIBUTE_HANDLE_LIST causes CreateProcess to
return E_INVALIDARG.

This CL fixes the code to avoid duplicate handles.

We also fix printing of errors, which was broken when Process::Exec
was used without Dart scope causing it to print (null) instead of
actual error message.

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

TEST=vm/dart/regress_61981

Fixed: 61981
Change-Id: I93a6b56476f5020de9ebf894614cee51586b6751
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464382
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-11-25 11:59:21 -08:00
Tess Strickland 2c804fa251 [vm] Handle the context of implicit instance closures in the debugger.
Since the only captured variable in the context for an implicit
instance closure is this, the allocation of a context object is
elided and instead the instance is stored directly as the "context".

In the debugger, create the elided context object for implicit instance
closures when retrieving the saved context from an implicit instance
closure activation frame.

Without this, any attempt to GetSavedCurrentContext() on an
ActivationFrame for an implicit instance closure (e.g., when
--trace-debugger-stacktrace is enabled) breaks due to the assert
in debug mode, and returns a null context (which isn't correct either)
in non-debug modes.

TEST=vm/dart/regress_cl_463021

Change-Id: I2ba22407695f432a30d23d342f33dfe2a00ba308
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/463021
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-11-24 04:39:04 -08:00
Alexander Markov a37d042e68 [vm] Initial implementation of module snapshot reader
TEST=manual
Issue: https://github.com/dart-lang/sdk/issues/61635

Change-Id: I27f712d9687d45a09173b1018bc08812dd18658e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/460580
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-11-21 06:42:16 -08:00
Tess Strickland 00b2838bf8 [gardening] Disallow running dsymutil-using tests on simulated archs.
Technically dsymutil may be available, but for most simulated
architectures we don't support emitting a Mach-O relocatable object,
and the ones where we do are already tested by the real architectures.

TEST=vm/dart/use_dwarf_stack_traces_flag and
     vm/dart/use_macho_reduce_padding_flag on AOT simulators.

Cq-Include-Trybots: luci.dart.try:vm-aot-win-release-x64-try,vm-aot-linux-release-simarm_x64-try
Change-Id: I648f1e4f5f7ccf5886752368995b7300952e5af2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/463360
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
2025-11-20 08:01:51 -08:00
Tess Strickland addfab941a [gardening] Don't run tests requiring dsymutil on platforms without it.
TEST=vm/dart/use_dwarf_stack_traces_flag and
     vm/dart/use_macho_reduce_padding_flag on AOT simulators/Windows.

Change-Id: I4be334a4b5f374fe2469c64f415ce8de174f5e8d
Cq-Include-Trybots: luci.dart.try:vm-aot-win-release-x64-try,vm-aot-linux-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/463261
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-11-20 04:12:56 -08:00
Ryan Macnak d0f9a38768 [test] Fix llvmTool helper for Windows and simulators.
Change-Id: I82f7c3934f9d62df6a7ad2fbfe117ef131c7aa8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/463080
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-11-19 12:46:59 -08:00
Tess Strickland a58a41c27e [vm] Use Snapshot::TryReadAppSnapshot in analyze_snapshot.
This allows analyze_snapshot to analyze Mach-O snapshots as well, and
also removes the restriction on only building analyze_snapshot for
Linux and Android.

TEST=vm/dart/analyze_snapshot_binary_test

Change-Id: I82797db2f20a4a80cdc52922aeebc789f45bf9bb
Cq-Include-Trybots: luci.dart.try:vm-aot-mac-release-arm64-try,vm-aot-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/461482
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-11-19 07:54:19 -08:00
Tess Strickland bc021bbc01 [vm] Output accompaning relocatable object for Mach-O snapshots.
In order to appropriately generate .dSYMs for a snapshot and allow
the strip tool to be used on the snapshot afterwards, add a mode that
not only outputs the snapshot (sans DWARF information) but also
an associated relocatable object file that contains the program's DWARF
information. That allows dsymutil to retrieve the DWARF information
from the relocatable object when run on the snapshot prior to stripping.

To specify that the relocatable object file should be output, use
the new --macho-object command line argument to gen_snapshot
to specify where the object file should be written.

This CL also adds an additional command line argument,
--macho-reduce-padding, which reduces the alignment used for segments
and the text/const sections in Mach-O outputs from 16KB to 64 bytes.
The larger padding is needed for some uses, like non-native loading
of Mach-O objects, but can be elided for other uses like Flutter builds.

TEST=vm/dart/use_dwarf_stack_traces_flag_test
     vm/dart/use_macho_reduce_padding_flag_test

Change-Id: I2bf4bacb70c41299b8b6fdb7635c2374acf7a07d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457420
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-11-19 07:45:52 -08:00
Lasse R.H. Nielsen 9a39b8972b Split zone.dart into smaller parts.
I want to do some refactoring, and it's easier to manage if everything
isn't in one big file.

No change to functionality in this CL, only moving declarations.

CoreLibraryReviewExempt: No code change, only moved to new part files.
Change-Id: I4b5e244172302b52a04387372738c46a07807a31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/462100
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2025-11-17 01:37:52 -08:00
Alexander Aprelev de77c6b766 [vm/shared] Introduce ScopedThreadLocal to allow keeping state on
thread, outside of isolate, on isolate-group bound callback.

Fixes https://github.com/dart-lang/sdk/issues/61523
TEST=scoped_thread_local_test

Change-Id: I0c8280d2808d940a5fb0d628db191932400a5edb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451402
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-11-13 09:50:34 -08:00
Slava Egorov b5e4f412ab [vm] Fix quadratic behavior in AssignSafepoints
Rework register allocator to assign safepoints eagerly
as live ranges are being built and safepoint instruction
is being visited instead of doing it post-factum when 
each range is being finalized.

Fixes https://github.com/flutter/flutter/issues/176619

TEST=ci, manually tested equivalence of safepoint lists

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try,vm-aot-mac-debug-x64-try,vm-aot-mac-debug-arm64-try,vm-aot-mac-product-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-linux-debug-x64-try
Change-Id: Ieebda2796c2397a701b9184f6b8675fe6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/460100
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-11-10 02:29:41 -08:00
Ryan Macnak 160fd0a5f9 [test] Shrink vm/dart/profiler_deep_stack_test.
This test is timing out on some configurations.

Change-Id: I42ec230e34b54a078ac52ea9a99782f6b4f88a97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/459544
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-11-04 14:28:17 -08:00
Ryan Macnak 7e28e7d504 [profiler] Don't read from a previous block when a sample overflows to the another block.
TEST=dartfuzz
Bug: https://github.com/dart-lang/sdk/issues/61904
Change-Id: I0fd5176502e0d11c5af35f5c27653db8cc294eff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/459523
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-11-04 13:14:10 -08:00
Alexander Aprelev ec6a01c47a [gardening] Remove raw_datagram_read_all_test from isolate stress test list.
The test has hardcoded timing expectations which don't seem to work reliably in isolate stress test setting.

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

Change-Id: I557a22e897d6c61994755e02f9d8ead41f7407fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/458940
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-10-31 10:25:24 -07:00
Ryan Macnak 17a37d2fa6 [test] Avoid data race checking for isolate cleanup callback.
Remove manual MSAN unpoisoning that should happen automatically for Pointer/TypedData writes.

TEST=tsan, msan
Bug: https://github.com/dart-lang/sdk/issues/61503
Bug: https://github.com/dart-lang/sdk/issues/61772
Change-Id: I7c3af7ad769f36a869de7f4d8125d0ced47c9ec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/458069
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-10-29 08:28:41 -07:00
Ryan Macnak 2efbf96aa6 [test] Remove cachable_idempotent_test from the isolate stress test.
This test observes side-effects of call site caching from other isolates.

Change-Id: I3c0c35a30cfa0b4d8ed6dc14d997ae81e79b3375
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456483
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-10-28 17:32:20 -07:00
Ryan Macnak 3a46c47601 [vm] Don't feed the simulator's registers into ProfilerNativeStackWalker.
Default the simulators to --no-profile-vm same as the non-simulators.

TEST=vm/dart/stream_timeline_to_test
Bug: https://github.com/dart-lang/sdk/issues/61811
Change-Id: I26cf956e240ffa542f3d52345e680404bc2d2021
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457840
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-10-27 14:34:39 -07:00
Alexander Aprelev 542a11bf3b [gardening] Increase running time of a stream_timeline_to_test.
This is to ensure test makes enough progress on sim architectures, so that gc events are generated.

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

Change-Id: Iafd3db8312a728fdfe749abcb76a47d78a697fe2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457440
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2025-10-27 09:35:31 -07:00
Vyacheslav Egorov 489f63a3bd [vm] Add NativeRuntime.streamTimelineTo
This API allows to programmatically generate timeline information 
including profiling samples if timeline format supports it.

This change also includes Perfetto timeline writer and profiler 
into non-mobile PRODUCT builds. The size of Mac OS X dartaotruntime
has increased by 34352 bytes (0.7%).

This relands commit 553887bc56 with fixes
for Android builds.

TEST=vm/dart/stream_timeline_to_test

CoreLibraryReviewExempt: VM specific dart:developer API.
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-product-arm-try,vm-ffi-android-release-arm-try,vm-aot-android-release-arm64c-try
Change-Id: Ifb7c66982fe9d17d2f5c9acb163a94c56a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457301
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-10-24 04:34:01 -07:00
Slava Egorov b24698b9b5 Revert "[vm] Add NativeRuntime.streamTimelineTo"
This reverts commit 553887bc56.

Reason for revert: Broken android builds

Original change's description:
> [vm] Add NativeRuntime.streamTimelineTo
>
> This API allows to programmatically generate timeline information 
> including profiling samples if timeline format supports it.
>
> This change also includes Perfetto timeline writer and profiler 
> into non-mobile PRODUCT builds. The size of Mac OS X dartaotruntime
> has increased by 34352 bytes (0.7%).
>
> TEST=vm/dart/stream_timeline_to_test
>
> CoreLibraryReviewExempt: VM specific dart:developer API.
> Change-Id: I326f5fd29ee82a503160f5f5a2a857a7c55330ec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426220
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Slava Egorov <vegorov@google.com>

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I583ad74b850514fb47054149da464a07874fc2f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457000
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2025-10-23 04:58:29 -07:00
Vyacheslav Egorov 553887bc56 [vm] Add NativeRuntime.streamTimelineTo
This API allows to programmatically generate timeline information 
including profiling samples if timeline format supports it.

This change also includes Perfetto timeline writer and profiler 
into non-mobile PRODUCT builds. The size of Mac OS X dartaotruntime
has increased by 34352 bytes (0.7%).

TEST=vm/dart/stream_timeline_to_test

CoreLibraryReviewExempt: VM specific dart:developer API.
Change-Id: I326f5fd29ee82a503160f5f5a2a857a7c55330ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426220
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-10-23 04:47:13 -07:00
Ryan Macnak 4fe0461368 [test] Further weaken many_interfaces_flat_test to avoid timeouts.
Change-Id: Iec6987c816b07b4402b82579af32265e49054be1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456484
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-10-22 09:36:20 -07:00
Ryan Macnak 0a1678c06c [vm] Record stack for JIT TSAN.
The main interesting thing is that deopt can expand one optimized frame to multiple unoptimized frames, so deopt needs to call  __tsan_func_entry enough times to rebalance the stack.

Also fixes stack balance for throw error slow paths for AOT.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/61352
Change-Id: I3fdc8481bc8db7a3aec0fa1938ac3e0e96ac13a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452943
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2025-10-20 10:49:20 -07:00
Alexander Markov 72bd9baa54 [vm,aot] Fix unboxing info (including calling conventions) on unreachable fields
For some reason unboxing information was not generated for unreachable
fields. However, unreachable field can be used as an interface target,
and unboxing info contains a flag indicating if register calling
convention should be used which affects how the call via this field
as an interface target is going to be performed.
So it is incorrect to omit such unboxing info and this change fixes
this bug.

TEST=vm/dart/regress_b_450678575_test

Bug: b/450678575
Change-Id: Ic1f299d9c0b09005c8bbfd95d1a409c113630263
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/454681
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-10-14 13:35:02 -07:00
Tess Strickland 5b69fdd521 [vm] Fix v8 snapshot profile issue with deferred libaries.
TEST=vm/dart/regress_flutter169921

Issue: https://github.com/flutter/flutter/issues/169921
Change-Id: I9a996dcc1213712e6545cf134b436d60ea76b71d
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/453881
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-10-08 05:09:00 -07:00
Slava Egorov 505f08b49a [lib] Avoid empty stack-traces in Stream methods
This change leans on VMs ability to provide a awaiter stack traces (if
the code is written using async syntax sugar or properly annotated with
@pragma('vm:awaiter-link').

Currently doing

    await Stream.fromIterable([]).first;

would result in an empty stack trace. However after this change
we actually get a meaningful stack trace when running on the VM.

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

TEST=vm/dart/awaiter_stacks/stream_methods

CoreLibraryReviewExempt: No functional or API changes. Just better error messages on exceptional code paths.
Change-Id: Ifc3e446c00121cc97f2f870c3e3f5bf56a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/453940
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-10-08 04:11:51 -07:00