dart-sdk/runtime
Tess Strickland 291051e02d [vm/compiler] Add an instruction to adjust unsafe untagged addresses.
ComputeElementAddress takes a base untagged address, an index, an index
scale, and an offset and returns base + (index * scale) + offset as an
untagged address.

This removes the last conversions between untagged and unboxed integers
for untagged GC-movable pointers. The only remaining conversions are
the following cases, which all involve non-GC-movable pointers:

1. Calls to the FFI resolver (on IA32 only).
2. Returning nullptr when a pointer to memory is expected in
   exceptional returns from FFI callbacks.
3. Converting user-provided integers to FFI pointer objects and back.

In addition, we no longer add the data field to materializations of
typed data views, but instead recompute the data field in
DeferredObject::Fill(). This removes the last source of unsafe untagged
pointers that may have arbitrary lifetimes in the flow graph.

Thus, we can now verify in the FlowGraphChecker that there are no
GC-triggering instructions between the creation of an untagged
GC-movable pointer and its use (including the use itself). To do this,
this CL adds a predicate MayCreateUnsafeUntaggedPointer to definitions,
which by default returns true for kUntagged results, false otherwise,
and should only be overwritten in cases where the result can be proven
to not be a untagged GC-movable pointer.

TEST=vm/dart/regress_54710_il_test
     vm/cc/AllocationSinking_NoViewDataMaterialization

Fixes: https://github.com/dart-lang/sdk/issues/54710
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm64c-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-appjit-linux-debug-x64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-ubsan-linux-release-x64-try,vm-win-release-ia32-try
Change-Id: Ie172a8bd0330a728a4f151478664a530f8d9b38a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354862
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-03-22 19:03:31 +00:00
..
bin [ VM / DDS ] Add --print-dtd-uri flag and launch DTD from the correct snapshot for AOT 2024-03-21 19:50:46 +00:00
docs [vm] Introduce pragma vm:deeply-immutable 2024-03-07 18:33:58 +00:00
include [vm] Remove external strings 2024-03-20 20:08:13 +00:00
lib [vm/compiler] Limit exposure of untagged pointers to managed memory. 2024-03-22 10:12:39 +00:00
observatory [vm] Remove external strings 2024-03-20 20:08:13 +00:00
platform [vm/compiler] Limit exposure of untagged pointers to managed memory. 2024-03-22 10:12:39 +00:00
tests [vm/compiler] Add an instruction to adjust unsafe untagged addresses. 2024-03-22 19:03:31 +00:00
tools [vm] Remove core-jit snapshots 2024-02-14 00:08:30 +00:00
vm [vm/compiler] Add an instruction to adjust unsafe untagged addresses. 2024-03-22 19:03:31 +00:00
.clang-tidy
.gitignore
BUILD.gn Reland "[Fuchsia] Remove the legacy gn build rules for fuchsia" 2024-03-14 20:22:12 +00:00
codereview.settings
configs.gni [Runtime] Add extra_product_deps and extra_nonproduct_deps params to "library_for_all_configs_with_compiler" template 2023-04-14 19:51:40 +00:00
CPPLINT.cfg [cpplint] Disable runtime/references lint 2023-01-23 18:21:48 +00:00
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
PRESUBMIT.py Reland "Reland "[VM] Begin supporting Perfetto file recorder"" 2023-04-18 19:39:05 +00:00
runtime_args.gni Reland "[Fuchsia] Remove the legacy gn build rules for fuchsia" 2024-03-14 20:22:12 +00:00
vm-jit.shard.cml [test] Cleanup building Fuchsia packages/components. 2023-10-31 17:11:51 +00:00
vm.shard.cml [inspect] Update Inspect library usage 2024-02-12 18:18:01 +00:00