dart-sdk/runtime/docs
Daco Harkes 6544c69e23 [vm/ffi] Convert Objects to Dart_Handles in FFI calls
This includes support for calling Dart_PropagateError in native code
when doing FFI calls, and catching uncaught exceptions with Dart_IsError
when doing FFI callbacks.

The support for Dart_PropagateError adds a catch entry to the FFI
trampoline, which prevents inlining these trampolines in AOT. This
regresses the FfiCall benchmarks by 1-2% in AOT.

In addition, Dart_PropagateError requires maintaining a bit whether we
entered native/VM code from generated code through FFI or not. That way
we can do the proper transition on the exception path. When entering
generated code, we store this bit on the stack, right after the entry
frame.

Design: http://go/dart-ffi-handles

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

Change-Id: Idfd7ff69132fb29cc730931a4113d914d4437396
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145591
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-12 11:14:22 +00:00
..
compiler [vm/compiler] Tests, cleanups and fixes to Type Testing Stubs. 2020-03-17 14:11:02 +00:00
images [vm/docs] Publish "Introduction to Dart VM" source and build tools. 2020-02-04 09:04:32 +00:00
infra Move the test runner (i.e. "test.dart"/"test.py") to pkg/. 2019-06-14 23:35:10 +00:00
aot_binary_size_analysis.md [vm/tools] Update references to snapshot_analysis.dart. 2020-05-26 21:21:19 +00:00
dwarf_stack_traces.md [vm] Reland "Weaken dwarf_stack_trace expected stack trace." 2019-12-18 16:11:41 +00:00
gc.md [vm/ffi] Convert Objects to Dart_Handles in FFI calls 2020-06-12 11:14:22 +00:00
index.md [vm/docs] Publish "Introduction to Dart VM" source and build tools. 2020-02-04 09:04:32 +00:00
pragmas.md Reland "[vm/compiler] Implement new inlining pragmas." 2019-07-30 12:01:06 +00:00
snapshot_profiling.md Fix typo in snapshot_profiling.md. heapsnaphsot -> heapsnapshot 2019-11-25 15:58:15 +00:00