Commit Graph

2132 Commits

Author SHA1 Message Date
Alexander Markov 4c9d7e54cb [vm,compiler] Fix inlining of generic functions with optional parameters
When checking number of arguments passed by the caller against
number of parameters in the callee, inliner was not taking
"type arguments" argument into account which resulted in
the rejected inline if all optional parameters are passed.

TEST=runtime/tests/vm/dart/inline_generic_functions_il_test.dart

Change-Id: I38d1fd2a1a4aadfb0196e5a472d224e3da3a1562
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/502800
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-12 06:03:11 -07:00
Alexander Markov da1f06f239 [vm,compiler] Fix loop computation in case of try blocks
If catch block is included into the loop, we should also include
the whole try body as there are implicit control flow edges between
each block in a try body and corresponding catch block.

If try body is not included, analysis of loop invariant loads
could miss conflicting stores and may conclude that certain loads are
loop invariant although they are not.

TEST=runtime/tests/vm/dart/regress_63336_test.dart
Fixes https://github.com/dart-lang/sdk/issues/63336

Change-Id: I9d6b73e24554ee3bfbcc722fa59634ea90b00abb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501560
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-05-08 06:37:30 -07:00
Slava Egorov d2903a568c [vm/io] Range check Filter_Process arguments
Add a check both in the native implementation and on the Dart side (to
avoid throwing uncatchable ApiError).

Simplify native implementation: Dart_ListGetAsBytes has fast path for
byte sized typed data lists, so there is no reason to inline the 
same fast path into the caller.

Reported by Kyounghwan Kim (@drg2533)

TEST=runtime/tests/vm/dart/regress_b508627933_test.dart

Bug: b/508627933
Change-Id: I14c0f5270f143ed2386200241b13313f6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500461
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2026-05-07 04:18:06 -07:00
Ryan Macnak 5bb366bb9f [gardening] Remove lib/async/future_test from isolate stress test.
Bug: https://github.com/dart-lang/sdk/issues/63333
Cq-Include-Trybots: luci.dart.try:iso-stress-linux-arm64-try,iso-stress-linux-x64-try
Change-Id: I9521563be52a902db0720b98c345d7502324d8b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501200
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-06 13:13:46 -07:00
Alexander Markov 69b84908a5 [vm,arm] Fix for crash in Subtype6TestCache on 32-bit arm
On 32-bit arm, when generating subtype test cache stub,
[delayed_type_args_reg] could be the same as [TypeTestABI::kInstanceReg]
(due to lack of registers).

As a result, when loading delayed type arguments from an instantiated
generic closure, [TypeTestABI::kInstanceReg] is eagerly overwritten,
which results in garbage delayed type arguments.

With the linear probe cache this would cause repeated cache misses.
With the hash-based cache this would cause a crash.

Bug: b/507666702
Change-Id: I1093f9277d874154a121ef644ecd7aa76320f789
TEST=runtime/tests/vm/dart/regress_b_507666702_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500842
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-05-06 06:41:04 -07:00
Alexander Markov 8363860ee7 [vm,compiler] Fix handling of the argument of _simpleInstanceOf
The 2nd argument of _simpleInstanceOf call is always a
Constant (type). However, a Redefinition can be inserted in the middle.

So, instead of ArgumentAt(1)->AsConstant()->value() it is
more safe to use ArgumentValueAt(1)->BoundConstant() as
BindsToConstant/BoundConstant unwraps Redefinition(s) via
OriginalDefinition().

TEST=runtime/tests/vm/dart/regress_63211_test.dart
Fixes https://github.com/dart-lang/sdk/issues/63211

Change-Id: Ie4a473ebe2deee8562e6634a792f02b0dcefc918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497761
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-27 07:38:24 -07:00
Slava Egorov 488f97eb76 [vm] Update ObjectSlots to handle _LinkedHashBase
Generalize code which computes slots map to handle class hierarchies
which include base classes with VM-described layout like
_LinkedHashBase.

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

TEST=vm/dart/heap_snapshot_regress_63180

Change-Id: I32ab0e258e735f745d45f25813177d0f6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/496861
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2026-04-21 04:02:25 -07:00
Ryan Macnak e860a9b0fa [vm, ffi] Emit the FFI callback stub as a raw blob and place it in the Fuchsia package.
Any blob in the package can be loaded as an executable VMO.

TEST=child CL
Bug: https://dartbug.com/52579
Change-Id: I61f7a84453da4da4733c5a70d4d19f0a6652581b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/496661
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-04-20 11:31:19 -07:00
Alexander Markov 51d1c8923a Reland "[vm,dart2bytecode,modular_aot] Variable-length closure objects"
This is a reland of commit 88496ba1c3

Fixes on top of the original change:

* Closure layout is changed to avoid gap between fixed fields and
  variable-length elements on compressed pointers architecture.
  This gap was causing crashes in the GC when scanning closure
  objects.

* pkg/vm_snapshot_analysis/test/instruction_sizes_test is fixed
  on arm64 by decreasing threshold for detecting size changes.

Original change's description:
> [vm,dart2bytecode,modular_aot] Variable-length closure objects
>
> Extend closure objects with variable number of elements to capture.
> This is needed to support capturing multiple independent contexts
> after capturing is computed in the front-end.
>
> The following fixed Closure fields are moved into variable-length
> elements:
>  - delayed type arguments;
>  - instantiator type arguments;
>  - function type arguments;
>  - context.
>
> Number of elements and presence/indices of various type arguments
> are encoded into the new length_and_flags field in the Closure.
>
> Most closure objects don't need any of the type arguments so this
> change will reduce average Closure object size.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/61572
Issue: https://github.com/dart-lang/sdk/issues/61635

Change-Id: I8685e632e2d0832766ecdc470f3cf9a6b880de48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494243
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-04-10 06:15:22 -07:00
Alexander Markov 0dfaa16dc7 Revert "[vm,dart2bytecode,modular_aot] Variable-length closure objects"
This reverts commit 88496ba1c3.

Reason for revert: crashes on arm64c

Original change's description:
> [vm,dart2bytecode,modular_aot] Variable-length closure objects
>
> Extend closure objects with variable number of elements to capture.
> This is needed to support capturing multiple independent contexts
> after capturing is computed in the front-end.
>
> The following fixed Closure fields are moved into variable-length
> elements:
>  - delayed type arguments;
>  - instantiator type arguments;
>  - function type arguments;
>  - context.
>
> Number of elements and presence/indices of various type arguments
> are encoded into the new length_and_flags field in the Closure.
>
> Most closure objects don't need any of the type arguments so this
> change will reduce average Closure object size.
>
> TEST=ci
> Issue: https://github.com/dart-lang/sdk/issues/61572
> Issue: https://github.com/dart-lang/sdk/issues/61635
>
> Change-Id: I7ca5cec0fd8725c432a01d51781fb14e803997dd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489482
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Reviewed-by: Tess Strickland <sstrickl@google.com>

Issue: https://github.com/dart-lang/sdk/issues/61572
Issue: https://github.com/dart-lang/sdk/issues/61635
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I94c88f8922f6ea49251e942ba791fee714911e25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494261
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-09 14:12:09 -07:00
Alexander Markov 88496ba1c3 [vm,dart2bytecode,modular_aot] Variable-length closure objects
Extend closure objects with variable number of elements to capture.
This is needed to support capturing multiple independent contexts
after capturing is computed in the front-end.

The following fixed Closure fields are moved into variable-length
elements:
 - delayed type arguments;
 - instantiator type arguments;
 - function type arguments;
 - context.

Number of elements and presence/indices of various type arguments
are encoded into the new length_and_flags field in the Closure.

Most closure objects don't need any of the type arguments so this
change will reduce average Closure object size.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/61572
Issue: https://github.com/dart-lang/sdk/issues/61635

Change-Id: I7ca5cec0fd8725c432a01d51781fb14e803997dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489482
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2026-04-09 12:22:21 -07:00
Ryan Macnak e98e6a1198 [vm] Per isolate group roots accessed via TLS.
Remove special case for null in message snapshots; snapshots are sometimes read or written with no current isolate group.

Currently still all copies pointing into the VM isolate.

TEST=ci
Change-Id: I4d2e35a01880885d4e92e1c623c0f39a35e06065
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493866
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-04-08 15:26:06 -07:00
Tess Strickland 0bbb2ae821 [vm,dyn_modules] Fix/skip vm/cc tests that crash for dynamic modules.
Skip IR or snapshot-related tests when running from bytecode.

TEST=vm/cc/DartAPI_DeepStackTraceInfo
     vm/cc/DartAPI_HeapSampling_UserDefinedClass
     vm/cc/DartAPI_StackTraceInfo
     vm/cc/DartAPI_StackOverflowStackTraceInfoArrowFunction
     vm/cc/DartAPI_StackOverflowStackTraceInfoBraceFunction1
     vm/cc/DartAPI_StackOverflowStackTraceInfoBraceFunction2
     vm/cc/FrameLookup
     vm/cc/Service_LocalVarDescriptors

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: I396a4e8ddacdbb88b3844e4113dc5c4ff6287e30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490083
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2026-03-26 08:21:00 -07:00
Alexander Markov 17e6648fe0 [vm] Simplify closure instantiation
When instantiating a closure, allocate a new closure object in
the same boostrap native method as checking bounds.

This simplifies code generation and prepares for variable-length
closure objects by removing the only place where closure of unknown
length was allocated in the generated code.

TEST=ci

Change-Id: I9ac51c862081612bca2160699ebe24526d4fc915
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490360
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-03-25 06:59:41 -07:00
Lasse R.H. Nielsen 56505e0575 Stop using Match.group.
The `Match.operator[]` does the same thing and is
generally recommended (and shorter).
(I want to deprecate `group` and `groups`)

Tested: Refactoring.
CoreLibraryReviewExempt: Calling equivalent function.
Change-Id: I4c758968ae622fe16b7322be1b29b05b91e7fcd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489021
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2026-03-20 09:09:46 -07:00
Alexander Aprelev 6967e81fb1 [gardening] Reduce test thread concurrency to make sure it passes under tsan.
With new semispace max size set to 4, active mutators count is limited to 2(from standard 16), which puts significantly less stress on sanitizer infrastructure. Reducing isolates count from 20 to 4 still exercises isolate/thread management in the vm.

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

Change-Id: Ibec809625719d5f7ab6525b6b0fa29df4c521b3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487887
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-03-13 12:16:00 -07:00
Alexander Markov e1db52ab83 [gardening] Skip vm/dart/stream_timeline_to_test on product and reload bots
TEST=ci
Closes https://github.com/dart-lang/sdk/issues/62551

Change-Id: I621c992cd5ed5f0ed7602731b219398a1f48e151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487461
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-03-12 08:32:01 -07:00
Alexander Markov b979a9086e [gardening] Mark vm/dart/heap_snapshot_regress_49711_test as Slow on reload bots
TEST=ci
Closes https://github.com/dart-lang/sdk/issues/62846

Change-Id: I0eb799f9f08350937e1dab0cd7b1f09776d04e81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487440
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-03-12 07:57:22 -07:00
Alexander Aprelev 54c5090a65 [gardening] Update stress testing list.
Follow-up to dde4b2475d to fix broken iso-stress-linux bots https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/iso-stress-linux-x64/1876/overview

TEST=iso-linux-stress

Change-Id: Iea60de60fee22ade2d3ec6e95ca08d223e1a7115
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486900
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-03-10 15:09:21 -07:00
Ryan Macnak b52575161d [vm] Adjust MSAN compile flags to match google3 to reproduce MSAN error in the regexp interpreter.
TEST=msan
Bug: b/489355669
Change-Id: I3ade526a67e5e7d95c8d8862eb92924337057d94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/485240
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-04 13:45:22 -08:00
Nate Biggs 159f427938 [vm] Update option for windows priority test.
Use a slightly higher priority than lowest to avoid flaky timeouts.

We avoid using higher priorities than the default because these require
extra permissions and setup.

Change-Id: I69ca93f270697d3e39ef9c0f49184ffb3de32610
Fixes: https://github.com/dart-lang/sdk/issues/62722
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/483980
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-02-27 09:48:51 -08:00
Alexander Aprelev cdf7bf9c78 [vm/shared] Allow const maps in deeply immutable classes.
This relies on runtime check of Map-typed variable initialization.
TEST=kernel_binary_flowgraph_test

Change-Id: Ia9be2644208883739f5896a223dcbe2b59c98114
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482021
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-02-27 07:43:14 -08:00
Slava Egorov d7fa1ced6a [vm] Speedup profile data streaming in AOT
Current implementation of profile data streaming inherited its 
approach to symbolization from the implementation of vm-service's
get{,Perfetto}CpuSamples methods. These methods rather expensive
as they rely on CodeLookupTable to symbolize collected samples, and
constructing CodeLookupTable requires bringing all threads to safepoint
and iterating over old-space to collect code objects. This can take
significant amount of time - especially when old-space is large (e.g.
consider 1Gb+ heaps of Dart Analysis Server).

This CL rewrites profile data streaming to use a completely different
approach in AOT mode where Dart frames are not symbolized eagerly 
and instead stored in the timeline in their raw form: a pair of
an isolate group specific Mapping and a PC value relative to the start
of that mapping. At the end of streaming (or when isolate group
exits) an additional ModuleSymbols packet is emitted which provides
symbolization information for all collected frames. ModuleSymbols
mappings can be cheaply constructed from collected PCs using 
ReversePc lookup tables.

TEST=expanded existing tests

Change-Id: I56ef1dd4c9a17fb0d2e9c24e51f2e4656a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482782
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2026-02-25 04:48:51 -08:00
Ryan Macnak e443b89f23 [vm] Update Irregexp to V8 commit 254cc758346f10be2a7e22e55d90d4defe9cad74.
Includes support for modifier spans and duplicate named capture groups.

Drops the flow graph implementation to ease maintenance.

TEST=corelib/regexp
Bug: https://github.com/dart-lang/sdk/issues/56573
Bug: https://github.com/dart-lang/sdk/issues/61337
Bug: https://github.com/dart-lang/sdk/issues/62349
Bug: https://github.com/dart-lang/sdk/issues/62708
Change-Id: I05640ba945a4fa5476e7ad463738f4f39d842c14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480121
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-02-23 09:54:47 -08:00
Lasse R.H. Nielsen 0a88f4ef73 Remove var or final from parameters.
Removed from `benchmarks/`, `runtime/`, `sdk/`, `tools/` and `utils/`.
(Leaving `tests/`, `pkg/` and `third_party/`.)

CoreLibraryReviewExempt: No real change.
Tested: No test changes for no real code changes.
Change-Id: Ieb42441457ca3d0ea4443dd153ee902ea33b28de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480241
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2026-02-13 03:35:34 -08:00
Liam Appelbe 4679c040c6 [vm] Sync ffi callbacks can enter owned target isolate
Adds a new code path for NativeCallable.isolateLocal invocations. If
the current thread is not entered into any isolate, but owns the
target isolate, then it enters the target isolate, invokes, then exits
the isolate.

Fixes: https://github.com/dart-lang/sdk/issues/61623
TEST=tests/ffi/function_callbacks_isolate_ownership_test.dart
Change-Id: I401f185fadf7d2a55190dafd15387e1c418c67c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452380
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2026-02-05 01:29:23 -08:00
Slava Egorov 4ec7f9c25d [vm] Fix timeline track metadata handling
AddTrackMetadataBasedOnThread was looking at FLAG_timeline_recorder
to determine if it can skip recording metadata. However the flag
value is not necessary in sync with the current recorder because
NativeRuntime.streamTimelineTo can reconfigure recorder itself
without changing flag value.

It seems strange to be checking the flag instead of using proper OOP
anyway - the function is already virtual. This CL removes code
which was checking the FLAG and instead overrides the method in
subclasses which don't care about track metadata.

TEST=existing tests were updated to cover this case

Change-Id: I2a2859ab5ef28d8d6d2358259cc9ed8d6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476400
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2026-01-29 02:55:30 -08:00
Ryan Macnak f2e1df1997 [vm] Avoid deadlock in Isolate.debugName.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/62237
Change-Id: I57bfcc341e34aa9e873092e0f7ebf44bc2f95cfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476143
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-01-28 11:10:42 -08:00
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