[vm/ffi] Investigate outlining state transitions in AOT #50094
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
library-ffi
type-performance
Issue relates to performance or code size
JIT x64
out/ReleaseX64/dart --disassemble --disassemble-relative --print-flow-graph-filter=FfiTrampoline_Handlex01 benchmarks/FfiCall/dart/FfiCall.dart Handle
FfiTrampoline_Handlex01: 0x131 = 305 bytes
JIT uses a stub to transition from generated code to native going into a safepoint.
AOT x64
dart pkg/vm/bin/gen_kernel.dart --aot --platform=out/ReleaseX64/vm_platform_strong.dill -o benchmarks/FfiCall/dart/FfiCall.dill benchmarks/FfiCall/dart/FfiCall.dart && out/ReleaseX64/gen_snapshot --disassemble --disassemble-relative --print-flow-graph-filter=FfiTrampoline_Handlex01 --snapshot-kind=app-aot-assembly --assembly=benchmarks/FfiCall/dart/FfiCall.asm benchmarks/FfiCall/dart/FfiCall.dill
FfiTrampoline_Handlex01: 0x1b3 = 435 bytes
AOT doesn’t use a stub to go transition into native + safepoint.
This means all the transition code is inline, adding ~130 bytes. (There are some minor other differences as well.)
We consider checking what the speed penalty is for using a stub in AOT.
The text was updated successfully, but these errors were encountered: