Skip to content

[vm/ffi] Investigate outlining state transitions in AOT #50094

@dcharkes

Description

@dcharkes

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.

Metadata

Metadata

Assignees

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-ffitype-performanceIssue relates to performance or code size

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions