mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 22:51:29 +00:00
4258a59789
Passing handles in FFI calls has significant overhead due to how each handle requires a runtime entry to allocate in the handle scope. This change removes that runtime entry by relying on the register allocator to allocate all handle arguments on the stack, so that we don't need to allocate them separately. To pass the stack handles to the native call we then pass a pointer to the stack slot as the native argument. Testing: - We already have comprehensive tests for correctness in the form of the FFI tests. These make calls with various combinations of Handle and non-handle arguments. - Correct GC behaviour is likewise covered in `vmspecific_handle_test.dart` which makes calls with handles arguments and triggers GC in-flight. In case we do not correctly pass the handles on the stack, the GC will trash them during the call. TEST=Existing. Bug: https://github.com/dart-lang/sdk/issues/47624 Change-Id: Ic837bad5484daaa5534b7c2e8707ac2c5dfa480f Cq-Include-Trybots: luci.dart.try:vm-kernel-gcc-linux-try,vm-kernel-linux-debug-simriscv64-try,vm-kernel-nnbd-mac-release-arm64-try,vm-kernel-precomp-android-release-arm64c-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-simriscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243320 Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Clement Skau <cskau@google.com> |
||
---|---|---|
.. | ||
bin | ||
docs | ||
include | ||
lib | ||
observatory | ||
observatory_2 | ||
platform | ||
tests | ||
third_party | ||
tools | ||
vm | ||
.clang-tidy | ||
.gitignore | ||
BUILD.gn | ||
codereview.settings | ||
configs.gni | ||
CPPLINT.cfg | ||
OWNERS | ||
PRESUBMIT.py | ||
runtime_args.gni |