| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Precompute a libffi call plan for each fixed signature on x86-64 System V and reuse it from the generic and SharedBuffer invokers. This avoids repeating argument-placement work for every call. Continue to use ffi_call() with libffi older than 3.7, on other ABIs, and when plan allocation fails. Signed-off-by: umuoy1 <burningdian@gmail.com>
|
Review requested:
|
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.
@@ Coverage Diff @@
## main #64958 +/- ##
==========================================
- Coverage 90.28% 90.28% -0.01%
==========================================
Files 760 762 +2
Lines 247076 247536 +460
Branches 46594 46680 +86
==========================================
+ Hits 223081 223484 +403
- Misses 15458 15495 +37
- Partials 8537 8557 +20
... and 55 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
Measure the call path for signatures that bypass the V8 Fast API and reach FFIFunction::Invoke(), covering a register-only and a stack-spilled libffi call plan on x86-64 System V. The per-call delta is the decision-relevant metric for reusable call plans: plan allocation is a one-time cost that amortizes within a few calls. Signed-off-by: umuoy1 <burningdian@gmail.com>
There was a problem hiding this comment.
lgtm
Sorry, something went wrong.
Sorry, something went wrong.
Precompute a libffi call plan for each fixed signature on x86-64 System V and reuse it from the generic and SharedBuffer invokers. This avoids repeating argument-placement work for every call. Continue to use ffi_call() with libffi older than 3.7, on other ABIs, and when plan allocation fails. Signed-off-by: umuoy1 <burningdian@gmail.com> PR-URL: #64958 Fixes: #64562 Refs: libffi/libffi@3cc6beb Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
| Back | FazBrowse Home | New Git URL |
Fixes: #64562
Refs: libffi/libffi@3cc6beb
libffi 3.7 introduced reusable call plans that precompute argument placement. Node.js FFI functions have fixed signatures, so this change creates a plan during function preparation and reuses it for generic and SharedBuffer calls on x86-64 System V.
Other platforms, older libffi versions, and allocation failures continue to use ffi_call(). An invocation benchmark is included: it measures the call path for signatures that bypass the V8 Fast API and reach FFIFunction::Invoke(), covering a register-only and a stack-spilled call plan.
Before (ffi_call):
After (ffi_call_plan_invoke, plan reused):