dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.09k stars 1.56k forks source link

[vm/ffi] Re-use FFI trampolines #36607

Open sjindel-google opened 5 years ago

sjindel-google commented 5 years ago

Currently we generate a new FFI trampoline function on every call to asFunction. We should cache and re-use trampolines for the same native signatures.

sjindel-google commented 5 years ago

/cc @mkustermann

Martin pointed out that we can re-use the logic for caching inner closures per-callsite.