koffi 2.15.0 → 2.16.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/build/koffi/darwin_arm64/koffi.node +0 -0
- package/build/koffi/darwin_x64/koffi.node +0 -0
- package/build/koffi/freebsd_arm64/koffi.node +0 -0
- package/build/koffi/freebsd_ia32/koffi.node +0 -0
- package/build/koffi/freebsd_x64/koffi.node +0 -0
- package/build/koffi/linux_arm64/koffi.node +0 -0
- package/build/koffi/linux_armhf/koffi.node +0 -0
- package/build/koffi/linux_ia32/koffi.node +0 -0
- package/build/koffi/linux_loong64/koffi.node +0 -0
- package/build/koffi/linux_riscv64d/koffi.node +0 -0
- package/build/koffi/linux_x64/koffi.node +0 -0
- package/build/koffi/musl_arm64/koffi.node +0 -0
- package/build/koffi/musl_x64/koffi.node +0 -0
- package/build/koffi/openbsd_ia32/koffi.node +0 -0
- package/build/koffi/openbsd_x64/koffi.node +0 -0
- package/build/koffi/win32_arm64/koffi.node +0 -0
- package/build/koffi/win32_ia32/koffi.node +0 -0
- package/build/koffi/win32_x64/koffi.node +0 -0
- package/doc/pages/index.md +4 -2
- package/doc/pages/misc.md +2 -0
- package/doc/templates/code.html +1 -2
- package/doc/templates/page.html +1 -2
- package/index.d.ts +11 -9
- package/index.js +9 -9
- package/indirect.js +9 -9
- package/lib/native/base/base.cc +79 -44
- package/lib/native/base/base.hh +31 -33
- package/package.json +2 -2
- package/src/cnoke/assets/FindCNoke.cmake +16 -10
- package/src/cnoke/assets/win_delay_hook.c +4 -0
- package/src/cnoke/src/builder.js +49 -46
- package/src/koffi/CMakeLists.txt +18 -8
- package/src/koffi/src/abi_arm32.cc +222 -219
- package/src/koffi/src/abi_arm32_asm.S +1 -29
- package/src/koffi/src/abi_arm64.cc +257 -235
- package/src/koffi/src/abi_arm64_asm.S +1 -32
- package/src/koffi/src/abi_arm64_asm.asm +1 -23
- package/src/koffi/src/abi_loong64_asm.S +1 -25
- package/src/koffi/src/abi_riscv64.cc +220 -217
- package/src/koffi/src/abi_riscv64_asm.S +1 -25
- package/src/koffi/src/abi_x64_sysv.cc +196 -192
- package/src/koffi/src/abi_x64_sysv_asm.S +1 -31
- package/src/koffi/src/abi_x64_win.cc +188 -172
- package/src/koffi/src/abi_x64_win_asm.S +144 -0
- package/src/koffi/src/abi_x64_win_asm.asm +1 -21
- package/src/koffi/src/abi_x86.cc +224 -189
- package/src/koffi/src/abi_x86_asm.S +6 -25
- package/src/koffi/src/abi_x86_asm.asm +9 -22
- package/src/koffi/src/call.cc +246 -428
- package/src/koffi/src/call.hh +9 -8
- package/src/koffi/src/ffi.cc +142 -88
- package/src/koffi/src/ffi.hh +13 -59
- package/src/koffi/src/primitives.inc +39 -0
- package/src/koffi/src/trampolines/armasm.inc +0 -32770
- package/src/koffi/src/trampolines/gnu.inc +0 -24578
- package/src/koffi/src/trampolines/masm32.inc +0 -32770
- package/src/koffi/src/trampolines/masm64.inc +0 -32770
- package/src/koffi/src/trampolines/prototypes.inc +16385 -16385
- package/src/koffi/src/util.cc +155 -112
- package/src/koffi/src/util.hh +77 -40
- package/vendor/node-api-headers/CHANGELOG.md +22 -0
- package/vendor/node-api-headers/README.md +6 -17
- package/vendor/node-api-headers/include/js_native_api.h +3 -13
- package/vendor/node-api-headers/include/js_native_api_types.h +15 -0
- package/vendor/node-api-headers/include/node_api.h +0 -4
- package/vendor/node-api-headers/include/node_api_types.h +6 -0
- package/vendor/node-api-headers/package.json +1 -1
- package/vendor/node-api-headers/scripts/update-headers.js +6 -0
|
@@ -93,40 +93,12 @@ ForwardCallXDDDD:
|
|
|
93
93
|
.global RelayCallback
|
|
94
94
|
.global CallSwitchStack
|
|
95
95
|
|
|
96
|
-
# First, make a copy of the
|
|
96
|
+
# First, make a copy of the argument registers.
|
|
97
97
|
# Then call the C function RelayCallback with the following arguments:
|
|
98
98
|
# static trampoline ID, a pointer to the saved GPR array, a pointer to the stack
|
|
99
99
|
# arguments of this call, and a pointer to a struct that will contain the result registers.
|
|
100
100
|
# After the call, simply load these registers from the output struct.
|
|
101
101
|
.macro trampoline id
|
|
102
|
-
.cfi_startproc
|
|
103
|
-
push {fp, lr}
|
|
104
|
-
.cfi_def_cfa sp, 8
|
|
105
|
-
.cfi_offset 11, 4
|
|
106
|
-
.cfi_offset 14, 8
|
|
107
|
-
sub sp, sp, #120
|
|
108
|
-
.cfi_def_cfa sp, 128
|
|
109
|
-
add r12, sp, 64
|
|
110
|
-
stmia r12!, {r0-r3}
|
|
111
|
-
mov r0, \id
|
|
112
|
-
mov r1, sp
|
|
113
|
-
add r2, sp, #128
|
|
114
|
-
mov r3, r12
|
|
115
|
-
bl RelayCallback
|
|
116
|
-
add sp, sp, #80
|
|
117
|
-
ldmia sp!, {r0-r1}
|
|
118
|
-
add sp, sp, #32
|
|
119
|
-
.cfi_def_cfa sp, 8
|
|
120
|
-
pop {fp, lr}
|
|
121
|
-
.cfi_def_cfa sp, 0
|
|
122
|
-
.cfi_restore 11
|
|
123
|
-
.cfi_restore 14
|
|
124
|
-
bx lr
|
|
125
|
-
.cfi_endproc
|
|
126
|
-
.endm
|
|
127
|
-
|
|
128
|
-
# Same thing, but also forwards the floating-point argument registers and loads them at the end.
|
|
129
|
-
.macro trampoline_vec id
|
|
130
102
|
.cfi_startproc
|
|
131
103
|
push {fp, lr}
|
|
132
104
|
.cfi_def_cfa sp, 8
|