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
|
@@ -65,78 +65,11 @@ extern "C" Xmm0RaxRet ForwardCallXDG(const void *func, uint8_t *sp, uint8_t **ou
|
|
|
65
65
|
extern "C" RaxXmm0Ret ForwardCallXGD(const void *func, uint8_t *sp, uint8_t **out_old_sp);
|
|
66
66
|
extern "C" Xmm0Xmm1Ret ForwardCallXDD(const void *func, uint8_t *sp, uint8_t **out_old_sp);
|
|
67
67
|
|
|
68
|
-
extern "C" int Trampoline0; extern "C" int TrampolineX0;
|
|
69
|
-
extern "C" int Trampoline1; extern "C" int TrampolineX1;
|
|
70
|
-
extern "C" int Trampoline2; extern "C" int TrampolineX2;
|
|
71
|
-
extern "C" int Trampoline3; extern "C" int TrampolineX3;
|
|
72
|
-
extern "C" int Trampoline4; extern "C" int TrampolineX4;
|
|
73
|
-
extern "C" int Trampoline5; extern "C" int TrampolineX5;
|
|
74
|
-
extern "C" int Trampoline6; extern "C" int TrampolineX6;
|
|
75
|
-
extern "C" int Trampoline7; extern "C" int TrampolineX7;
|
|
76
|
-
extern "C" int Trampoline8; extern "C" int TrampolineX8;
|
|
77
|
-
extern "C" int Trampoline9; extern "C" int TrampolineX9;
|
|
78
|
-
extern "C" int Trampoline10; extern "C" int TrampolineX10;
|
|
79
|
-
extern "C" int Trampoline11; extern "C" int TrampolineX11;
|
|
80
|
-
extern "C" int Trampoline12; extern "C" int TrampolineX12;
|
|
81
|
-
extern "C" int Trampoline13; extern "C" int TrampolineX13;
|
|
82
|
-
extern "C" int Trampoline14; extern "C" int TrampolineX14;
|
|
83
|
-
extern "C" int Trampoline15; extern "C" int TrampolineX15;
|
|
84
|
-
extern "C" int Trampoline16; extern "C" int TrampolineX16;
|
|
85
|
-
extern "C" int Trampoline17; extern "C" int TrampolineX17;
|
|
86
|
-
extern "C" int Trampoline18; extern "C" int TrampolineX18;
|
|
87
|
-
extern "C" int Trampoline19; extern "C" int TrampolineX19;
|
|
88
|
-
extern "C" int Trampoline20; extern "C" int TrampolineX20;
|
|
89
|
-
extern "C" int Trampoline21; extern "C" int TrampolineX21;
|
|
90
|
-
extern "C" int Trampoline22; extern "C" int TrampolineX22;
|
|
91
|
-
extern "C" int Trampoline23; extern "C" int TrampolineX23;
|
|
92
|
-
extern "C" int Trampoline24; extern "C" int TrampolineX24;
|
|
93
|
-
extern "C" int Trampoline25; extern "C" int TrampolineX25;
|
|
94
|
-
extern "C" int Trampoline26; extern "C" int TrampolineX26;
|
|
95
|
-
extern "C" int Trampoline27; extern "C" int TrampolineX27;
|
|
96
|
-
extern "C" int Trampoline28; extern "C" int TrampolineX28;
|
|
97
|
-
extern "C" int Trampoline29; extern "C" int TrampolineX29;
|
|
98
|
-
extern "C" int Trampoline30; extern "C" int TrampolineX30;
|
|
99
|
-
extern "C" int Trampoline31; extern "C" int TrampolineX31;
|
|
100
|
-
|
|
101
68
|
extern "C" napi_value CallSwitchStack(Napi::Function *func, size_t argc, napi_value *argv,
|
|
102
69
|
uint8_t *old_sp, Span<uint8_t> *new_stack,
|
|
103
70
|
napi_value (*call)(Napi::Function *func, size_t argc, napi_value *argv));
|
|
104
71
|
|
|
105
|
-
|
|
106
|
-
{ &Trampoline0, &TrampolineX0 },
|
|
107
|
-
{ &Trampoline1, &TrampolineX1 },
|
|
108
|
-
{ &Trampoline2, &TrampolineX2 },
|
|
109
|
-
{ &Trampoline3, &TrampolineX3 },
|
|
110
|
-
{ &Trampoline4, &TrampolineX4 },
|
|
111
|
-
{ &Trampoline5, &TrampolineX5 },
|
|
112
|
-
{ &Trampoline6, &TrampolineX6 },
|
|
113
|
-
{ &Trampoline7, &TrampolineX7 },
|
|
114
|
-
{ &Trampoline8, &TrampolineX8 },
|
|
115
|
-
{ &Trampoline9, &TrampolineX9 },
|
|
116
|
-
{ &Trampoline10, &TrampolineX10 },
|
|
117
|
-
{ &Trampoline11, &TrampolineX11 },
|
|
118
|
-
{ &Trampoline12, &TrampolineX12 },
|
|
119
|
-
{ &Trampoline13, &TrampolineX13 },
|
|
120
|
-
{ &Trampoline14, &TrampolineX14 },
|
|
121
|
-
{ &Trampoline15, &TrampolineX15 },
|
|
122
|
-
{ &Trampoline16, &TrampolineX16 },
|
|
123
|
-
{ &Trampoline17, &TrampolineX17 },
|
|
124
|
-
{ &Trampoline18, &TrampolineX18 },
|
|
125
|
-
{ &Trampoline19, &TrampolineX19 },
|
|
126
|
-
{ &Trampoline20, &TrampolineX20 },
|
|
127
|
-
{ &Trampoline21, &TrampolineX21 },
|
|
128
|
-
{ &Trampoline22, &TrampolineX22 },
|
|
129
|
-
{ &Trampoline23, &TrampolineX23 },
|
|
130
|
-
{ &Trampoline24, &TrampolineX24 },
|
|
131
|
-
{ &Trampoline25, &TrampolineX25 },
|
|
132
|
-
{ &Trampoline26, &TrampolineX26 },
|
|
133
|
-
{ &Trampoline27, &TrampolineX27 },
|
|
134
|
-
{ &Trampoline28, &TrampolineX28 },
|
|
135
|
-
{ &Trampoline29, &TrampolineX29 },
|
|
136
|
-
{ &Trampoline30, &TrampolineX30 },
|
|
137
|
-
{ &Trampoline31, &TrampolineX31 }
|
|
138
|
-
};
|
|
139
|
-
RG_STATIC_ASSERT(RG_LEN(Trampolines) == MaxTrampolines * 2);
|
|
72
|
+
#include "abi_trampolines.inc"
|
|
140
73
|
|
|
141
74
|
static inline RegisterClass MergeClasses(RegisterClass cls1, RegisterClass cls2)
|
|
142
75
|
{
|
|
@@ -964,7 +897,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, bool async,
|
|
|
964
897
|
if (RG_UNLIKELY(!ptr))
|
|
965
898
|
return;
|
|
966
899
|
} else if (CheckValueTag(instance, value, type->ref.marker)) {
|
|
967
|
-
ptr = value.As<Napi::External<
|
|
900
|
+
ptr = value.As<Napi::External<void>>().Data();
|
|
968
901
|
} else if (IsNullOrUndefined(value)) {
|
|
969
902
|
ptr = nullptr;
|
|
970
903
|
} else {
|
|
@@ -984,7 +917,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, bool async,
|
|
|
984
917
|
err_guard.Disable();
|
|
985
918
|
}
|
|
986
919
|
|
|
987
|
-
void *GetTrampoline(
|
|
920
|
+
void *GetTrampoline(int16_t idx, const FunctionInfo *proto)
|
|
988
921
|
{
|
|
989
922
|
bool xmm = proto->forward_fp || IsFloat(proto->ret.type);
|
|
990
923
|
return Trampolines[idx][xmm];
|