Commit Graph

22923 Commits

Author SHA1 Message Date
Alexander Markov c3589b02b4 [vm] Verify there is no padding between last field and variable-length payload in the VM objects
The implicit padding would not be initialized but would
be scanned by GC.

TEST=Manually tested with implicit padding.

Change-Id: Ia3556d3e42a97fbb2d8f67541d2e7de9b7650077
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494566
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2026-04-13 08:52:24 -07:00
Ben Konyi ae1b83869a [ Service ] Add support for DDS to package:dart_runtime_service_vm
The DartRuntimeService based VM service implementation now has support
for launching DDS instances and responding to _yieldControlToDDS RPC
invocations from DDS instances.

package:vm_service test suite is ~97% passing with this change.

TEST=Local testing.
Change-Id: I2f2f1b0926845134578f08d073ed7606f1fc4173
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490320
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2026-04-10 12:04:28 -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
Tess Strickland 432adf747e [vm,dyn_modules] Fix PrintStackFrames for entry frames, add more info.
The handling of entry frame in PrintStackFrames was broken, now it's
fixed.

In addition, the stack printer now print various info about the static
slots in stack frames, as well as printing out the objects in slots.

Now that entry frames are handled properly, printing with no limit
prints _all_ stack frames on the interpreter stack, noting call
boundaries as they are passed, instead of stopping at the closest
entry frame.

Move the separator between frame from the stack pointer for a frame
to the frame pointer for a frame, meaning that the metadata before
the frame pointer is printed as part of the previous frame, not the
current one.

TEST=ci (manual testing while debugging)

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try
Change-Id: Ia2ad07c832b791f0c2ce2bbdfbfc32d5d8968476
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493402
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2026-04-10 04:49:32 -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
Alexander Markov 56186c7e96 [vm,dyn_modules] Fix dynamic calls from host app to a dynamic module
Fix the following cases of incorrect optimizations:

* In TFA, when anlyzing a dynamic call with unknown receiver type,
  do not assume that all possible targets can be computed at compile
  time (if there can be dynamically loaded classes).

* In the AOT, disable optimizations for dynamic calls with unique
  selectors (if there can be dynamically loaded classes).

TEST=pkg/dynamic_modules/test/data/dyn_call_from_host

Change-Id: I39d620aae3c116de03d4a2a3fd61864d88c48c8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493960
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-04-09 09:22:14 -07:00
Alexander Markov 61f45d66b2 [vm] Fix msvc x64/arm64 cross-build
This is a follow-up to
https://dart-review.googlesource.com/c/sdk/+/493921.

TEST=ci

Change-Id: I136845bc6b2ae0582100b8acadd9be0015d7694c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494022
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-09 08:47:40 -07:00
Ryan Macnak a0ab33ac52 [vm, ffi] Fix Fuchsia ARM64 build.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/52579
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try
Change-Id: I3e3377d0c973614b83664bfd704d5efe532d329f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493968
Commit-Queue: Liam Appelbe <liama@google.com>
Auto-Submit: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2026-04-08 20:29:40 -07:00
Ryan Macnak 68e2512ace [vm, ffi] Remove special case for simulator FFI callback thunks.
TEST=ci
Bug: https://dartbug.com/52579
Change-Id: I488af082d5d9db39da38c9ff1e8ac984454bff54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493921
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2026-04-08 16:43:09 -07:00
Ryan Macnak fb732a570d [vm, ffi] Remove special case for Fuchsia FFI callback thunks.
TEST=ci
Bug: https://dartbug.com/52579
Change-Id: I2c1ca144253bc0dbeda53321aa6fe462698095b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493502
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-04-08 16:43:02 -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
Ryan Macnak ed2bca33a3 Roll Clang from 637e9bc0f763 to 26697f4d07eb
TEST=ci
Change-Id: I3087eac61590edd0aa79e940146345d6370ff39f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493840
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-04-08 14:31:16 -07:00
Daeho Ro c53bdf2dab mach_o: support two level namespace
Closes https://github.com/dart-lang/sdk/pull/63116

GitOrigin-RevId: 8eb01fcda0586e02ec659285b357412e044b823c
Change-Id: I85a2baaa046d207fe1b928043e1e479d3a74a3d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493000
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2026-04-08 14:17:21 -07:00
Ryan Macnak db173bf585 [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: I6fa47b2c04b0abaae74210c86f9fdf17ec932db7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493222
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-04-08 10:38:35 -07:00
Alexander Aprelev 8999b65531 [vm/cleanup] Remove unused start_callback, enable_vm_service, paused_for_messages.
TEST=ci

Change-Id: I101a355de9b0c2b36c8977c3af962a3e283a72d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493862
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2026-04-08 10:05:40 -07:00
Alexander Markov 384f76e596 [vm] Cleanup dead code
TEST=ci

Change-Id: I0ba2ec4a46b81f4efcbf3e516a70a3c2b40bb74a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493861
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-04-08 09:52:39 -07:00
Tess Strickland 9bedae1b84 [vm,dyn_modules] Fix Bytecode ToCString functions.
Instead of using the Function String-creating methods, use the
Function CString-creating methods which avoids allocation that
causes issues when called from within the interpreter (especially
in debug mode, where asserts are triggered).

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: Ic43a831a6ec1ee4327e1fdf4dfc64bd09af5c04a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493801
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
2026-04-08 09:02:00 -07:00
Ryan Macnak 1dc1b015eb [dart:io, win] Don't delete the process list mutex during shutdown.
The exit callback might fire during or after dart:io shutdown.

TEST=ci (flaky)
Bug: https://github.com/dart-lang/sdk/issues/60499
Change-Id: I950ef4a6ba1d99a8eafb55cb051a60f0cb097e71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493485
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-04-08 08:33:32 -07:00
Alexander Markov 5653511163 [modular_aot] Serialization of type parameter types in the modular snapshots
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I1d0de6222681741acd6a25b06c0b4b3f12ca8534
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493101
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-04-08 07:44:03 -07:00
Ryan Macnak 9f929d1fcf [vm] Get SP without using VM generated stubs.
TEST=ci
Change-Id: Ie976408ff3cf5691a59081b7b405abe43d7adcc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493165
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-04-07 08:06:43 -07:00
Tess Strickland e1f76cb03e [vm_service] Separate retrieval and serialization of persistent handles.
Serializing the object stored in a handle may require allocation, so
serialization of the current (weak) persistent handles should not be
done under a no safepoint scope.

Instead, retrieve the stored objects and any needed metadata for the
current (weak) persistent handles under a no safepoint scope, and then
separately serialize the retrieved information outside of that scope.

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

TEST=vm/cc/Service_PersistentHandles on vm-dyn-*, which revealed this
     issue.

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: Ie9e32c758140aaebc7bd87a704119a8b82d0f8a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491300
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-04-07 06:09:01 -07:00
Ryan Macnak 55a2e4d548 [vm, mac] Replace deprecated readdir_r with readdir.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/63089
Change-Id: Ic689a4fb2e757b6f09e89946e9b37dc6d6bfc6e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492340
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-04-06 12:54:15 -07:00
Alexander Aprelev 8649806076 [vm/profiler/gardening] Fix TSAN failures in profiler.
Use relaxed atomics for sample fields.
Fix lock grabbing ordering.

BUG=https://github.com/dart-lang/sdk/issues/62873
TEST=ci

Change-Id: I9c4ae0c78d5b81a72dc8a9e4802f08fd57beb27a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493161
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-04-06 10:35:42 -07:00
Alexander Markov ee5f20b9b4 [vm] Fix 32-bit RISC-V build
Fix the following crash during Dart SDK build for simriscv32:

../../runtime/vm/compiler/stub_code_compiler_riscv.cc: 456: error: expected "FfiCallbackMetadata::kNativeCallbackSharedStubSize" = 186 >= actual "__ CodeSize() - shared_stub_start" = 190

TEST=ci

Change-Id: I42d66a91092515914b0a7d3f38fc59db7938c589
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492500
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-02 07:48:51 -07:00
Ryan Macnak 4ed176799e [vm] Move direct roots from IsolateGroup to ObjectStore.
TEST=ci
Change-Id: I8ac97b83c427ab83dec2d7418a55893d2b5342ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491980
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-04-01 09:56:13 -07:00
Ryan Macnak 7a69fd1b81 [vm] Don't request executable memory for code pages when running the simulator.
Countermand the executably relatively late so the heap still tracks the pages separately.

TEST=ci
Change-Id: Id435c50739565af7ab3225d6060b10c255ddfd50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491922
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-04-01 08:15:11 -07:00
Ryan Macnak e7f818b866 [vm, fuchsia] Always look for VmexResource.
TEST=ci
Bug: https://dartbug.com/52579
Change-Id: I856fb8ae5a5bc282471c1ecf3774fc49f7c5b57a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491926
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2026-03-31 19:59:09 -07:00
Ryan Macnak 585d44ca17 [vm, regexp] Remove inclusion of the urename.h header file.
This is an internal header file of the ICU4C library and should not be
included directly (it gets transitively included by the public header
files of the library).

TEST=ci
Bug: cl/891754607
Change-Id: I5ece920c7ced706fa32912cf23518e46c8c68b92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491900
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-31 15:36:18 -07:00
Ryan Macnak 1cea4f514e [vm] Gather global variables pointing into the VM isolate.
TEST=ci
Change-Id: Ia2110904f4b88aa13b06210902c5a673d9be475c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491705
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-31 12:55:51 -07:00
Ryan Macnak 90195a6a81 [vm, compiler] Shrink code size for ARM PushRegisters with SIMD registers.
TEST=ci
Change-Id: Ie9c79365fadc060fbf9a4ba8d224527444bab733
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491685
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-03-31 12:27:31 -07:00
Ryan Macnak 91cef061c7 [vm, compiler] Create a proper frame in the FFI callback trampoline.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/62932
Change-Id: I2b8de8555b3810e4838f4ac36d590a24159291ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490740
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-31 11:13:00 -07:00
Ryan Macnak 21a67c5c31 [vm] Flatten stub code handle list.
TEST=ci
Change-Id: I852120f3af711f385534e5d1b007705fb3aec078
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491684
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-03-31 08:38:50 -07:00
Ryan Macnak 26ead9f6d3 [vm, profiler] Don't attempt a Dart stack walk during FFI leaf calls.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/62932
Change-Id: I42bb6c8c9dd08c3ee004f10befffe3e484189147
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490780
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-03-30 10:13:26 -07:00
Alexander Markov b540d7e135 [vm] Fix parsing of DART_VM_OPTIONS environment variable
This change fixes the following problems when parsing DART_VM_OPTIONS
environment variable:

* Resize vm_options to accomodate for extra flags from
  DART_VM_OPTIONS.

* Prepend executable name to the argv to be compatible with
  implementation of Platform.executableArguments.

* Use strchr instead of strtok_r to avoid modifying value of
  DART_VM_OPTIONS environment variable in place.

TEST=pkg/dartdev/test/commands/compile_test.dart

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

Change-Id: I86e0ece20844888333b2a0765c82a5ad1fba54b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491001
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-03-26 19:52:00 -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
Ryan Macnak 3369dff852 [vm, compiler] Also accept record types in IA32's assert assignable.
TEST=lib/isolate/throws_in_microtask_test
Bug: https://github.com/dart-lang/sdk/issues/62968
Change-Id: Ib2b661c8867e697b93d3d00a18e688b699fac503
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490680
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-25 12:29:18 -07:00
Ryan Macnak 1d0195cad4 [vm] Use C++11 thread_local for TLS destructors.
Removes linker hack on Windows.

TEST=ci
Change-Id: Ib031f8f05e422084fa6652fee425f8e46884840e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490341
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-25 11:58:38 -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
Ryan Macnak 0a376fb28d [build] Don't depend on the Git repo using --ref-format=files.
With the newer --ref-format=reftable, .git/logs/HEAD does not exist, so the version generation steps would always be considered dirty.

Cf. c7e58f832a

Change-Id: Id8735a739b751e4a54c2e4beecbef1eb23771c53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488600
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-24 15:36:36 -07:00
Ryan Macnak 8779faa131 [vm] Remove gap from symbol list.
TEST=ci
Change-Id: Ib4aa1a48fdcf47f6e27c21428628d06d4de9fd9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490348
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-24 15:22:41 -07:00
Ben Konyi 6ea62c02fe [ Service ] Run the service's main() via _runMainIsolate
Prior to this change, the VM service isolate was configured to execute
`main` directly. This resulted in unexpected behavior around exceptions
thrown after the first asynchronous gap, which were unhandled but caused
the service isolate to exit silently with no error.

This change updates how the service isolate starts execution by
invoking `main` via `dart:isolate`'s `_runMainIsolate` method, similar
to how user isolates and the DartDev isolate start execution. This
results in the message handler being triggered, meaning the microtask
queue will be processed correctly and unhandled exceptions in
asynchronous contexts being reported.

TEST=Local testing with exceptions explicitly thrown from within the VM
service

Change-Id: I69475a86d923489fa216bc8e939a2726cf3ff2e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490220
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-03-24 11:57:40 -07:00
Ryan Macnak 0a30a91dd7 [vm] Update ApiNativeScope to C11 thread locals.
TEST=ci
Change-Id: Iec314b13981c0cd11f6dd28c2e881281c3a10a8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490300
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-03-24 11:26:23 -07:00
Nourhan Hasan 596e0b0849 [vm/service]: expose Pointer<T> address in VM Service Protocol
Pointer<T> instances were previously serialized as PlainInstance
with no address, making them opaque to all debugger clients.

TEST=pkg/vm_service/test/get_object_rpc_test.dart

Fixes: https://github.com/dart-lang/sdk/issues/62853
Change-Id: Ia44eb0fa0851332409680d8d593141fe25505114
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486460
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Nourhan Hasan <nourhan.m.hasan@gmail.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-03-24 10:23:38 -07:00
Slava Egorov 618d608c81 [perf_witness] Fix -o behavior with relative path
Target process and the recorder might be running in different working
directories so request to start recording should always use absolute
path.

This also cleans up how file recorders are created: it does not make
sense to create the recorder and the check if we can open the file
(in fact: creating recorder and failing to open file will cause
deadlocks). Thus this CL changes the code to first open the file
and only if we succeeded creates the recorder.

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

TEST=extended existing tests to cover this

Change-Id: Ib9d88ce23d93bcc5d6335ba1daebad2e6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490160
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2026-03-24 06:46:47 -07:00
Lasse R.H. Nielsen cdd8311b14 Make VM run microtasks after an event handler throws.
Tested: Test added for fix.
Change-Id: Ifbefb01ef0caf9de80e44c44e5de4cc51bb129cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489080
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2026-03-24 06:36:04 -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 Markov efce7c1cb0 [vm,dyn_modules] Fix single-target cid range dispatch for dynamically loaded classes
In AOT mode, when call site is transitioned from monomorphic state
(with receiver cid1) to polymorphic (with receiver cid2),
there is an optimization which checks if all _allocated_ classes
in the class id range cid1..cid2 have the same dispatch target.
If so, a specialized SingleTargetCall stub is used.

The problem is that 'allocated' bit is only set during precompilation,
and dynamically loaded classes were not considered as valid receiver
classes by this optimization.

As a result, the following situation could happen:
cid1 < cid3 < cid2,
cid1 dispatches to target1
cid2 dispatches to target1
cid3 should dispatch to target2, but it is still in range cid1..cid2 and
SingleTargetCall stub would incorrectly dispatch it to target1.

The fix is to treat all dynamically loaded classes as allocated when
checking for single target optimization.

TEST=pkg/dynamic_modules/test/data/single_target_cid_range_dispatch
Fixes b/493677699

Change-Id: I42e407385a5d9b0a4a1017f713b47587c3c6a818
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488920
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2026-03-19 06:12:41 -07:00
Alexander Markov d611d205e3 [modular_aot] Initial code generation for TypeCast, TypeTest
Also:
* Revise code generation for cycles in parallel moves using temporary
  register.
* Support splitting of live intervals both at even and odd positions.

TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I900edc275b59daf93604668eada1421dd125b217
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487982
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-03-18 14:53:09 -07:00
Ryan Macnak 5bc9ebab68 [docs] Update QEMU instructions with a narrower set of packages.
This uses ~4GB less disk space, ~1GB less to download.

Change-Id: Ia52232363fe216caf2f4ed2edb9889d615721b69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488921
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-03-18 14:39:30 -07:00