Commit Graph

65 Commits

Author SHA1 Message Date
Alexander Markov 27a5d75c2f [modular_aot] Code generation for UnaryBoolOp
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ia3913b94b6aa357b352d10572342fab3b55b4825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500482
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-06 09:48:04 -07:00
Alexander Markov 6251367ab1 [modular_aot] Compile closure functions and support captured variables
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ibbb4b4ed73c89f458e2b08898a96f4f1979965eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492663
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-06 09:47:58 -07:00
Alexander Markov 470f6e9fad [modular_aot] Regalloc fixes
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Idceb800084ace76b880f170683686b532ac4df67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499941
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-04 08:16:18 -07:00
Jens Johansen ec5e71ead4 [CFE] Rename additionalDills to additionalDillModules; don't use it to load platform
* Rename additionalDills to additionalDillModules to indicate that it
   is used to load a "module", not any old dill file.
 * Where additionalDills was used to provide the platform use sdkSummary
   instead.
 * Remove unused constructor in KernelCompilationResults.

Tested: Existing tests.
Change-Id: I5f73f61db73b2bc932c211fb0b2e66ec2f5c50c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495981
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-01 00:57:31 -07:00
Alexander Markov 54e607854a [modular_aot] Code generation for async/async*/sync*/await/yield/yield*
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ie8da89e09bfad68c65980abc1df69f9273bd6d00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497400
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-28 05:45:31 -07:00
Kilian Schulte 9e8fdef17c Add annotation-based creation location tracking
Closes https://github.com/dart-lang/sdk/pull/63011

GitOrigin-RevId: 926534c2f5d3cd1e9629cf25f6b028ab34c00e64
Change-Id: I88460a060faabeae8f611e88f23b2eb5fc99f21a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491702
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2026-04-28 03:06:03 -07:00
Alexander Markov dff95e77a4 [modular_aot] Avoid generating code for instance members of mixins
After mixin transformation, original members of mixins should not be
called. Only their clones in the mixin application classes can be
called.

By removing their bodies we can reduce code size and avoid any
complexity related to super-invocations of abstract members.

Change-Id: I0ae1bbac6e4c82356841fdc870bfd8ca1bac8fb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497102
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-22 06:30:33 -07:00
Alexander Markov bd698307ac [modular_aot] Define type arguments field in the built-in classes
Issue: https://github.com/dart-lang/sdk/issues/61635

Change-Id: I4a6093afc01a2c68143e6e7d29d7661e17854a0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497080
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-22 06:22:01 -07:00
Alexander Markov 11d732e537 [modular_aot] Translate async/async*/sync*/await/yield/yield* to CFG IR
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ib5a7bc509e0382ceea53365b9ca3543a76a7cce1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/496660
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-22 06:19:44 -07:00
Ryan Macnak cd26f5e1cc [vm] Add missing serialization clusters for VM isolate objects.
TEST=ci
Change-Id: I738cf1a189accd2e449728bb599b6b92b5797924
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/496800
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-04-21 10:13:04 -07:00
Alexander Markov 7bf09be8f3 [modular_aot] Bugfixes and improvements in regalloc
TEST=pkg/native_compiler/testcases/register_allocator_test.dart

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I22d88a6962290bd8aab0d4d3239d652e69242fbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495522
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-21 08:45:52 -07:00
Alexander Markov 4f960f11b1 [modular_aot] Initial implementation of late local variables
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I8414ff832a569c106728fc583ece6248f73c91e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494942
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-16 07:18:48 -07:00
Alexander Markov 015b06f0f5 [modular_aot] Fix register eviction to ignore AnyLocation uses
TEST=pkg/native_compiler/testcases/register_allocator_test.dart

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ibffdadfbf5faf4856f8cd2c5520acdb6853cb47f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495520
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-16 07:17:04 -07:00
Slava Egorov fff4f2324d [vm] Remove _HashFieldBase
This class is structurally equivalent to _HashVMBase and the only reason
for it to exist for inability of normal Dart classes to extend
_HashVMBase - but this can worked around by properly configuring
_HashVMBase class in bootstrapping.

TEST=ci

Change-Id: I5ca401e274920d2b4739424c6b6595306a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494140
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-04-13 10:10:42 -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
Alexander Markov 5789ef3f58 [modular_aot] Revise code generation for TypeTest
* Fix operand register.
* Correct Smi fast path.
* Implement slow path via runtime call.

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I12cac0db8465a057ce426e33dcbd8c9beb1823a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493460
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-08 07:52:06 -07:00
Alexander Markov da81aaa165 [modular_aot] Code generation for type literals
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Icbb7ff58d07e20b7119726d2a551157f844f25ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493102
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-04-08 07:44:08 -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
Alexander Markov b205d4c074 [modular_aot] Initial code generation for int shifts
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I59fbd4695aed381e834b03d617fee5dd9d371ec3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492920
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-04-08 06:50:29 -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
Alexander Markov 7ea3545d2c [modular_aot] Fix receiving of optional and named parameters when type arguments are passed
ArgumentsDescriptor.count does not include type arguments argument,
so receiving optional and named parameters should account for that
both when comparing count to a number of arguments and when
computing offset of an argument.

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I58c7f38e834453bdf15a5026051fa4f0375eae15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488561
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-03-18 14:53:17 -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
Alexander Markov 4d7a07355c [modular_aot] Initial code generation for AllocateList, SetListElement
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I49486d860d0a6222a439678664e855d733d9ce0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487540
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-16 07:41:04 -07:00
Paul Berry 4f333aa8d3 Bump cfg and native_compiler packages to language version 3.12.
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.

(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)

This change covers the following packages, which are owned by
alexmarkov, sra, and vegorov:
- pkg/cfg
- pkg/native_compiler

Changes to `pubspec.yaml` files were made manually.

Change-Id: I39c86badeeeeae558bbf079e6a1df6686a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484225
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
2026-03-13 14:34:54 -07:00
Alexander Markov 5f0275c5f0 [modular_aot] Compute object tags for predefined classes
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I83a700f87f273c5d426b6181350325cf0b905721
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487102
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-03-11 14:06:49 -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 Markov 085ed51099 [modular_aot] Support large offsets, revise usage of temp registers and fix BoxInt codegen
* Support large and unaligned offsets in Assembler.address, pairAddress
  and loadFromPool.

* Revise how temporary registers are used: reserve tempReg for code gen
  and temp2Reg for assembler.

* Clarify that inputs and outputs of the instruction can be allocated to
  the same register. Fix BoxInt code generation to account for the same
  input and output.

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Iaebc824ac2b5e8e0bdfed168c167528a1dbd82d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486821
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-03-11 13:21:54 -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 6fbd8491d8 [modular_aot] Code generation for binary int operations add/sub/mul/or/and/xor
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ic922522f77624ede28b05ab6c9e67f33c82859c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486281
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-09 13:01:58 -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
Alexander Markov b8389a7de2 [modular_aot] Closure calls
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Icd9a5ddc1a21785a946dcfd63cfce4ac54f8637b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/485561
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-03-05 15:51:29 -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
Alexander Markov 8a6955a272 [modular_aot] Optional and named parameters
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ib8a4cbb7312110b7daa82ca40555b452b0599549
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/485200
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-05 15:51:29 -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 Markov eb043c1725 [modular_aot] Initial code generation for AllocateClosure
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I15a08e9ac99510fceedbf3297fe9ed14904cbf5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484021
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-03-02 08:13:41 -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 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
Alexander Markov dc2d8a06b9 [vm,modular_aot] Lowering of type parameters
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I06098a379ba3f04b5e13bad11acc0dcc391fb30c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482364
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-02-24 06:16: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
Alexander Markov ba4bfeabda [vm,modular_aot] Support getter and setter selector names
Add 'get:' and 'set:' prefixes to getter and setter selectors.

Also revise snapshot serialization of private names to support
private getter and setter names. ast.Name is replaced with
VM-specific PrivateName as private getter/setter names
such as get:_foo are considered public by ast.Name
(as they don't start with '_').

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I7447cb457aa2463836c8cf6af3d12e1998fe325c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481441
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-02-23 08:07:29 -08:00
Alexander Markov 7eb7da6890 [vm,modular_aot] Initial code generation for interface calls
Also:
* Support arguments descriptors.
* Fix order of ClosureCall inputs in local function invocations.
* Fix order of passing arguments in all Dart calls.
* Fix handling of fields in InstanceSerializationCluster.
* Do not compile abstract methods and fields.
* Do not generate initializer functions for fields with trivial
  initializers.
* Initialize Code::code_source_map to an empty CodeSourceMap
  (in order to avoid failed assertions).

TEST=tools/test.py -n vm-modaot-mac-debug-arm64 language

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I40ff1b8234c32c41e08f3288a23e4abc173efcfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480020
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-02-23 08:03:48 -08:00
Alexander Markov 7712167f28 [vm,modular_aot] Refactor Smi size to depend on compressed word size
Smi should fit into the compressed word, so its size in bits
can be defined using kCompressedWordSize.

TEST=ci

Change-Id: Iabea40318edadd7245d3a4771b4606f81b689867
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/479521
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-02-10 09:05:51 -08:00
Alexander Markov a4be844171 Support more kinds of constant objects in module snapshots
Add support for constant lists, maps, sets, ints, doubles,
symbols, type literals and user-defined instances.

Also add initial support for function types (without
type parameters), extension types, nullable Never.

TEST=tools/test.py -n vm-modaot-mac-debug-arm64 language

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I9f73925759b44ac33515895c06ef2a3fcb97e04b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/479066
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2026-02-09 15:11:53 -08:00
Alexander Markov 3a9dbc9efa Initial code generation for instance field loads and stores
Also:
* Support receiving parameters on the stack.
* Computation of stack frame size.
* Mach-O symbols for functions and stubs.

Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ic89ce5dbcad27c34d18790f2b526f1d33dfd6693
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/478161
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-02-05 11:40:00 -08:00
Alexander Markov 151bc79032 Object allocation
TEST=tools/test.py -n vm-modaot-mac-debug-arm64 language
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ie569c19ef37e27f7f711dfc3d62db818691f28fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476600
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-02-03 13:09:02 -08:00
Alexander Markov f29628fe63 [vm] Move constants related to heap pages into Page
Moving these constants from global namespace to Page class prevents
possible conflicts with other kPageSize/kPageMask/kBlockSize constants
and allows us to export value of Page::kPageMask constant into runtime
offsets via runtime/vm/compiler/runtime_offsets_list.h.

TEST=ci

Change-Id: I4357f4644f0f5f7beba50184231fef55dd86b124
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476147
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-01-28 13:49:00 -08:00
Alexander Markov ca604cf41a Modular AOT compiler main
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I55eaf5267c63d75b317276dfeab4d27e93139db3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475407
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-01-26 09:25:01 -08:00