Commit Graph

22923 Commits

Author SHA1 Message Date
Ryan Macnak a0faceddd7 [vm] Reduce symbol roots.
TEST=ci
Change-Id: I09b1015cff6ae36c9d76a95e969bd9dd684c25fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488582
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-03-18 10:45:00 -07:00
Ryan Macnak ec77e28f26 [vm] Shrink the FFI callback stub.
Instead of switching over each of the different callback types and duplicating the call-dart-spill-call-runtime-restore in the stub, have the initial runtime call return a function pointer for the runtime call to end that kind of callback. A separate case for tail calls is still needed.

TEST=ci
Change-Id: I691487ca12337ddef1adaeec4c163c56e2feb09e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488261
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-03-18 10:18:06 -07:00
Ryan Macnak 28f94515fe [vm] Fix warning on newer GCC.
TEST=local build
Change-Id: Ic54b6bd6ae53cd4b5ef6dfa3d57ce05d8dff1755
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488522
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-03-17 12:28:30 -07:00
Ben Konyi e3ca6d824b [ Service ] Add expression evaluation support to dart_runtime_service_vm
Brings pass rate of package:vm_service tests to ~85%

TEST=Manual
Change-Id: I2335d98358362110add93c2acfe51c3fc1385237
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487560
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-03-16 11:14:52 -07:00
Ryan Macnak b76efb098b [vm, gc] Also apply back pressure during concurrent sweep.
When running without concurrent marking, the growth policy sets an allocation limit that triggers a blocking GC. When running with concurrent marking, the growth policy sets an allocation limit that triggers the start of concurrent marking, but the mutator will continue to allocate until marking completes. By itself, this would allow the heap to grow far beyond its working set size, so back pressure is applied to the mutator by making it do some incremental marking work in proportion to the amount it allocates. A similar race between mutator and GC exists for concurrent sweep, so make the mutator do some incremental sweeping too.

Cf. 305c3e30c6.

TEST=golem
Bug: https://github.com/dart-lang/sdk/issues/62762
Change-Id: I6f882e6893e1cd3b3591db8cd03b61eb06bfa02f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486828
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-16 10:24:42 -07:00
Ryan Macnak 1e3a9469d7 [vm, compiler] Fix kNativeCallbackSharedStubSize for debug MSAN.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/62835
Change-Id: I2b8d0fd63144df5ed7255ef9d44944af39d618a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487280
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-03-16 09:58:48 -07:00
Tess Strickland 32b8c8f12f [vm,dyn_modules] Fix the interpreter case in GenerateResumeStub.
Previously, it would always call the ResumeInterpreter runtime entry
passing null as the value to return to the resumed code. Instead,
appropriately retrieve the to-be-returned value from the stack.

Also fixes IL printing to print constants in non-SSA flow graphs and
adds Interpreter::TraceStackFrames, which prints the top frames of the
current stack, so calls to it can be added for easier debugging in the
future.

TEST=pkg/vm_service/test/async_star_step_out_test.dart
     (still fails, but the failure changes due to no longer spuriously
      calling get:current after the generator finishes)

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: Ibb3524d32c8c4e1320f4f9dfd35947eda7d6ca68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488181
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2026-03-16 09:35:38 -07:00
Alexander Aprelev 9bd916646a [infra] Roll clang to d0ddae678e3f634c988542dfbdde1dd0afe66344.
Update clang format, remove boringssl err.h from clang-tidy

TEST=ci
Change-Id: Ib73d89b292ee4dfa2249ec519071e7621bb92c22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487885
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-03-13 12:34:40 -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
Sigmund Cherem 354b0f8606 [dyn_modules] Support types in a dynamic interface.
This CL adds a new `can-be-used-as-type` section in the dynamic
interface to expose the type of a class or extension type, without
making them callable or exposing their members.

Details:
* add the new section to the documentation
* add support in the TFA transformation to annotate kernel nodes
* add support to the validator to check for proper usage from dynamic modules
* add CFE, transformation, and end2end tests.

The CL ignores DDC and Dart2wasm at the moment and we intend to approve
any failures. It's possible that DDC works due to its modular nature.

BUG=b/488343137
TEST=cfe, annotator, and e2e tests

Change-Id: I900b22b85950f8ac379eabaa2ef58f075e18519c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486340
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-03-12 09:46:50 -07:00
Ben Konyi a8aba7fab8 [ Service ] Add support for isolate-based RPCs to dart_runtime_service_vm
This change adds initial support for working with isolates in the Dart
Runtime Service and its backends.

The new `IsolateManager` base class tracks the set of active isolates
and their lifecycle events. The `VmIsolateManager` extends this class,
adding support specific to interacting with isolates within the Dart VM.

TEST=vm/cc/DartAPI_InvokeVMServiceMethod*_Exp

Change-Id: I3dfa298722c40dbdfdd58105cc78f31d058dd7a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486560
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
2026-03-12 09:08:14 -07:00
Alexander Markov 72042aedb9 [vm] Fix TSAN data race between Profiler::IsolateGroupShutdown and Profiler::SetConfig
TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/62837

Change-Id: Iee456945f3c09bc02e5449a476c56fa445b4ca7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487460
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-03-12 08:41:30 -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 Markov 09cd42db1c [vm] Expose object tags and max new-space object size via runtime offsets
Also, cleanup duplicate constant kTagBitsSizeTagPos.

TEST=ci

Change-Id: I83465af0cc8e93880ddae7d161151b397f8ec8c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487101
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2026-03-11 14:05:49 -07:00
Alexander Markov bcbc47d99c [vm] Expose predefined class ids via runtime offsets
TEST=ci

Change-Id: Ie0627c6c1ef32e1c21ee04aba84b05534f1f752b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486862
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-03-11 13:24:40 -07:00
Alexander Aprelev 46cf07fe35 [vm/shared] Ensure scratch register is requested as temp for LoadStaticFieldInstr.
TEST=tests/ffi/many_listener_callbacks_test/5 on vm-ffi-qemu-linux-release-arm

Change-Id: I6a60220bce6dbc760e3a027b1b023c59dff36ba7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487200
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-11 13:11:32 -07:00
Ryan Macnak 616ee51f99 Fix Fuchsia build.
TEST=ci
Change-Id: Ib13283c0d4d107c813d8aa1684caef68c356dddd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486826
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-03-10 16:44:26 -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
Ben Konyi f7a049dfb4 [ Service ] Initial implementation of VM Service based on package:dart_runtime_service
This change includes an initial implementation of the new VM service
implementation based on `package:dart_runtime_service`, along with the
necessary plumbing to start it in place of the legacy VM service
implementation.

The entrypoint for the new VM service implementation is located in
dart_runtime_service_vm/bin/vm_service_entrypoint.dart, which is
compiled into AppJIT and AOT snapshots when the
`--include-experimental-vm-service` flag is provided to `build.py`. To run
the VM with the new VM service implementation, the
`--experimental-vm-service` flag must be provided.

Currently, the experimental VM service implementation supports:

  - User specified ports
  - Authentication code flags
  - Enabling the HTTP server via SIGQUIT
  - Some service protocol RPCs that don't require an isolate ID (e.g.,
    `getVM`)

See go/dart-runtime-services-unification for more details.

TEST=Manual

CoreLibraryReviewExempt: dart:_vmservice is private
Change-Id: I4a58cd1fa0a386313baa3d5c5345720231279123
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484820
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-03-10 13:27:01 -07:00
Ryan Macnak 38743dd774 [vm] Remove unused dependency on ICU i18n.
TEST=ci
Change-Id: I6a09ef8af516495d479b5969aa89c9b2ceb9dc6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486824
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-10 12:36:30 -07:00
Ryan Macnak a74e0132e8 [build] Generate DW_AT_variables for bin_to_assembly data outputs.
This lets bloaty attribute the data symbol to its source file, allowing the binary size visualization to nest it appropriately.

TEST=runtime/tools/binary_size
Change-Id: I683ad6729d2fe2e1730dd3be70c6cce15bdf0003
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486524
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-03-10 09:14:30 -07:00
Alexander Markov 6746db1f31 [modular_aot] Fix live ranges of non-fixed temps, fix serialization of two-byte strings
* Live ranges of non-fixed register temporaries should interfere both
  with live ranges of inputs and outputs.

* When serializing a two-byte (non-Latin1) strings, ensure that
  characters in the data section are aligned by 2.
  However, already written data in the serialization buffer
  may be misaligned (as we're writing to a series of buffers), so
  write each code unit as separate bytes instead of writing them as
  Uint16List.

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ia9919218e473979529c8af48480a09adc1659b1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486540
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-03-09 13:02:03 -07:00
Alexander Markov d97566551b [vm,modular_aot] Boxing/unboxing of int and double values
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I9fe47364bf772ccedf21f95aa5b16b92b0215b3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486240
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-09 11:34:09 -07:00
Tess Strickland db8563d4d6 [vm,dyn_modules] Recognize the vm:invisible pragma.
Adds a new isInvisible flag for both FunctionDeclarations and
ClosureDeclarations and sets it if the function or closure declaration
is annotated with @pragma('vm:invisible'). This way, function visibility
is appropriately recorded even if options.emitAnnotations is false.

The bytecode reader checks for the isInvisible flag when reading
FunctionDeclarations and ClosureDeclarations and appropriately
sets the is_visible flag for the Function object accordingly.

TEST=pkg/dart2bytecode/test/bytecode_generator_test
     vm/dart/invisible_function_pragma_test

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: If435afbe5e74adc022ce064784b6b3e5e8a88164
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486381
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-03-09 10:16:02 -07:00
Johnni Winther 988cd0f9b7 [cfe][PrimaryConstructors] Add isRedirecting/SuperInitializer flags to InvalidInitializer
This adds isRedirectingInitializer and isSuperInitializer to the Initializer hierarchy and adds flags to InvalidInitializer to signal when the InvalidInitializer should be taking as a redirecting or super initializer. This allows us to avoid miscatergorizing such declarations when they are erroneous.

Part of #61700

TEST=existing

Change-Id: If0fabbda10b72304999a5380fce74f9e8fa91ca4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486180
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2026-03-09 03:36:55 -07:00
Alexander Aprelev 3c24bf2413 [gardening] Assert Record FieldNames contents.
Fixes https://github.com/dart-lang/sdk/issues/62850
TEST=ci

Change-Id: I8e81dc7cb0e17b6ee43bfaaba1553ae932d74f44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486261
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-03-06 13:38:53 -08:00
Alexander Markov fd18bbb4a3 [vm,modular_aot] Dynamic calls
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I13eaccbefae4917500ee3aeb6a09d71f480a4c94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/485560
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-05 15:51:29 -08:00
Ryan Macnak da0ba8eb5c [vm] Unpoison return value from FFI callbacks.
Also fix XMM1/FA1/D1/D2/D3 getting clobbered for isolate-group bound callbacks and sync-ownership callbacks.

TEST=msan
Bug: https://github.com/dart-lang/sdk/issues/62816
Change-Id: Id721825fdec1984189051ea1c5cc73791bad53be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/485300
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-04 17:15:55 -08:00
Ryan Macnak ee5371268c [vm, windows] Get DSO offsets without needing SymInitialize.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/60499
Change-Id: Ie9d45072e5a74522c22a99a18277ccbed53636b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/485581
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-04 16:07:20 -08: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
Ryan Macnak 4bb6609724 [vm] C++20 updates.
- std::atomic_ref
  - std::bit_cast
  - std::rotl,rotr
  - designated initializers

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/42074
Change-Id: I7be17147723db6f7620a147e75d38ebe46393f8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484700
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-03-04 12:40:19 -08:00
Slava Egorov a1fcb5e863 [vm] Zero initialize registers in the regexp interpreter
RegExp compiler produces bytecode which might issue PushRegister
before SetRegister - which leads to a use of uninitialized value
under MSAN if these registers are not initialized.

TEST=ci

Change-Id: I011545cf05de62490d71503ea5a60a656a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/485000
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2026-03-03 07:04:06 -08:00
Tess Strickland 7ad5ee3dae [vm,dyn_modules] Print line and column for synthetic token positions.
When using the --dump-kernel-bytecode flag, also print the line and
number of the source position encoded by a synthetic token position.

Also use the decoded value for a synthetic token position when
converting it as a C string for printing, which also makes it easier to
correlate real and synthetic token positions encoding the same source
position.

Also change the long outdated comment about synthetic token positions
not encoding a real source offset, as most if not all uses of them
do actually encode a real source offset.

TEST=manual use during debugging

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try
Change-Id: Ic16e320e9a10d8343e8a37c8270c7076bb7052c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484943
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-03-03 06:58:35 -08:00
Alexander Aprelev f3bc347448 [core/shared] Allow for BigInt to work in isolategroup-bound callbacks.
Introduce runtime checks for BigInt to allow it being used as deeply immutable class.

TEST=run_isolate_group_run_test

Bug: https://github.com/dart-lang/sdk/issues/61030
Bug: https://github.com/dart-lang/sdk/issues/62601
Change-Id: I343862bdf5603be571d3bf937261dd61aca9ca0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/477040
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-03-02 13:52:34 -08:00
Alexander Aprelev 6d4a7f41d9 [vm/shared] Ensure immutable list is used as backing store for const map.
This is the follow-up to https://dart-review.googlesource.com/q/commit:e9229a05859252211ebbdc99a3ea8de6edb40f1b with fixes for broken standalone/io tests.

TEST=standalone/io on vm-eager-optimization bots

Bug: https://github.com/dart-lang/sdk/issues/62801
Change-Id: Iffd0068ea71f13e91198ea239dac9e498a39061c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484780
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-02 13:19:49 -08:00
Ryan Macnak e661d17890 [vm] Update supported-architectures.md.
Fix extra cell in table. Note increases in Mac ARM64 and Android/Fuchsia RISC-V baselines.

Change-Id: I6cfc9e55fd7d3a8ac60e4c768951b43989a95134
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/483365
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-03-02 10:29:33 -08:00
Alexander Markov 9657cf7a02 [vm,modular_aot] Support serialization of local function references in modular snapshots
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I5b5c9b0cc66d44b25691d72df34efb8071c1564b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484221
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-02 08:13:26 -08:00
Alexander Markov ffa7e990f0 [vm,dart2bytecode] Use local function IDs to register and find functions
TEST=ci

Change-Id: I275a7f9e81a8fa69a004518b150c7dfcf1fe7bd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/483844
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-02 07:55:38 -08:00
Alexander Markov 99929813b0 [vm,kernel] Add unique IDs for local functions in kernel AST
The unique IDs are assigned during VM-specific lowering transformation
and recomputed during TFA tree shaking.

The IDs are not assigned when local function AST nodes are created
as it makes certain AST transformations very fragile (e.g. moving
a sub-tree to another parent, cloning a tree to insert into another
member).

The IDs will be used to identify local functions within a member by
the VM and different compilers (dart2bytecode, modular AOT).

TEST=ci

Change-Id: Ifa5dc007322a0137776961d364bbf8565137b318
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/483840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-02 06:55:31 -08:00
Tess Strickland b1005044db [gardening] Fix TRACE_TYPE_CHECKS on MSVC.
Add __VA_OPT__ to guard the trailing comma, since we use
the /Zc:preprocessor flag.

Remove the conditional guard, since __VA_OPT__ is the
portable way of doing this in C++20, and we target that
version of the language standard when compiling.

TEST=build on vm-msvc-win-x64,vm-msvc-win-arm64

Cq-Include-Trybots: luci.dart.try:vm-msvc-win-arm64-try,vm-msvc-win-x64-try
Change-Id: I5b718858300d72679e9c8bced5f1419e206a2e94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484621
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2026-03-02 05:47:34 -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 c3bd038008 [vm] Fix profile streaming in debug mode.
Simplify isolate group enter-exit logic in EmitModuleSymbolsFor: always
call it without an active isolate group. Make sure that we 
destroy StackZone before trying to exit the isolate.

Skip unit test with deferred units on Mac OS: as we don't support
deferred units when writing out Mach-O files currently.

TEST=ci

Change-Id: I8a8615f045781f263c92c45eecf955366a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/483760
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2026-02-26 03:28:56 -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 d5e2f31993 [vm] Fix race compiling regexp.
TEST=iso-stress
Change-Id: I013d7d91d37b62ed60d7f067a62c6f419c0d0a7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/483362
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-02-24 15:23:18 -08:00
Ryan Macnak c87555403c [vm] Avoid heap walk for AOT profiler.
TEST=pkg/vm_service
Change-Id: I6d5d6cc5d6f879f8a0e128c7862d0ff031552211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482963
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-02-24 10:24:31 -08:00
Ryan Macnak 5e173fa736 [vm] Mark natives as unreachable in gen_snapshot.
This allows a great deal of linker GC resulting in a much smaller binary. The benefit multiplies for Flutter development because the Flutter tool downloads many variant copies of gen_snapshot.

out/ReleaseX64/exe.stripped/gen_snapshot -1.55M (-23.4%)

TEST=ci
Change-Id: I9f6e650f78ea52c9c6953320a669b71019403236
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482965
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-02-24 10:08:30 -08:00
Alexander Markov 0ec57dd561 [vm,modular_aot] Initial code generation for static field loads and stores
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I07aa7cabf8fe78c0f98c17b98ae85bdc903b99c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482920
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-02-24 08:54:39 -08:00
Slava Egorov 1418cb1b9c Roll Perfetto to 49c59636465f2a32f4d83cff835538ba7bf8d732
Drop libprotobuf dependency and update compile_perfetto_protos
to rely on externally provided protoc and protozero_plugin. 
This is done because protoc does not build with our current
toolchain and fixing this build requires rolling new protobuf,
protobuf_gn and perfetto. Which also pulls more external dependencies
like abseil.

Regenerate Perfetto *.pbzero{.cc,.h}, *.dart files

TEST=ci

Change-Id: I11a32aa07e810b48ac12502e526bbaee6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482781
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2026-02-24 03:24:32 -08:00