koffi 2.2.2-beta.4 → 2.2.2-beta.6
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/doc/callbacks.md +1 -1
- package/doc/contribute.md +1 -1
- package/package.json +1 -1
- package/src/koffi/build/2.2.2-beta.6/koffi_darwin_arm64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_darwin_x64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_freebsd_arm64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_freebsd_ia32.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_freebsd_x64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_linux_arm32hf.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_linux_arm64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_linux_ia32.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_linux_riscv64hf64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_linux_x64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_openbsd_ia32.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_openbsd_x64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_win32_arm64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_win32_ia32.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.6/koffi_win32_x64.tar.gz +0 -0
- package/src/koffi/src/abi_arm32.cc +3 -70
- package/src/koffi/src/abi_arm32_fwd.S +6054 -97
- package/src/koffi/src/abi_arm64.cc +3 -70
- package/src/koffi/src/abi_arm64_fwd.S +6050 -93
- package/src/koffi/src/abi_arm64_fwd.asm +8082 -141
- package/src/koffi/src/abi_riscv64.cc +3 -70
- package/src/koffi/src/abi_riscv64_fwd.S +6044 -87
- package/src/koffi/src/abi_trampolines.inc +2065 -0
- package/src/koffi/src/abi_x64_sysv.cc +3 -70
- package/src/koffi/src/abi_x64_sysv_fwd.S +6048 -91
- package/src/koffi/src/abi_x64_win.cc +4 -71
- package/src/koffi/src/abi_x64_win_fwd.asm +8018 -77
- package/src/koffi/src/abi_x86.cc +4 -71
- package/src/koffi/src/abi_x86_fwd.S +6056 -99
- package/src/koffi/src/abi_x86_fwd.asm +8027 -86
- package/src/koffi/src/call.cc +20 -16
- package/src/koffi/src/call.hh +2 -4
- package/src/koffi/src/ffi.cc +31 -29
- package/src/koffi/src/ffi.hh +16 -5
- package/src/koffi/src/index.js +3 -2
- package/src/koffi/test/callbacks.js +11 -10
- package/src/koffi/test/misc.c +30 -17
- package/src/koffi/{qemu → tools}/qemu/.gitkeep +0 -0
- package/src/koffi/{qemu → tools}/qemu.js +4 -1
- package/src/koffi/{qemu → tools}/registry/machines.json +0 -0
- package/src/koffi/{qemu → tools}/registry/sha256sum.txt +0 -0
- package/src/koffi/tools/write_trampolines.py +138 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_darwin_arm64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_darwin_x64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_freebsd_arm64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_freebsd_ia32.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_freebsd_x64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_linux_arm32hf.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_linux_arm64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_linux_ia32.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_linux_riscv64hf64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_linux_x64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_openbsd_ia32.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_openbsd_x64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_win32_arm64.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_win32_ia32.tar.gz +0 -0
- package/src/koffi/build/2.2.2-beta.4/koffi_win32_x64.tar.gz +0 -0
|
@@ -34,78 +34,11 @@ extern "C" uint64_t ForwardCallXG(const void *func, uint8_t *sp, uint8_t **out_o
|
|
|
34
34
|
extern "C" float ForwardCallXF(const void *func, uint8_t *sp, uint8_t **out_old_sp);
|
|
35
35
|
extern "C" double ForwardCallXD(const void *func, uint8_t *sp, uint8_t **out_old_sp);
|
|
36
36
|
|
|
37
|
-
extern "C" int Trampoline0; extern "C" int TrampolineX0;
|
|
38
|
-
extern "C" int Trampoline1; extern "C" int TrampolineX1;
|
|
39
|
-
extern "C" int Trampoline2; extern "C" int TrampolineX2;
|
|
40
|
-
extern "C" int Trampoline3; extern "C" int TrampolineX3;
|
|
41
|
-
extern "C" int Trampoline4; extern "C" int TrampolineX4;
|
|
42
|
-
extern "C" int Trampoline5; extern "C" int TrampolineX5;
|
|
43
|
-
extern "C" int Trampoline6; extern "C" int TrampolineX6;
|
|
44
|
-
extern "C" int Trampoline7; extern "C" int TrampolineX7;
|
|
45
|
-
extern "C" int Trampoline8; extern "C" int TrampolineX8;
|
|
46
|
-
extern "C" int Trampoline9; extern "C" int TrampolineX9;
|
|
47
|
-
extern "C" int Trampoline10; extern "C" int TrampolineX10;
|
|
48
|
-
extern "C" int Trampoline11; extern "C" int TrampolineX11;
|
|
49
|
-
extern "C" int Trampoline12; extern "C" int TrampolineX12;
|
|
50
|
-
extern "C" int Trampoline13; extern "C" int TrampolineX13;
|
|
51
|
-
extern "C" int Trampoline14; extern "C" int TrampolineX14;
|
|
52
|
-
extern "C" int Trampoline15; extern "C" int TrampolineX15;
|
|
53
|
-
extern "C" int Trampoline16; extern "C" int TrampolineX16;
|
|
54
|
-
extern "C" int Trampoline17; extern "C" int TrampolineX17;
|
|
55
|
-
extern "C" int Trampoline18; extern "C" int TrampolineX18;
|
|
56
|
-
extern "C" int Trampoline19; extern "C" int TrampolineX19;
|
|
57
|
-
extern "C" int Trampoline20; extern "C" int TrampolineX20;
|
|
58
|
-
extern "C" int Trampoline21; extern "C" int TrampolineX21;
|
|
59
|
-
extern "C" int Trampoline22; extern "C" int TrampolineX22;
|
|
60
|
-
extern "C" int Trampoline23; extern "C" int TrampolineX23;
|
|
61
|
-
extern "C" int Trampoline24; extern "C" int TrampolineX24;
|
|
62
|
-
extern "C" int Trampoline25; extern "C" int TrampolineX25;
|
|
63
|
-
extern "C" int Trampoline26; extern "C" int TrampolineX26;
|
|
64
|
-
extern "C" int Trampoline27; extern "C" int TrampolineX27;
|
|
65
|
-
extern "C" int Trampoline28; extern "C" int TrampolineX28;
|
|
66
|
-
extern "C" int Trampoline29; extern "C" int TrampolineX29;
|
|
67
|
-
extern "C" int Trampoline30; extern "C" int TrampolineX30;
|
|
68
|
-
extern "C" int Trampoline31; extern "C" int TrampolineX31;
|
|
69
|
-
|
|
70
37
|
extern "C" napi_value CallSwitchStack(Napi::Function *func, size_t argc, napi_value *argv,
|
|
71
38
|
uint8_t *old_sp, Span<uint8_t> *new_stack,
|
|
72
39
|
napi_value (*call)(Napi::Function *func, size_t argc, napi_value *argv));
|
|
73
40
|
|
|
74
|
-
|
|
75
|
-
{ &Trampoline0, &TrampolineX0 },
|
|
76
|
-
{ &Trampoline1, &TrampolineX1 },
|
|
77
|
-
{ &Trampoline2, &TrampolineX2 },
|
|
78
|
-
{ &Trampoline3, &TrampolineX3 },
|
|
79
|
-
{ &Trampoline4, &TrampolineX4 },
|
|
80
|
-
{ &Trampoline5, &TrampolineX5 },
|
|
81
|
-
{ &Trampoline6, &TrampolineX6 },
|
|
82
|
-
{ &Trampoline7, &TrampolineX7 },
|
|
83
|
-
{ &Trampoline8, &TrampolineX8 },
|
|
84
|
-
{ &Trampoline9, &TrampolineX9 },
|
|
85
|
-
{ &Trampoline10, &TrampolineX10 },
|
|
86
|
-
{ &Trampoline11, &TrampolineX11 },
|
|
87
|
-
{ &Trampoline12, &TrampolineX12 },
|
|
88
|
-
{ &Trampoline13, &TrampolineX13 },
|
|
89
|
-
{ &Trampoline14, &TrampolineX14 },
|
|
90
|
-
{ &Trampoline15, &TrampolineX15 },
|
|
91
|
-
{ &Trampoline16, &TrampolineX16 },
|
|
92
|
-
{ &Trampoline17, &TrampolineX17 },
|
|
93
|
-
{ &Trampoline18, &TrampolineX18 },
|
|
94
|
-
{ &Trampoline19, &TrampolineX19 },
|
|
95
|
-
{ &Trampoline20, &TrampolineX20 },
|
|
96
|
-
{ &Trampoline21, &TrampolineX21 },
|
|
97
|
-
{ &Trampoline22, &TrampolineX22 },
|
|
98
|
-
{ &Trampoline23, &TrampolineX23 },
|
|
99
|
-
{ &Trampoline24, &TrampolineX24 },
|
|
100
|
-
{ &Trampoline25, &TrampolineX25 },
|
|
101
|
-
{ &Trampoline26, &TrampolineX26 },
|
|
102
|
-
{ &Trampoline27, &TrampolineX27 },
|
|
103
|
-
{ &Trampoline28, &TrampolineX28 },
|
|
104
|
-
{ &Trampoline29, &TrampolineX29 },
|
|
105
|
-
{ &Trampoline30, &TrampolineX30 },
|
|
106
|
-
{ &Trampoline31, &TrampolineX31 }
|
|
107
|
-
};
|
|
108
|
-
RG_STATIC_ASSERT(RG_LEN(Trampolines) == MaxTrampolines * 2);
|
|
41
|
+
#include "abi_trampolines.inc"
|
|
109
42
|
|
|
110
43
|
bool AnalyseFunction(Napi::Env, InstanceData *, FunctionInfo *func)
|
|
111
44
|
{
|
|
@@ -258,7 +191,7 @@ bool CallData::Prepare(const FunctionInfo *func, const Napi::CallbackInfo &info)
|
|
|
258
191
|
if (RG_UNLIKELY(!ptr))
|
|
259
192
|
return false;
|
|
260
193
|
} else if (CheckValueTag(instance, value, param.type->ref.marker)) {
|
|
261
|
-
ptr = value.As<Napi::External<
|
|
194
|
+
ptr = value.As<Napi::External<void>>().Data();
|
|
262
195
|
} else if (IsNullOrUndefined(value)) {
|
|
263
196
|
ptr = nullptr;
|
|
264
197
|
} else {
|
|
@@ -738,7 +671,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, bool async,
|
|
|
738
671
|
if (RG_UNLIKELY(!ptr))
|
|
739
672
|
return;
|
|
740
673
|
} else if (CheckValueTag(instance, value, type->ref.marker)) {
|
|
741
|
-
ptr = value.As<Napi::External<
|
|
674
|
+
ptr = value.As<Napi::External<void>>().Data();
|
|
742
675
|
} else if (IsNullOrUndefined(value)) {
|
|
743
676
|
ptr = nullptr;
|
|
744
677
|
} else {
|
|
@@ -758,7 +691,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, bool async,
|
|
|
758
691
|
err_guard.Disable();
|
|
759
692
|
}
|
|
760
693
|
|
|
761
|
-
void *GetTrampoline(
|
|
694
|
+
void *GetTrampoline(int16_t idx, const FunctionInfo *proto)
|
|
762
695
|
{
|
|
763
696
|
bool xmm = proto->forward_fp || IsFloat(proto->ret.type);
|
|
764
697
|
return Trampolines[idx][xmm];
|