Commit Graph

777 Commits

Author SHA1 Message Date
Tony 57b27a7b44 Refactor Dart runtime to replace DART_DYNAMIC_MODULES with DART_BYTECODE_INTERPRETER
- Updated conditional compilation flags throughout the runtime codebase to transition from DART_DYNAMIC_MODULES to DART_BYTECODE_INTERPRETER.
- Adjusted logic in various files including object_graph_copy.cc, object_reload.cc, profiler.cc, and others to ensure compatibility with the new interpreter model.
- Ensured that all references to dynamic modules are replaced with bytecode interpreter checks, maintaining functionality for interpreted code execution.
- Modified stack frame handling and service-related code to align with the new interpreter architecture.
- Updated tests and service implementations to reflect the changes in the runtime environment.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-06-25 01:58:41 +08:00
Tony 08139af589 Add compact AOT patching support and related APIs
- Introduced Dart_SetObfuscationMap to restore obfuscation maps before AOT precompilation.
- Added Dart_AotPatchInstallOptions structure for AOT patch installation options.
- Implemented Dart_AotPatchingEnabled to check if compact AOT patching is supported.
- Created Dart_SetAotPatchKeyCallback for AES key resolution during AOT patch installation.
- Developed Dart_InstallAotPatch for validating and installing encrypted AOT patches.
- Added Dart_FreeAotPatchPayload to free memory allocated for patch payloads.
- Updated runtime_args.gni to include dart_enable_aot_patching flag.
- Added tests for AOT patching functionality and ensured exported symbols include new APIs.
- Refactored existing code to accommodate new AOT patching features and improve error handling.
2026-06-24 03:00:14 +08:00
Ryan Macnak 546bf07f7d [vm] Remove transitions for removing VM isolate.
TEST=ci
Change-Id: I65c315e9efc3cd7b8b47d2c167681986278644da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/502780
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-02 10:28:10 -07:00
Ryan Macnak d36adbacaf [vm] Remove the VM isolate.
The former contents of the VM isolate are now included into each isolate group. This makes each isolate group's heap independent, and in particular allows each heap to be allocated to a separate pointer cage (not done in this CL).

The duplicated stubs that allowed PC relative calls are removed, since the originals can now be the target of PC relative calls.

The bootstrapping needing to load an AppJIT or AppAOT snapshot is reduced to allocating the oddballs. The code is entirely dropped in the AOT runtime, but the JIT runtime still has it to allow for flags to affect the compilation of the stub code. Further refactoring might be able to remove this for the JIT runtime too, with only gen_snapshot knowing how to bootstrap.

Class serialization no longer distinguishes predefined classes.

The page containing null is marked as never-evacuate. null, false and true must not move because the compiler relies on their low bits having certain patterns for some optimizations. (Previously, the entire VM isolate heap never moved.)

Compaction is disabled for IA32. Due to register pressure, some stub calls must not use a scratch register and embed the address of Code.

The page containing the call-through-safepoint stub is frozen when running with --write-protect-code and the stub is created at runtime (instead of loaded from an AppJIT or AppAOT snapshot). This stub must remain executable even during a safepoint, as a foreign call might during return during a safepoint and only block after the stub directs it to the runtime.

The snapshot symbols are renamed to kDartSnapshotData and kDartSnapshotText. There is no need to distinguish the VM isolate's snapshot, and snaphots are per isolate group not per isolate. Aliases with the old names are added to ease migration.

Some global flags that were automatically set based on the VM isolate's snapshot are now isolate group flags and automatically set by the isolate group's snapshot.

TEST=ci
Change-Id: Iee82016057d609112e9b021d178fc3d4d18b5044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500621
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-18 11:35:03 -07:00
randomizedcoder 1f198e7596 [vm] Remove unused assert.h, add direct stdint.h includes in runtime/include/
Closes https://github.com/dart-lang/sdk/pull/63187

GitOrigin-RevId: 217908e166dfd4eea959e9c81b81ef9dadb0556c
Change-Id: I1ea2f133cede7d9bd6baf077882e41b86546ea9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/496180
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2026-04-20 18:48:31 -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
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
Alexander Markov a37d042e68 [vm] Initial implementation of module snapshot reader
TEST=manual
Issue: https://github.com/dart-lang/sdk/issues/61635

Change-Id: I27f712d9687d45a09173b1018bc08812dd18658e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/460580
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-11-21 06:42:16 -08:00
Tess Strickland bc021bbc01 [vm] Output accompaning relocatable object for Mach-O snapshots.
In order to appropriately generate .dSYMs for a snapshot and allow
the strip tool to be used on the snapshot afterwards, add a mode that
not only outputs the snapshot (sans DWARF information) but also
an associated relocatable object file that contains the program's DWARF
information. That allows dsymutil to retrieve the DWARF information
from the relocatable object when run on the snapshot prior to stripping.

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

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

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

Change-Id: I2bf4bacb70c41299b8b6fdb7635c2374acf7a07d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/457420
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-11-19 07:45:52 -08:00
Slava Egorov dec87b98f0 [io] Provide dart::bin::SetupDartIoLibrary
Instead of requiring embedder to initialize dart:io by bits and pieces
by invoking various hooks and setting fields provide a structured C++
API for preparing dart:io for execution.

TEST=ci

CoreLibraryReviewExempt: VM specific changes only
Change-Id: I66e95c0a451d384b4f7582d1df059e506a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/454062
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-10-14 13:15:21 -07:00
Slava Egorov ed6bab847b [io] Rewrite _FileSystemWatcher implementation
Existing implementation is an entangled mess which consists of shared
code residing in the base class which in random places invokes a number
of undocumented poorly named methods overloaded in OS specific
subclasses. Some of these methods mutate static state. There are no
clear lifetime guarantees for different parts of the system (including
comments saying that some values might or might not be valid at certain
points).

The rewrite aims to clean most of this up - sharing everything that can
be shared and moving OS specific logic to clearly documented methods.

Furthermore, we change the code to ensure proper lifetime guarantees -
so we no longer find ourself in situations where we don't know whether
pathId is valid or not.

This refactoring by itself fixes a number of issues, most specifically a
bug where watcher would stop receiving events on Windows because
DirectoryWatchHandle ends up allocated at precisely the same address as
a previous destroyed one - which confuses Dart side to think that newly
created handle is the same as the old one (due to a race between event
handler thread and Dart thread).

We fix Windows lifetime issue by a) not keeping pathId based mapping in
the watcher anymore and b) keeping DirectoryWatchHandler alive until it
is stoped by the Dart side - this is achieved by retaining it after it
is created and releasing it once path is unwatched. This way Dart side
is always sure that pathId values are valid until they are explicitly
released via _unwatchPath - which makes code very uniform.

To make sure that native objects created by _watchPath are released when
surrounding isolate exists abruptly (e.g. via Isolate.exit - without
letting Dart code to shutdown and call _unwatchPath naturally) we attach
NativeFinalizer to them. This fixes the existing leak of file watchers
on Mac OS X - as Node objects it created were not freed if surrounding
isolate exited. Note that inotify descriptors did not leak in the same
way because they were wrapped into sockets.

Finally, this refactoring also make sure that the last subscriber
cancelling subscription on filesystem event stream will get a proper
cancellation future back and can wait for the watcher to shutdown.
Previously implementation used broadcast streams which simply return an
already completed future when subscriber cancels. New implementation
uses Stream.multi instead which gives a better result. Now doing
watch().listen().cancel() returns a future which will only complete once
watcher is fully disposed (e.g. inotify descriptor is closed). Bad
behavior was revealed by analysing standalone/regress_52715 - which
revealed that repeatedly watching and cancelling might flakely cause us
to hit fd limit depending on whether eventhandler thread can keep up
closing file descriptors created by the main thread or not.

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

TEST=standalone/{regress_61378,file_system_watcher_isolate_exit_leak}

CoreLibraryReviewExempt: VM only changes.
Change-Id: I6a6a69642b1f2673f2be78434bc64270846ad8c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/450921
Reviewed-by: Lasse Nielsen <lrn@google.com>
2025-10-01 11:28:05 -07:00
Artem Strygin 1dc1d36820 [vm] Add C Api for maps making.
Also allow to write simple conversions from std::map to "Dart Map" using
"c++ template magic".

R=alexmarkov@google.com

TEST=vm/cc/DartAPI_MapCreate

Bug: nothing
Change-Id: I11f3271df6880825bd417ee5532c56bacfa7278d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/449280
Auto-Submit: Art Snake <art-snake@yandex-team.ru>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-09-18 06:56:21 -07:00
Artem Strygin 522e611c9d [vm] Add useful type getters to C API
This allows direct access to String, int, bool, double, Object types
instead of requiring name based lookups via Dart_LookupLibrary and
Dart_GetType.

R=dacoharkes@google.com

TEST=vm/cc/DartAPI_CoreTypes

Change-Id: I2aba317be3b4be21f37d61843a328a5146417e54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/450160
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Art Snake <art-snake@yandex-team.ru>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-09-18 04:45:29 -07:00
Alexander Aprelev 2d7c7b039c [vm/usertag] Move usertags from Isolate to Thread.
This allows use of usertag api in isolategroup-bound context.

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

Change-Id: I73d5631ba6eddcc06965b982bc199221ac021cd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445967
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2025-08-25 14:43:41 -07:00
Liam Appelbe f3bbeb61f7 [vm] Fix compiler warnings in dart_api.h
Bug: https://github.com/dart-lang/native/issues/2482
Change-Id: If55cda96d74c519b8b36b4112290914bc2020a67
TEST=CI
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445860
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2025-08-19 17:04:39 -07:00
Alexander Markov c124f459ac [vm,test_runner] Run vm/* tests against interpreter
Introduce Dart_LoadLibraryFromBytecode to support loading unit test
libraries from bytecode.

TEST=ci

Change-Id: I7706fdb2acaf906f01f27f671e7193b9755efe0f
Cq-Include-Trybots: luci.dart.try:vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439080
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-07-08 06:49:34 -07:00
Alexander Markov 05c2f3b0b1 [vm,dyn_modules] Hook interpreter to the standalone VM
When dynamic modules are enabled, standalone VM can now run bytecode
binaries directly. Also, if --interpreter flag is specified, Dart
source is compiled to bytecode and interpreter is used to run it.

This will allow us to test VM service capabilities including
debugging and hot reload against the interpreter.

TEST=manual

Change-Id: Ibb5a67f4844485c4ed90b8a7568dc42fa552fcac
Cq-Include-Trybots: luci.dart.try:vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436421
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2025-06-24 05:59:21 -07:00
Tess Strickland b85d7622f5 [vm] Add N_OSO symbolic debugging symbol to unstripped Mach-O symtabs.
Adding this allows dsymutil to parse a DebugMap from the Mach-O file,
which allows it to then create an appropriate .dSYM package for the
dylib if desired.

TEST=vm/dart/unobfuscated_static_symbols_test

Cq-Include-Trybots: luci.dart.try:vm-aot-mac-release-arm64-try,vm-aot-linux-release-simarm_x64-try
Bug: https://github.com/dart-lang/sdk/issues/60307
Change-Id: I723fde90b73d74e06840418c693858f5729cea58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/434381
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-06-17 02:40:40 -07:00
Ryan Macnak ab4f9351b1 Rename vm_platform_strong.dill to vm_platform.dill.
The name has always been annoying because it did not add strong typing. And now there aren't variants of the VM platform to distinguish.

Leave a copy at the old name to not immediately break illegal uses.

TEST=ci
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,flutter-frontend-try,flutter-linux-try
Change-Id: Ie76fa7f16940aa1ba8d582eb5197f0ae55dc8938
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429828
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-16 18:33:38 -07:00
Ben Konyi 60b217ff2d [ Observatory ] Remove Observatory from the Dart VM
Also cleans up some references to Observatory in various places.

Work towards https://github.com/dart-lang/sdk/issues/50233

TEST=N/A
CoreLibraryReviewExempt: Not modifying public core libraries.
Change-Id: I1f36b4e6f1fd9a59a579d719aafa599906eedb3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429141
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2025-06-11 15:19:55 -07:00
Ryan Macnak 03301c9bfb [vm] Support assembly output for Windows.
The resulting DLL lacks debugging information / PDB.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/60812
Bug: https://github.com/dart-lang/sdk/issues/60813
Cq-Include-Trybots: luci.dart.try:vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-release-arm64-try,vm-aot-win-release-x64-try
Change-Id: I305bad0081ec24f27249ad9b75ff8d32fa9c4893
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428200
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2025-06-02 12:12:04 -07:00
Tess Strickland 6b53073eae Reland "[vm, gen_snapshot] Add app-aot-macho-dylib option for AOT snapshots."
This is a reland of commit 38ef28a058

Fixes:

* Fix comparisons in ASSERT_EQUAL statements on 32-bit architectures.
* Take simulated architectures into account when deciding whether
  to use dlopen() for native shared object formats.
* Fix struct/field name collision for GCC.
* Use CPU_TYPE_ANY/CPU_SUBTYPE_ANY for architectures that do not
  have more specific cpu_type_t/cpu_subtype_t constants defined.

Original change's description:
> [vm, gen_snapshot] Add app-aot-macho-dylib option for AOT snapshots.
>
> This is the initial framework for creating snapshots as Mach-O dynamic
> libraries. Note that this framework is not 100% feature complete
> compared to generating Mach-O snapshots via assembly. In particular,
> the directly-compiled Mach-O dylib does not yet contain compact
> unwinding information.
>
> Other changes:
>
> * Adds UuidCommand to the native_stack_traces package's Mach-O reader,
>   which now appropriately returns the UUID as the build ID for Mach-O
>   shared objects.
>
> * Adds Utils::Basename(path) for portably retrieving the basename
>   from a path. (Returns nullptr for all arguments where it is not
>   currently implemented on Fuchsia or Windows.)
>
> * Adjusts vm/timeline.h to avoid pulling in <mach_o/loader.h> on MacOS,
>   as that interferes with uses of the namespaced Mach-O definitions
>   in platform/mach_o.h.
>
> * Only attempt to dlopen() a snapshot if ELF is the native format
>   for the host platform or the snapshot is not an ELF shared object.
>   If dlopen() is used, report the error message if it fails rather
>   than attempting to manually load the snapshot as an ELF shared object.
>
> * Fix the magic number stored in DylibAppSnapshot for loaded non-ELF
>   dynamic libraries.
>
> * Remove the detection of reverse-endian Mach-O magic numbers in
>   DartUtils::SniffForMagicNumber(), since all our Mach-O related code
>   assumes host-endian Mach-O files and so there's no point other than
>   to give a slightly better error message when failing.
>
> TEST=vm/dart/exported_symbols_test
>      vm/dart/unobfuscated_static_symbols_test
>      vm/dart/use_dwarf_stack_traces_flag_test
>      vm/cc/CanDetectMachOFiles
>
> Issue: https://github.com/dart-lang/sdk/issues/60307
> Change-Id: Idf5b49d6c6d035ab033509613212b95520d65965
> Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-mac-release-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415020
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

TEST=vm/dart/exported_symbols_test
     vm/dart/unobfuscated_static_symbols_test
     vm/dart/use_dwarf_stack_traces_flag_test
     vm/cc/CanDetectMachOFiles
     ci on trybots that failed on the original CL

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-mac-release-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try,vm-linux-debug-ia32-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv32-try,vm-aot-linux-debug-simriscv64-try,vm-aot-linux-release-simarm_x64-try,vm-gcc-linux-try,vm-ubsan-linux-release-arm64-try
Change-Id: Iaffea0ddc6173100c8b5b2a9fe46c45f4f611a2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431240
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-05-27 06:30:20 -07:00
Tess Strickland 38ea3a8f5e Revert "[vm, gen_snapshot] Add app-aot-macho-dylib option for AOT snapshots."
This reverts commit 38ef28a058.

Reason for revert: Breaks build on debug mode 32-bit arches,
                   release mode simarm_x64

Issue: https://github.com/dart-lang/sdk/issues/60307
Original change's description:
> [vm, gen_snapshot] Add app-aot-macho-dylib option for AOT snapshots.
>
> This is the initial framework for creating snapshots as Mach-O dynamic
> libraries. Note that this framework is not 100% feature complete
> compared to generating Mach-O snapshots via assembly. In particular,
> the directly-compiled Mach-O dylib does not yet contain compact
> unwinding information.
>
> Other changes:
>
> * Adds UuidCommand to the native_stack_traces package's Mach-O reader,
>   which now appropriately returns the UUID as the build ID for Mach-O
>   shared objects.
>
> * Adds Utils::Basename(path) for portably retrieving the basename
>   from a path. (Returns nullptr for all arguments where it is not
>   currently implemented on Fuchsia or Windows.)
>
> * Adjusts vm/timeline.h to avoid pulling in <mach_o/loader.h> on MacOS,
>   as that interferes with uses of the namespaced Mach-O definitions
>   in platform/mach_o.h.
>
> * Only attempt to dlopen() a snapshot if ELF is the native format
>   for the host platform or the snapshot is not an ELF shared object.
>   If dlopen() is used, report the error message if it fails rather
>   than attempting to manually load the snapshot as an ELF shared object.
>
> * Fix the magic number stored in DylibAppSnapshot for loaded non-ELF
>   dynamic libraries.
>
> * Remove the detection of reverse-endian Mach-O magic numbers in
>   DartUtils::SniffForMagicNumber(), since all our Mach-O related code
>   assumes host-endian Mach-O files and so there's no point other than
>   to give a slightly better error message when failing.
>
> TEST=vm/dart/exported_symbols_test
>      vm/dart/unobfuscated_static_symbols_test
>      vm/dart/use_dwarf_stack_traces_flag_test
>      vm/cc/CanDetectMachOFiles
>
> Issue: https://github.com/dart-lang/sdk/issues/60307
> Change-Id: Idf5b49d6c6d035ab033509613212b95520d65965
> Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-mac-release-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415020
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

Issue: https://github.com/dart-lang/sdk/issues/60307
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-mac-release-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Iff2ab4c84a513a184784129f456bd357ae8e3a67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431220
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
2025-05-27 01:05:48 -07:00
Tess Strickland 38ef28a058 [vm, gen_snapshot] Add app-aot-macho-dylib option for AOT snapshots.
This is the initial framework for creating snapshots as Mach-O dynamic
libraries. Note that this framework is not 100% feature complete
compared to generating Mach-O snapshots via assembly. In particular,
the directly-compiled Mach-O dylib does not yet contain compact
unwinding information.

Other changes:

* Adds UuidCommand to the native_stack_traces package's Mach-O reader,
  which now appropriately returns the UUID as the build ID for Mach-O
  shared objects.

* Adds Utils::Basename(path) for portably retrieving the basename
  from a path. (Returns nullptr for all arguments where it is not
  currently implemented on Fuchsia or Windows.)

* Adjusts vm/timeline.h to avoid pulling in <mach_o/loader.h> on MacOS,
  as that interferes with uses of the namespaced Mach-O definitions
  in platform/mach_o.h.

* Only attempt to dlopen() a snapshot if ELF is the native format
  for the host platform or the snapshot is not an ELF shared object.
  If dlopen() is used, report the error message if it fails rather
  than attempting to manually load the snapshot as an ELF shared object.

* Fix the magic number stored in DylibAppSnapshot for loaded non-ELF
  dynamic libraries.

* Remove the detection of reverse-endian Mach-O magic numbers in
  DartUtils::SniffForMagicNumber(), since all our Mach-O related code
  assumes host-endian Mach-O files and so there's no point other than
  to give a slightly better error message when failing.

TEST=vm/dart/exported_symbols_test
     vm/dart/unobfuscated_static_symbols_test
     vm/dart/use_dwarf_stack_traces_flag_test
     vm/cc/CanDetectMachOFiles

Issue: https://github.com/dart-lang/sdk/issues/60307
Change-Id: Idf5b49d6c6d035ab033509613212b95520d65965
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-mac-release-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415020
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-05-26 08:52:26 -07:00
Derek Xu 75311aefa8 [VM/Timeline] Add Microtask stream
TEST=runtime/vm/dart_api_impl_test.cc

Change-Id: Icb078489f3600ac0fb8b314ca3bf748f482a687e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/422860
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-04-22 07:42:27 -07:00
Liam Appelbe cb02b8726a [vm] Isolate ownership API
go/dart-isolate-ownership-api

Change-Id: Ia778a916de3fecec9f0aa1a5c8bc9fd7dd421267
Bug: https://github.com/dart-lang/native/issues/1908
TEST=runtime/vm/dart_api_impl_test.cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407700
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2025-02-11 20:09:11 -08:00
Alexander Markov 7fd0d073a9 [vm] Cleanup experimental createUriForKernelBlob API
This API was added in https://dart-review.googlesource.com/c/sdk/+/232682
in order to support one of the strategies for running macros,
but it is no longer needed.

TEST=ci

Change-Id: I8da233932351f27fd5dfd01b66f481195d7ca0e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407540
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-02-03 12:55:53 -08:00
Daco Harkes 9a6503b500 [vm/ffi] Add embedder API for resolving asset ids
Extends the `NativeAssetsApi` with a `dlopen` that takes an asset id
instead of an asset path. This enables the embedder (instead of the
vm) to resolve the asset id to asset path.

Additionally, the `NativeAssetsApi` gets an `available_assets`
callback to report which asset ids are available if asset resolution
failed. (Otherwise, users would lose this important part of the error
message on failed resolution.)

We postpone migrating the Dart standalone embedder to this API: https://dart-review.googlesource.com/c/sdk/+/388160. That CL verifies
this new API and it's implementation. Without that CL this new API is
hard to test. So, no further tests are added here.

Tests that verify the old behavior for the standalone embedder:

TEST=tests/ffi/native_assets/*
TEST=pkg/dartdev/test/native_assets/*

Bug: https://github.com/flutter/flutter/issues/154425
Change-Id: I04d0fb45dc5663e63d91b21a6f5764929f10aaff
Cq-Include-Trybots: dart/try:vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-win-release-arm64-try,vm-aot-asan-linux-release-x64-try,vm-asan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-msan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388161
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-10-04 14:17:21 +00:00
Vyacheslav Egorov e2efffa005 [vm] Simplify implementation of native ports
This reland commit 5a32d8bc7c with a fix
for thread leak (Issue #56717): when `ThreadPool` is shutting down
asynchronously the last worker should detach itself to prevent
leaking associated low-level data structures, because no thread will
join it.

A hang in service isolate shutdown (caused by an existing bug) was fixed by commit 157a0dc7f9.

This CL turns native ports into a thin abstraction over underlying
thread pool instead of building them as full fledged MessageHandler.

This allows to easily implement a variation of native ports which can
handle messages concurrently with the given degree of concurrency.
This type of port can be used to greatly simplify implementation of
IOService - which previously had to do its own concurrency management
on top of "single threaded" native ports. This capability is exposed
as `Dart_NewConcurrentNativePort` API.

The new implementation is in general much cleaner then the old one
with one exception: `Dart_CloseNativePort` API has unfortunate design
where underlying message handler is destroyed asynchronously and
`Dart_CloseNativePort` returns immediately without waiting for pending
tasks to complete. Implementing this on top of `ThreadPool` requires
some changes to thread pool implementation.

Issue https://github.com/dart-lang/sdk/issues/55844

Closes https://github.com/dart-lang/sdk/issues/56717

TEST=ci

Change-Id: Ic68bfb60757685afd75c80a70cdec66cc13c149b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385000
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-09-12 15:16:12 +00:00
Slava Egorov 120dac365d Revert "[vm] Simplify implementation of native ports"
This reverts commit 5a32d8bc7c.

Reason for revert: DartIsolateTest.CanCreateServiceIsolate flutter engine unit test hangs on Windows.

Original change's description:
> [vm] Simplify implementation of native ports
>
> This CL turns native ports into a thin abstraction over underlying
> thread pool instead of building them as full fledged MessageHandler.
>
> This allows to easily implement a variation of native ports which can
> handle messages concurrently with the given degree of concurrency.
> This type of port can be used to greatly simplify implementation of
> IOService - which previously had to do its own concurrency management
> on top of "single threaded" native ports. This capability is exposed
> as `Dart_NewConcurrentNativePort` API.
>
> The new implementation is in general much cleaner then the old one
> with one exception: `Dart_CloseNativePort` API has unfortunate design
> where underlying message handler is destroyed asynchronously and
> `Dart_CloseNativePort` returns immediately without waiting for pending
> tasks to complete. Implementing this on top of `ThreadPool` requires
> some changes to thread pool implementation.
>
> Issue https://github.com/dart-lang/sdk/issues/55844
>
> TEST=ci
>
> Change-Id: I062040ff233e93962ae93684e9b044d8facdaffc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382163
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: I7de27793a54072e974bf1a9f17a07c12159a202d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384481
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-09-12 08:25:27 +00:00
Vyacheslav Egorov 5a32d8bc7c [vm] Simplify implementation of native ports
This CL turns native ports into a thin abstraction over underlying
thread pool instead of building them as full fledged MessageHandler.

This allows to easily implement a variation of native ports which can
handle messages concurrently with the given degree of concurrency.
This type of port can be used to greatly simplify implementation of
IOService - which previously had to do its own concurrency management
on top of "single threaded" native ports. This capability is exposed
as `Dart_NewConcurrentNativePort` API.

The new implementation is in general much cleaner then the old one
with one exception: `Dart_CloseNativePort` API has unfortunate design
where underlying message handler is destroyed asynchronously and
`Dart_CloseNativePort` returns immediately without waiting for pending
tasks to complete. Implementing this on top of `ThreadPool` requires
some changes to thread pool implementation.

Issue https://github.com/dart-lang/sdk/issues/55844

TEST=ci

Change-Id: I062040ff233e93962ae93684e9b044d8facdaffc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382163
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-09-11 13:38:24 +00:00
Jens Johansen 9b67562b4d Add 'coverage' flag, defaulting to true, but let the gn application_snapshot default it to false
Automatic set coverage when loading snapshot

TEST=Existing tests, manual inspection of reduction in sdk snapshot sizes (see data in comments in https://dart-review.googlesource.com/c/sdk/+/370501)

Change-Id: I044616144c2defeed252a6715eba1abcabffc86d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371700
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-06-18 09:10:00 +00:00
Daco Harkes 9588927faf [vm] Native asset relative path resolution with symlinks
This CL moves native assets resolution to the embedder.

The Dart VM looks up the asset path (for example
`['relative', 'foo.so']`) with the asset id. The embedder defines
callbacks for asset loading, and returns a handle to the dylib.
Then the VM calls the embedder again with `dlsym` to lookup the symbol.

The Dart VM & kernel compiler are responsible for the asset id to
asset path mapping. The kernel compiler compiles it into the snapshot
and the VM looks it up in the snapshot.

Relative paths are resolved relative to the isolate script uri (kernel
snapshot, jit snapshot, aot snapshot, or `dart compile exe` result).
The embedder is responsible for remembering the script uri it set when
spawning the isolate group.

This CL does not add `dlclose` or `dladdr` embedder callbacks yet.
Bug: https://github.com/dart-lang/sdk/issues/55521
Bug: https://github.com/dart-lang/sdk/issues/55966

TEST=pkg/dartdev/test/native_assets/build_test.dart
TEST=tests/ffi/native_assets/asset_relative_test.dart

Bug: https://github.com/dart-lang/sdk/issues/55410
Bug: https://github.com/dart-lang/sdk/issues/55523
Bug: https://github.com/dart-lang/sdk/issues/55207
Change-Id: I75ec4a368c5fb3d2f76b03771e796ff56bcac941
Cq-Include-Trybots: dart/try:vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-win-release-arm64-try,vm-aot-asan-linux-release-x64-try,vm-asan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-msan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361881
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-06-12 16:45:19 +00:00
Daco Harkes 4b2906cdc1 [vm] Move ResolveUri to platform
This will enable the standalone embedder to resolve uris in a follow
up CL:
https://dart-review.googlesource.com/c/sdk/+/361881

The implementation was using zones for allocation, this CL switches
that to using `malloc`. The caller is responsible for freeing the
memory if resolving succeeds.

This CL removes `Dart_DefaultCanonicalizeUrl`.

We don't have a run_platform_tests, so this CL keeps the tests in
run_vm_tests.

TEST=vm/cc/ParseUri
TEST=vm/cc/ResolveUri
TEST=tests/ffi/native_assets/asset_relative_test.dart

Bug: https://github.com/dart-lang/sdk/issues/55523
Change-Id: Ifb300d8164eb50506f22ce619fad0811f74ef34c
Cq-Include-Trybots: luci.dart.try:vm-aot-asan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-asan-linux-release-arm64-try,vm-asan-linux-release-x64-try,vm-msan-linux-release-arm64-try,vm-msan-linux-release-x64-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-win-release-try,vm-aot-linux-debug-x64-try,vm-linux-debug-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-aot-win-debug-x64-try,vm-win-debug-arm64-try,vm-mac-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368423
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-12 16:45:19 +00:00
Alexander Aprelev de4029ee1b [vm/sendports] Introduce an api that can be safely used to rebuild SendPort.
Existing api is not aware of origin_id, which leads to problems when a port gets closed, origin_id can't be properly restored.

Fixes https://github.com/dart-lang/sdk/issues/55605
TEST=vm/dart/sendport_api_test

Change-Id: Ia8a5978a968f6ea643d7921c64146cebf17d2e0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365120
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-05-01 17:19:16 +00:00
Alexander Markov 6e5aae8e0f [vm] Unsound mode cleanup: remove legacy types from the VM
TEST=ci

Change-Id: I0ade9ebf5dff2b283a2c7e0ff99dc6b56f548ba9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364622
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-04-30 17:49:37 +00:00
Daco Harkes f98a2138b7 [vm] Run clang-format on code base
When uploading CLs, the presubmit checks verify that the lines in the
diff are formatted correctly according to `git cl format runtime`.

However, when `buildtools/<os>-<arch>/clang/bin/clang-format` is
updated, it does not force reformatting of files that would be
reformatted.

This leads to two issues:
* Inconsistent style within the code base and within a single file.
* Spurious reformatting in CLs when (1) clang-format is used on the
  whole file, or (2) the diff lines overlap.

`clang-format` doesn't change that frequently, so in general this is
not a large issue, but I've seen a bit too many "spurious formatting,
please revert" comments on CLs recently.

This CL formats the runtime to be in line with the current pinned
`clang-format`:

```
$ find runtime/ -iname *.h -o -iname *.cc | xargs buildtools/mac-arm64/clang/bin/clang-format -i
```

`git cl format` (which only formats changed lines, and does so with
`clang-format`) seems to not agree with itself, or clang-format, or
cpplint in a handful of places. This CL adds `// clang-format off`
for these. (See previous patchsets for the specific instances.)

TEST=A variety of bots including GCC, MacOS and Windows.

Change-Id: I470892e898971899fda14bb3b8f2c8efefd67686
Cq-Include-Trybots: luci.dart.try:vm-gcc-linux-try,vm-ffi-qemu-linux-release-riscv64-try,vm-ffi-qemu-linux-release-arm-try,vm-aot-win-debug-x64-try,vm-win-debug-x64c-try,vm-mac-debug-x64-try,vm-mac-debug-arm64-try,vm-aot-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362780
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-04-17 19:14:41 +00:00
asiva 8e2acda7d6 [VM] Remove support for --no-sound-null-safety mode
This CL removes support for --no-sound-null-safety option, the VM will
only run sound null safety code.

First part of deleting support for legacy and unsound null safe code.

TEST=CI

Change-Id: I9dbed10a18ef102533d6af516ff5075297d17b74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357183
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-04-05 19:38:12 +00:00
Alexander Markov 17d6ba15b6 [vm] Remove external strings
This change removes support for external strings from the VM along with
Dart_NewExternalLatin1String, Dart_NewExternalUTF16String and
Dart_IsExternalString Dart C API functions.

External strings are not used by the VM nor any known embedder, but
Dart VM was paying the maintenance and performance price for
the external string implementation classes.

TEST=ci

Change-Id: I094cd2d2b7ec0840e9f09e1ca9e5a7acd4e78c28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358760
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-03-20 20:08:13 +00:00
Vyacheslav Egorov 9e11d79657 [vm] Remove dart:cli waitFor
Closes https://github.com/dart-lang/sdk/issues/52121

Tested: CI
CoreLibraryReviewExempt: Approved breaking change to VM specific code
Change-Id: Icc89017c5a7676c2ae07488692ad8b8b9e131a7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354880
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-02-29 11:18:51 +00:00
Ryan Macnak cfe4462b28 [vm] Add some warnings to Dart_RecordTimelineEvent.
TEST=no
Change-Id: I448901c2767c48e931dc492e000d2f01e5194ed8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353225
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-02-20 20:18:09 +00:00
Derek Xu 391c0fb6c0 [VM] Remove deprecated Dart_TimelineEvent embedder API
TEST=CI

Change-Id: I094c32ec44a886a8154692de22b6575661918d29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353240
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-02-20 18:18:30 +00:00
Ryan Macnak 19aa44bd10 [vm] Remove dead copy_parent_code flag.
TEST=ci
Change-Id: Ib167a667f03179f9bc0f38d8b33d08f867ee9423
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352700
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-02-15 23:02:45 +00:00
Alexander Markov 9d6b79749b [vm] Remove core-jit snapshots
Core-jit snapshots are no longer used.

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

Change-Id: Ifadd6e8d913794f3e70cd4dfdc1758b0cd45f3ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352382
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-02-14 00:08:30 +00:00
Ryan Macnak 48cbd9b322 [vm] Identify the vm isolate etc by construction not by name.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/54855
Change-Id: I31699c4343822e99a8fa275ba00dcdfa51cdd06b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351220
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-02-13 23:32:01 +00:00
John McCutchan 33ad2086c1 Expose Dart_Null_DL from dart_api_dl.h
R=dacoharkes@google.com

https://github.com/dart-lang/sdk/issues/54296

TEST=tests/ffi/vmspecific_handle_dynamically_linked_test.dart

Change-Id: Ibcf6a387a4b6385b17c13ed4b3ce6422291a5f78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341061
Auto-Submit: John McCutchan <johnmccutchan@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: John McCutchan <johnmccutchan@google.com>
2023-12-11 21:06:37 +00:00
Daco Harkes 1c1bcf7521 [vm/ffi] Improve Dart_InitializeApiDL doc
TEST=Doc improvement.

Change-Id: I2793be651fc7951bb61982929c0d07def93e01ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339161
Reviewed-by: John McCutchan <johnmccutchan@google.com>
Commit-Queue: John McCutchan <johnmccutchan@google.com>
2023-12-02 04:33:55 +00:00
Alexander Markov b15e1bf19d [vm] Rename nullSafety to soundNullSafety in pkg/vm
Also:
* Clean up obsolete code for returning null safety from kernel
service.
* Enable sound null safety in TFA unit tests.

TEST=ci

Change-Id: I1e008ed661823e9cb8004670d6b66bef35089a19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334081
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-11-07 14:32:20 +00:00
asiva 1d3d819ecf [vm] Ensure 'print' is atomic between printing the string and '\n'
Should fix https://github.com/dart-lang/sdk/issues/53471

TEST=ci

Change-Id: I76da5776bb95f8297ef63aa4c8754c940e1d4e71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330999
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-11-03 20:02:45 +00:00
Daco Harkes f5983e4214 [ffi] Update some FfiNative docs to Native
The old FfiNatives have been deprecated for a while.

TEST=Only comments updated.

Change-Id: Ideb6e904841e5162d30df479e83b463b94682afe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332780
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-10-30 18:43:14 +00:00