Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/ffi/platforms/arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ extern "C" bool node_ffi_create_fast_trampoline(
if (has_buffer_args && fp_count != 0) {
return false;
}
// The buffer helper call clobbers target registers already loaded for
// earlier arguments, so buffer trampolines support a single argument only.
if (has_buffer_args && argc > 1) {
return false;
}

const size_t incoming_gp_count = gp_count + (has_buffer_args ? 1 : 0);
// When V8 passes FastApiCallbackOptions, it consumes one additional GP
Expand Down
5 changes: 5 additions & 0 deletions src/ffi/platforms/x64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ extern "C" bool node_ffi_create_fast_trampoline(
if (has_buffer_args && fp_count != 0) {
return false;
}
// The buffer helper call clobbers target registers already loaded for
// earlier arguments, so buffer trampolines support a single argument only.
if (has_buffer_args && argc > 1) {
return false;
}

const size_t incoming_gp_count = gp_count + (has_buffer_args ? 1 : 0);
// rdi is occupied by the V8 receiver, leaving rsi, rdx, rcx, r8, and r9 for
Expand Down
Loading