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
|
@@ -50,78 +50,11 @@ extern "C" X0X1Ret ForwardCallXGG(const void *func, uint8_t *sp, uint8_t **out_o
|
|
|
50
50
|
extern "C" float ForwardCallXF(const void *func, uint8_t *sp, uint8_t **out_old_sp);
|
|
51
51
|
extern "C" HfaRet ForwardCallXDDDD(const void *func, uint8_t *sp, uint8_t **out_old_sp);
|
|
52
52
|
|
|
53
|
-
extern "C" int Trampoline0; extern "C" int TrampolineX0;
|
|
54
|
-
extern "C" int Trampoline1; extern "C" int TrampolineX1;
|
|
55
|
-
extern "C" int Trampoline2; extern "C" int TrampolineX2;
|
|
56
|
-
extern "C" int Trampoline3; extern "C" int TrampolineX3;
|
|
57
|
-
extern "C" int Trampoline4; extern "C" int TrampolineX4;
|
|
58
|
-
extern "C" int Trampoline5; extern "C" int TrampolineX5;
|
|
59
|
-
extern "C" int Trampoline6; extern "C" int TrampolineX6;
|
|
60
|
-
extern "C" int Trampoline7; extern "C" int TrampolineX7;
|
|
61
|
-
extern "C" int Trampoline8; extern "C" int TrampolineX8;
|
|
62
|
-
extern "C" int Trampoline9; extern "C" int TrampolineX9;
|
|
63
|
-
extern "C" int Trampoline10; extern "C" int TrampolineX10;
|
|
64
|
-
extern "C" int Trampoline11; extern "C" int TrampolineX11;
|
|
65
|
-
extern "C" int Trampoline12; extern "C" int TrampolineX12;
|
|
66
|
-
extern "C" int Trampoline13; extern "C" int TrampolineX13;
|
|
67
|
-
extern "C" int Trampoline14; extern "C" int TrampolineX14;
|
|
68
|
-
extern "C" int Trampoline15; extern "C" int TrampolineX15;
|
|
69
|
-
extern "C" int Trampoline16; extern "C" int TrampolineX16;
|
|
70
|
-
extern "C" int Trampoline17; extern "C" int TrampolineX17;
|
|
71
|
-
extern "C" int Trampoline18; extern "C" int TrampolineX18;
|
|
72
|
-
extern "C" int Trampoline19; extern "C" int TrampolineX19;
|
|
73
|
-
extern "C" int Trampoline20; extern "C" int TrampolineX20;
|
|
74
|
-
extern "C" int Trampoline21; extern "C" int TrampolineX21;
|
|
75
|
-
extern "C" int Trampoline22; extern "C" int TrampolineX22;
|
|
76
|
-
extern "C" int Trampoline23; extern "C" int TrampolineX23;
|
|
77
|
-
extern "C" int Trampoline24; extern "C" int TrampolineX24;
|
|
78
|
-
extern "C" int Trampoline25; extern "C" int TrampolineX25;
|
|
79
|
-
extern "C" int Trampoline26; extern "C" int TrampolineX26;
|
|
80
|
-
extern "C" int Trampoline27; extern "C" int TrampolineX27;
|
|
81
|
-
extern "C" int Trampoline28; extern "C" int TrampolineX28;
|
|
82
|
-
extern "C" int Trampoline29; extern "C" int TrampolineX29;
|
|
83
|
-
extern "C" int Trampoline30; extern "C" int TrampolineX30;
|
|
84
|
-
extern "C" int Trampoline31; extern "C" int TrampolineX31;
|
|
85
|
-
|
|
86
53
|
extern "C" napi_value CallSwitchStack(Napi::Function *func, size_t argc, napi_value *argv,
|
|
87
54
|
uint8_t *old_sp, Span<uint8_t> *new_stack,
|
|
88
55
|
napi_value (*call)(Napi::Function *func, size_t argc, napi_value *argv));
|
|
89
56
|
|
|
90
|
-
|
|
91
|
-
{ &Trampoline0, &TrampolineX0 },
|
|
92
|
-
{ &Trampoline1, &TrampolineX1 },
|
|
93
|
-
{ &Trampoline2, &TrampolineX2 },
|
|
94
|
-
{ &Trampoline3, &TrampolineX3 },
|
|
95
|
-
{ &Trampoline4, &TrampolineX4 },
|
|
96
|
-
{ &Trampoline5, &TrampolineX5 },
|
|
97
|
-
{ &Trampoline6, &TrampolineX6 },
|
|
98
|
-
{ &Trampoline7, &TrampolineX7 },
|
|
99
|
-
{ &Trampoline8, &TrampolineX8 },
|
|
100
|
-
{ &Trampoline9, &TrampolineX9 },
|
|
101
|
-
{ &Trampoline10, &TrampolineX10 },
|
|
102
|
-
{ &Trampoline11, &TrampolineX11 },
|
|
103
|
-
{ &Trampoline12, &TrampolineX12 },
|
|
104
|
-
{ &Trampoline13, &TrampolineX13 },
|
|
105
|
-
{ &Trampoline14, &TrampolineX14 },
|
|
106
|
-
{ &Trampoline15, &TrampolineX15 },
|
|
107
|
-
{ &Trampoline16, &TrampolineX16 },
|
|
108
|
-
{ &Trampoline17, &TrampolineX17 },
|
|
109
|
-
{ &Trampoline18, &TrampolineX18 },
|
|
110
|
-
{ &Trampoline19, &TrampolineX19 },
|
|
111
|
-
{ &Trampoline20, &TrampolineX20 },
|
|
112
|
-
{ &Trampoline21, &TrampolineX21 },
|
|
113
|
-
{ &Trampoline22, &TrampolineX22 },
|
|
114
|
-
{ &Trampoline23, &TrampolineX23 },
|
|
115
|
-
{ &Trampoline24, &TrampolineX24 },
|
|
116
|
-
{ &Trampoline25, &TrampolineX25 },
|
|
117
|
-
{ &Trampoline26, &TrampolineX26 },
|
|
118
|
-
{ &Trampoline27, &TrampolineX27 },
|
|
119
|
-
{ &Trampoline28, &TrampolineX28 },
|
|
120
|
-
{ &Trampoline29, &TrampolineX29 },
|
|
121
|
-
{ &Trampoline30, &TrampolineX30 },
|
|
122
|
-
{ &Trampoline31, &TrampolineX31 }
|
|
123
|
-
};
|
|
124
|
-
RG_STATIC_ASSERT(RG_LEN(Trampolines) == MaxTrampolines * 2);
|
|
57
|
+
#include "abi_trampolines.inc"
|
|
125
58
|
|
|
126
59
|
static inline int IsHFA(const TypeInfo *type)
|
|
127
60
|
{
|
|
@@ -1226,7 +1159,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, bool async,
|
|
|
1226
1159
|
if (RG_UNLIKELY(!ptr))
|
|
1227
1160
|
return;
|
|
1228
1161
|
} else if (CheckValueTag(instance, value, type->ref.marker)) {
|
|
1229
|
-
ptr = value.As<Napi::External<
|
|
1162
|
+
ptr = value.As<Napi::External<void>>().Data();
|
|
1230
1163
|
} else if (IsNullOrUndefined(value)) {
|
|
1231
1164
|
ptr = nullptr;
|
|
1232
1165
|
} else {
|
|
@@ -1246,7 +1179,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, bool async,
|
|
|
1246
1179
|
err_guard.Disable();
|
|
1247
1180
|
}
|
|
1248
1181
|
|
|
1249
|
-
void *GetTrampoline(
|
|
1182
|
+
void *GetTrampoline(int16_t idx, const FunctionInfo *proto)
|
|
1250
1183
|
{
|
|
1251
1184
|
bool vec = proto->forward_fp || IsFloat(proto->ret.type);
|
|
1252
1185
|
return Trampolines[idx][vec];
|