ffi: fix optimized buffer conversions - #64639
Draft
trivikr wants to merge 2 commits into
Draft
Conversation
Collaborator
|
Review requested:
|
ShogunPanda
approved these changes
Jul 21, 2026
This comment was marked as outdated.
This comment was marked as outdated.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64639 +/- ##
=======================================
Coverage 90.14% 90.14%
=======================================
Files 744 744
Lines 242518 242495 -23
Branches 45685 45690 +5
=======================================
- Hits 218611 218596 -15
+ Misses 15396 15392 -4
+ Partials 8511 8507 -4
🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
trivikr
force-pushed
the
ffi-buffer-sig-bigint
branch
2 times, most recently
from
July 23, 2026 15:47
139053a to
d4a75ce
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Preserve pointer-like argument conversions for buffer and arraybuffer signatures after Fast API optimization. Keep memory-backed arguments on the specialized native fast path. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.6-sol
trivikr
force-pushed
the
ffi-buffer-sig-bigint
branch
from
July 27, 2026 01:11
d4a75ce to
c2e566c
Compare
avivkeller
approved these changes
Jul 27, 2026
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Member
Author
|
The ---
duration_ms: 120100.117
exitcode: -15
severity: fail
stack: |-
timeout
(node:3758351) internal/test/binding: These APIs are for internal testing only. Do not use them.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:3758351) ExperimentalWarning: FFI is an experimental feature and might change at any time
... |
trivikr
marked this pull request as draft
July 27, 2026 18:46
Member
Author
|
This PR will be rebased and made ready for review after the fix in ppc64 lands in #64792 |
The ppc64 fast FFI trampoline uses `bl` to obtain the address used to load its target literal. This overwrites the caller's link register, so optimized FFI calls return into the trampoline and loop indefinitely. Save and restore the caller's link register around the branch. Also align the target literal for both even and odd GP argument counts. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: codex:gpt-5.6-sol
This comment was marked as outdated.
This comment was marked as outdated.
Member
Author
|
CI on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #64638
Fast FFI calls with
bufferorarraybufferargument signatures accepted pointer-like values through the generic path, but rejected non-memory-backed values after optimization.This change keeps the primary optimized entry point compatible with raw pointer conversions while retaining the specialized native fast path for memory-backed arguments. Optimized calls now consistently accept documented representations including
bigint, strings, nullish values, buffers, typed arrays, andArrayBufferobjects.Assisted-by: openai:gpt-5.6-sol