koffi 1.3.5 → 1.3.8
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/CMakeLists.txt +1 -1
- package/ChangeLog.md +36 -0
- package/benchmark/atoi_koffi.js +3 -4
- package/benchmark/atoi_napi.js +2 -3
- package/benchmark/atoi_node_ffi.js +3 -4
- package/benchmark/raylib_cc.cc +3 -4
- package/benchmark/raylib_cc.js +31 -0
- package/benchmark/raylib_koffi.js +8 -9
- package/benchmark/raylib_node_ffi.js +4 -5
- package/benchmark/raylib_node_raylib.js +4 -5
- package/build/qemu/1.3.8/koffi_darwin_arm64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_darwin_x64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_freebsd_arm64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_freebsd_ia32.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_freebsd_x64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_linux_arm32hf.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_linux_arm64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_linux_ia32.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_linux_riscv64hf64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_linux_x64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_openbsd_ia32.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_openbsd_x64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_win32_arm64.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_win32_ia32.tar.gz +0 -0
- package/build/qemu/1.3.8/koffi_win32_x64.tar.gz +0 -0
- package/doc/_static/perf_linux_20220627.png +0 -0
- package/doc/_static/perf_linux_20220628.png +0 -0
- package/doc/_static/perf_windows_20220627.png +0 -0
- package/doc/_static/perf_windows_20220628.png +0 -0
- package/doc/benchmarks.md +78 -58
- package/doc/benchmarks.xlsx +0 -0
- package/doc/conf.py +1 -1
- package/doc/contribute.md +8 -11
- package/doc/dist/html/_sources/benchmarks.md.txt +78 -58
- package/doc/dist/html/_sources/contribute.md.txt +8 -11
- package/doc/dist/html/_sources/functions.md.txt +9 -8
- package/doc/dist/html/_sources/index.rst.txt +3 -0
- package/doc/dist/html/_sources/platforms.md.txt +17 -5
- package/doc/dist/html/_sources/start.md.txt +14 -3
- package/doc/dist/html/_sources/types.md.txt +15 -11
- package/doc/dist/html/_static/basic.css +12 -14
- package/doc/dist/html/_static/perf_linux_20220627.png +0 -0
- package/doc/dist/html/_static/perf_linux_20220628.png +0 -0
- package/doc/dist/html/_static/perf_windows_20220627.png +0 -0
- package/doc/dist/html/_static/perf_windows_20220628.png +0 -0
- package/doc/dist/html/benchmarks.html +148 -159
- package/doc/dist/html/changes.html +44 -2
- package/doc/dist/html/contribute.html +30 -33
- package/doc/dist/html/functions.html +19 -18
- package/doc/dist/html/genindex.html +2 -2
- package/doc/dist/html/index.html +19 -10
- package/doc/dist/html/memory.html +2 -2
- package/doc/dist/html/objects.inv +0 -0
- package/doc/dist/html/platforms.html +44 -10
- package/doc/dist/html/search.html +2 -2
- package/doc/dist/html/searchindex.js +1 -1
- package/doc/dist/html/start.html +25 -12
- package/doc/dist/html/types.html +31 -11
- package/doc/functions.md +9 -8
- package/doc/index.rst +3 -0
- package/doc/platforms.md +17 -5
- package/doc/start.md +14 -3
- package/doc/types.md +15 -11
- package/package.json +7 -4
- package/qemu/qemu.js +30 -19
- package/qemu/registry/machines.json +19 -19
- package/qemu/registry/sha256sum.txt +5 -5
- package/src/abi_arm32.cc +9 -2
- package/src/abi_arm32_fwd.S +7 -7
- package/src/abi_arm64.cc +9 -2
- package/src/abi_arm64_fwd.S +11 -7
- package/src/abi_arm64_fwd.asm +7 -7
- package/src/abi_riscv64.cc +9 -2
- package/src/abi_riscv64_fwd.S +11 -11
- package/src/abi_x64_sysv.cc +9 -2
- package/src/abi_x64_sysv_fwd.S +11 -11
- package/src/abi_x64_win.cc +9 -2
- package/src/abi_x64_win_fwd.asm +7 -7
- package/src/abi_x86.cc +9 -2
- package/src/abi_x86_fwd.S +3 -0
- package/src/abi_x86_fwd.asm +3 -0
- package/src/call.cc +20 -10
- package/src/ffi.cc +17 -8
- package/src/ffi.hh +4 -3
- package/src/util.cc +1 -1
- package/test/async.js +1 -1
- package/test/callbacks.js +25 -2
- package/test/misc.c +57 -2
- package/test/raylib.js +4 -4
- package/test/sqlite.js +5 -5
- package/test/sync.js +22 -7
- package/build/qemu/1.3.5/koffi_darwin_arm64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_darwin_x64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_freebsd_arm64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_freebsd_ia32.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_freebsd_x64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_linux_arm32hf.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_linux_arm64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_linux_ia32.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_linux_riscv64hf64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_linux_x64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_openbsd_ia32.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_openbsd_x64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_win32_arm64.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_win32_ia32.tar.gz +0 -0
- package/build/qemu/1.3.5/koffi_win32_x64.tar.gz +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koffi",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Fast and simple C FFI (foreign function interface) for Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"foreign",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"main": "src/index.js",
|
|
21
21
|
"scripts": {
|
|
22
22
|
"install": "cnoke --prebuild build/qemu/{{version}}/koffi_{{platform}}_{{arch}}.tar.gz --require ./build/koffi.node",
|
|
23
|
-
"test": "node qemu/qemu.js",
|
|
23
|
+
"test": "node qemu/qemu.js test",
|
|
24
24
|
"prepublishOnly": "node qemu/qemu.js pack"
|
|
25
25
|
},
|
|
26
26
|
"license": "AGPL-3.0",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"cnoke": "^
|
|
28
|
+
"cnoke": "^3.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"chalk": "^4.1.2",
|
|
@@ -59,5 +59,8 @@
|
|
|
59
59
|
"ChangeLog.md",
|
|
60
60
|
"CMakeLists.txt",
|
|
61
61
|
"build/qemu/*/*.tar.gz"
|
|
62
|
-
]
|
|
62
|
+
],
|
|
63
|
+
"engines": {
|
|
64
|
+
"napi": 8
|
|
65
|
+
}
|
|
63
66
|
}
|
package/qemu/qemu.js
CHANGED
|
@@ -53,21 +53,22 @@ async function main() {
|
|
|
53
53
|
|
|
54
54
|
// Parse options
|
|
55
55
|
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
if (process.argv.length < 3 || process.argv[2][0] == '-')
|
|
57
|
+
throw new Error(`Missing command, use --help`);
|
|
58
|
+
|
|
59
|
+
switch (process.argv[2]) {
|
|
60
|
+
case 'pack': { command = pack; } break;
|
|
61
|
+
case 'test': { command = test; } break;
|
|
62
|
+
case 'start': { command = start; } break;
|
|
63
|
+
case 'stop': { command = stop; } break;
|
|
64
|
+
case 'info': { command = info; } break;
|
|
65
|
+
case 'ssh': { command = ssh; } break;
|
|
66
|
+
case 'reset': { command = reset; } break;
|
|
67
|
+
|
|
68
|
+
default: { throw new Error(`Unknown command '${process.argv[2]}'`); } break;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
for (; i < process.argv.length; i++) {
|
|
71
|
+
for (let i = 3; i < process.argv.length; i++) {
|
|
71
72
|
let arg = process.argv[i];
|
|
72
73
|
let value = null;
|
|
73
74
|
|
|
@@ -193,7 +194,7 @@ async function main() {
|
|
|
193
194
|
}
|
|
194
195
|
|
|
195
196
|
function print_usage() {
|
|
196
|
-
let help = `Usage: node qemu.js
|
|
197
|
+
let help = `Usage: node qemu.js <command> [options...]
|
|
197
198
|
|
|
198
199
|
Commands:
|
|
199
200
|
test Run the machines and perform the tests (default)
|
|
@@ -314,6 +315,11 @@ async function pack() {
|
|
|
314
315
|
|
|
315
316
|
let ready = ignore.size;
|
|
316
317
|
|
|
318
|
+
if (ready >= machines.length) {
|
|
319
|
+
console.log('>> Nothing to do!');
|
|
320
|
+
return true;
|
|
321
|
+
}
|
|
322
|
+
|
|
317
323
|
success &= await start(false);
|
|
318
324
|
success &= await copy(machine => Object.values(machine.builds).map(build => build.directory));
|
|
319
325
|
|
|
@@ -383,11 +389,11 @@ async function pack() {
|
|
|
383
389
|
let dest_dir = build_dir + `/${version}/koffi_${machine.platform}_${build.arch}`;
|
|
384
390
|
let dest_filename = dest_dir + '.tar.gz';
|
|
385
391
|
|
|
386
|
-
unlink_recursive(dest_dir
|
|
387
|
-
fs.mkdirSync(dest_dir
|
|
392
|
+
unlink_recursive(dest_dir);
|
|
393
|
+
fs.mkdirSync(dest_dir, { mode: 0o755, recursive: true });
|
|
388
394
|
|
|
389
395
|
try {
|
|
390
|
-
await machine.ssh.getDirectory(dest_dir
|
|
396
|
+
await machine.ssh.getDirectory(dest_dir, src_dir, {
|
|
391
397
|
recursive: false,
|
|
392
398
|
concurrency: 4,
|
|
393
399
|
validate: filename => !path.basename(filename).match(/^v[0-9]+/)
|
|
@@ -413,9 +419,14 @@ async function pack() {
|
|
|
413
419
|
|
|
414
420
|
if (machines.some(machine => machine.started))
|
|
415
421
|
success &= await stop(false);
|
|
422
|
+
success &= (ignore.size == ready);
|
|
416
423
|
|
|
417
|
-
|
|
418
|
-
|
|
424
|
+
console.log('');
|
|
425
|
+
if (success) {
|
|
426
|
+
console.log('>> Status: ' + chalk.bold.green('SUCCESS'));
|
|
427
|
+
} else {
|
|
428
|
+
console.log('>> Status: ' + chalk.bold.red('FAILED'));
|
|
429
|
+
}
|
|
419
430
|
|
|
420
431
|
return success;
|
|
421
432
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"Linux ARM32": {
|
|
30
30
|
"directory": "/home/debian/luigi",
|
|
31
31
|
"build": {
|
|
32
|
-
"Build": "node ../cnoke/cnoke.js -
|
|
32
|
+
"Build": "node ../cnoke/cnoke.js -d test"
|
|
33
33
|
},
|
|
34
34
|
"commands": {
|
|
35
35
|
"Test Sync": "node test/sync.js",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"Linux ARM64": {
|
|
73
73
|
"directory": "/home/debian/luigi",
|
|
74
74
|
"build": {
|
|
75
|
-
"Build": "node ../cnoke/cnoke.js -
|
|
75
|
+
"Build": "node ../cnoke/cnoke.js -d test"
|
|
76
76
|
},
|
|
77
77
|
"commands": {
|
|
78
78
|
"Test Sync": "node test/sync.js",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"Linux i386": {
|
|
116
116
|
"directory": "/home/debian/luigi",
|
|
117
117
|
"build": {
|
|
118
|
-
"Build": "node ../cnoke/cnoke.js -
|
|
118
|
+
"Build": "node ../cnoke/cnoke.js -d test"
|
|
119
119
|
},
|
|
120
120
|
"commands": {
|
|
121
121
|
"Test Sync": "node test/sync.js",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"Linux x64": {
|
|
151
151
|
"arch": "x64",
|
|
152
152
|
"directory": "/home/debian/luigi",
|
|
153
|
-
"build": "node ../cnoke/cnoke.js"
|
|
153
|
+
"build": "node ../cnoke/cnoke.js --prefer-clang"
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
156
|
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"Linux x64": {
|
|
159
159
|
"directory": "/home/debian/luigi",
|
|
160
160
|
"build": {
|
|
161
|
-
"Build": "node ../cnoke/cnoke.js -
|
|
161
|
+
"Build": "node ../cnoke/cnoke.js -d test --prefer-clang"
|
|
162
162
|
},
|
|
163
163
|
"commands": {
|
|
164
164
|
"Test Sync": "node test/sync.js",
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
"qemu": {
|
|
179
179
|
"binary": "qemu-system-x86_64",
|
|
180
180
|
"arguments": ["-m", "3G", "-smp", 4, "-rtc", "clock=host,base=localtime", "-bios", "bios.bin", "-hda", "disk.qcow2", "-netdev", "user,id=mynet,hostfwd=tcp::22205-:22", "-device", "e1000,netdev=mynet", "-vga", "std", "-device", "qemu-xhci", "-device", "usb-tablet", "-vnc", "127.0.0.1:15"],
|
|
181
|
-
"version":
|
|
181
|
+
"version": 10,
|
|
182
182
|
|
|
183
183
|
"ssh_port": 22205,
|
|
184
184
|
"vnc_port": 5915,
|
|
@@ -199,13 +199,13 @@
|
|
|
199
199
|
"Windows x64": {
|
|
200
200
|
"arch": "x64",
|
|
201
201
|
"directory": "C:/Users/windows/Desktop/luigi_x64",
|
|
202
|
-
"build": "C:\\Node64\\node64.cmd node ../cnoke/cnoke.js"
|
|
202
|
+
"build": "C:\\Node64\\node64.cmd node ../cnoke/cnoke.js --prefer-clang"
|
|
203
203
|
},
|
|
204
204
|
|
|
205
205
|
"Windows ARM64": {
|
|
206
206
|
"arch": "arm64",
|
|
207
207
|
"directory": "C:/Users/windows/Desktop/luigi_arm64",
|
|
208
|
-
"build": "C:\\Node64\\node64.cmd node ../cnoke/cnoke.js
|
|
208
|
+
"build": "C:\\Node64\\node64.cmd node ../cnoke/cnoke.js -a arm64 -v 16.13.0"
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
211
|
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
"Windows i386": {
|
|
214
214
|
"directory": "C:/Users/windows/Desktop/luigi_ia32",
|
|
215
215
|
"build": {
|
|
216
|
-
"Build": "C:\\Node32\\node32.cmd node ../cnoke/cnoke.js -
|
|
216
|
+
"Build": "C:\\Node32\\node32.cmd node ../cnoke/cnoke.js -d test"
|
|
217
217
|
},
|
|
218
218
|
"commands": {
|
|
219
219
|
"Test Sync": "C:\\Node32\\node32.cmd node test/sync.js",
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
"Windows x64": {
|
|
228
228
|
"directory": "C:/Users/windows/Desktop/luigi_x64",
|
|
229
229
|
"build": {
|
|
230
|
-
"Build": "C:\\Node64\\node64.cmd node ../cnoke/cnoke.js -
|
|
230
|
+
"Build": "C:\\Node64\\node64.cmd node ../cnoke/cnoke.js -d test --prefer-clang"
|
|
231
231
|
},
|
|
232
232
|
"commands": {
|
|
233
233
|
"Test Sync": "C:\\Node64\\node64.cmd node test/sync.js",
|
|
@@ -270,7 +270,7 @@
|
|
|
270
270
|
"FreeBSD x64": {
|
|
271
271
|
"directory": "/home/freebsd/luigi",
|
|
272
272
|
"build": {
|
|
273
|
-
"Build": "node ../cnoke/cnoke.js -
|
|
273
|
+
"Build": "node ../cnoke/cnoke.js -d test"
|
|
274
274
|
},
|
|
275
275
|
"commands": {
|
|
276
276
|
"Test Sync": "node test/sync.js",
|
|
@@ -313,7 +313,7 @@
|
|
|
313
313
|
"FreeBSD i386": {
|
|
314
314
|
"directory": "/home/freebsd/luigi",
|
|
315
315
|
"build": {
|
|
316
|
-
"Build": "node ../cnoke/cnoke.js -
|
|
316
|
+
"Build": "node ../cnoke/cnoke.js -d test"
|
|
317
317
|
},
|
|
318
318
|
"commands": {
|
|
319
319
|
"Test Sync": "node test/sync.js",
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
"FreeBSD ARM64": {
|
|
357
357
|
"directory": "/home/freebsd/luigi",
|
|
358
358
|
"build": {
|
|
359
|
-
"Build": "node ../cnoke/cnoke.js -
|
|
359
|
+
"Build": "node ../cnoke/cnoke.js -d test"
|
|
360
360
|
},
|
|
361
361
|
"commands": {
|
|
362
362
|
"Test Sync": "node test/sync.js",
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
"macOS ARM64": {
|
|
398
398
|
"arch": "arm64",
|
|
399
399
|
"directory": "/Users/macos/luigi_arm64",
|
|
400
|
-
"build": "PATH=/usr/local/bin:/usr/bin:/bin SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk node ../cnoke/cnoke.js
|
|
400
|
+
"build": "PATH=/usr/local/bin:/usr/bin:/bin SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk node ../cnoke/cnoke.js -a arm64"
|
|
401
401
|
}
|
|
402
402
|
},
|
|
403
403
|
|
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
"macOS x64": {
|
|
406
406
|
"directory": "/Users/macos/luigi",
|
|
407
407
|
"build": {
|
|
408
|
-
"Build": "PATH=/usr/local/bin:/usr/bin:/bin SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk node ../cnoke/cnoke.js -
|
|
408
|
+
"Build": "PATH=/usr/local/bin:/usr/bin:/bin SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk node ../cnoke/cnoke.js -d test"
|
|
409
409
|
},
|
|
410
410
|
"commands": {
|
|
411
411
|
"Test Sync": "PATH=/usr/local/bin:/usr/bin:/bin node test/sync.js",
|
|
@@ -447,7 +447,7 @@
|
|
|
447
447
|
"OpenBSD x64": {
|
|
448
448
|
"directory": "/home/openbsd/luigi",
|
|
449
449
|
"build": {
|
|
450
|
-
"Build": "node ../cnoke/cnoke.js -
|
|
450
|
+
"Build": "node ../cnoke/cnoke.js -d test"
|
|
451
451
|
},
|
|
452
452
|
"commands": {
|
|
453
453
|
"Test Sync": "node test/sync.js",
|
|
@@ -467,7 +467,7 @@
|
|
|
467
467
|
"qemu": {
|
|
468
468
|
"binary": "qemu-system-x86_64",
|
|
469
469
|
"arguments": ["-m", "1G", "-smp", 2, "-hda", "disk.qcow2", "-netdev", "user,id=mynet,hostfwd=tcp::22211-:22", "-device", "e1000,netdev=mynet", "-vnc", "127.0.0.1:21"],
|
|
470
|
-
"version":
|
|
470
|
+
"version": 2,
|
|
471
471
|
|
|
472
472
|
"ssh_port": 22211,
|
|
473
473
|
"vnc_port": 5921,
|
|
@@ -490,7 +490,7 @@
|
|
|
490
490
|
"OpenBSD i386": {
|
|
491
491
|
"directory": "/home/openbsd/luigi",
|
|
492
492
|
"build": {
|
|
493
|
-
"Build": "node ../cnoke/cnoke.js -
|
|
493
|
+
"Build": "node ../cnoke/cnoke.js -d test"
|
|
494
494
|
},
|
|
495
495
|
"commands": {
|
|
496
496
|
"Test Sync": "node test/sync.js",
|
|
@@ -533,7 +533,7 @@
|
|
|
533
533
|
"Linux RISC-V 64": {
|
|
534
534
|
"directory": "/home/debian/luigi",
|
|
535
535
|
"build": {
|
|
536
|
-
"Build": "node ../cnoke/cnoke.js -
|
|
536
|
+
"Build": "node ../cnoke/cnoke.js -d test"
|
|
537
537
|
},
|
|
538
538
|
"commands": {
|
|
539
539
|
"Test Sync": "node test/sync.js",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
917df3320d778ddbaa5c5c7742bc4046bf803c36ed2b050f30844ed206783469 *qemu/windows_x64/VERSION
|
|
2
2
|
0a40f87b2a038522e55318a0abde60403bb13a5e81a7a0966a9a736e65d4ae46 *qemu/windows_x64/install.sh
|
|
3
3
|
f8c9a1638a3fc2cdd214f2cbcad6fee0e3b2c9383942bbd49b3915bb4c3da102 *qemu/windows_x64/bios.bin
|
|
4
|
-
|
|
4
|
+
60b1fea3f0ec2c27b410a45b659deb53bb8d5367989207a8850fdfcbc2d83eb1 *qemu/windows_x64/disk.qcow2
|
|
5
5
|
1121cfccd5913f0a63fec40a6ffd44ea64f9dc135c66634ba001d10bcf4302a2 *qemu/debian_x64/VERSION
|
|
6
6
|
ba418d2d602981fe324ae7a1a608b0f2d8d7c6113d03a429cc402e24ddc81311 *qemu/debian_x64/vmlinuz-5.10.0-12-amd64
|
|
7
7
|
4d44622e8ce058017c08051d694b8e5afe9ff406b6ad91c17ebc4ec43d205c42 *qemu/debian_x64/install.sh
|
|
@@ -47,9 +47,9 @@ d79538ac489f1948b04b65f12c5618c28e4a5de0be062f5cf1d73e422a091a37 *qemu/macos_x64
|
|
|
47
47
|
9dcdabfc12ad2ba2da1b9c3d95dc46311a12d6e3190f1bfd0c9b184ac1577c94 *qemu/openbsd_x64/install.sh
|
|
48
48
|
6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b *qemu/openbsd_x64/VERSION
|
|
49
49
|
7b66bdf8b77fd1c6256ffdab623e37ce099797ad657dcd25af5df0486fadce37 *qemu/openbsd_x64/xvfb-run.sh
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
3bef620f4c1050533c3c1bd62721f9617511a6791784fd641426a45fec289b07 *qemu/openbsd_i386/disk.qcow2
|
|
51
|
+
691ce78bb8a08f90903aec679017028fedd567b37bc7b4aa132baa083a7c1edd *qemu/openbsd_i386/install.sh
|
|
52
|
+
d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35 *qemu/openbsd_i386/VERSION
|
|
53
53
|
7b66bdf8b77fd1c6256ffdab623e37ce099797ad657dcd25af5df0486fadce37 *qemu/openbsd_i386/xvfb-run.sh
|
|
54
54
|
64048432020bda960f397b5a138ea98aa6bbd42db02e8bb34ff3b9320763e36d *qemu/debian_riscv64/uboot.elf
|
|
55
55
|
0bdd93879f87c338d62422a65fdcba4d8c834848f2305f31b916539cb523e9e8 *qemu/debian_riscv64/readme.txt
|
package/src/abi_arm32.cc
CHANGED
|
@@ -535,8 +535,15 @@ Napi::Value CallData::Complete()
|
|
|
535
535
|
|
|
536
536
|
void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegisters *out_reg)
|
|
537
537
|
{
|
|
538
|
-
const
|
|
539
|
-
|
|
538
|
+
const TrampolineInfo &trampoline = instance->trampolines[idx];
|
|
539
|
+
|
|
540
|
+
if (RG_UNLIKELY(trampoline.generation != mem->generation)) {
|
|
541
|
+
ThrowError<Napi::Error>(env, "Cannot use non-persistent callback beyond FFI call");
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
const FunctionInfo *proto = trampoline.proto;
|
|
546
|
+
Napi::Function func = trampoline.func.Value();
|
|
540
547
|
|
|
541
548
|
uint64_t *vec_ptr = (uint64_t *)own_sp;
|
|
542
549
|
uint32_t *gpr_ptr = (uint32_t *)(vec_ptr + 8);
|
package/src/abi_arm32_fwd.S
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
.endm
|
|
58
58
|
|
|
59
59
|
# Prepare general purpose argument registers from array passed by caller.
|
|
60
|
-
.macro
|
|
60
|
+
.macro forward_gpr
|
|
61
61
|
ldr r3, [r1, 76]
|
|
62
62
|
ldr r2, [r1, 72]
|
|
63
63
|
ldr r0, [r1, 64]
|
|
@@ -78,35 +78,35 @@
|
|
|
78
78
|
|
|
79
79
|
ForwardCallGG:
|
|
80
80
|
prologue
|
|
81
|
-
|
|
81
|
+
forward_gpr
|
|
82
82
|
epilogue
|
|
83
83
|
|
|
84
84
|
ForwardCallF:
|
|
85
85
|
prologue
|
|
86
|
-
|
|
86
|
+
forward_gpr
|
|
87
87
|
epilogue
|
|
88
88
|
|
|
89
89
|
ForwardCallDDDD:
|
|
90
90
|
prologue
|
|
91
|
-
|
|
91
|
+
forward_gpr
|
|
92
92
|
epilogue
|
|
93
93
|
|
|
94
94
|
ForwardCallXGG:
|
|
95
95
|
prologue
|
|
96
96
|
forward_vec
|
|
97
|
-
|
|
97
|
+
forward_gpr
|
|
98
98
|
epilogue
|
|
99
99
|
|
|
100
100
|
ForwardCallXF:
|
|
101
101
|
prologue
|
|
102
102
|
forward_vec
|
|
103
|
-
|
|
103
|
+
forward_gpr
|
|
104
104
|
epilogue
|
|
105
105
|
|
|
106
106
|
ForwardCallXDDDD:
|
|
107
107
|
prologue
|
|
108
108
|
forward_vec
|
|
109
|
-
|
|
109
|
+
forward_gpr
|
|
110
110
|
epilogue
|
|
111
111
|
|
|
112
112
|
# Callback trampolines
|
package/src/abi_arm64.cc
CHANGED
|
@@ -561,8 +561,15 @@ Napi::Value CallData::Complete()
|
|
|
561
561
|
|
|
562
562
|
void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegisters *out_reg)
|
|
563
563
|
{
|
|
564
|
-
const
|
|
565
|
-
|
|
564
|
+
const TrampolineInfo &trampoline = instance->trampolines[idx];
|
|
565
|
+
|
|
566
|
+
if (RG_UNLIKELY(trampoline.generation != mem->generation)) {
|
|
567
|
+
ThrowError<Napi::Error>(env, "Cannot use non-persistent callback beyond FFI call");
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
const FunctionInfo *proto = trampoline.proto;
|
|
572
|
+
Napi::Function func = trampoline.func.Value();
|
|
566
573
|
|
|
567
574
|
uint64_t *gpr_ptr = (uint64_t *)own_sp;
|
|
568
575
|
uint64_t *vec_ptr = gpr_ptr + 9;
|
package/src/abi_arm64_fwd.S
CHANGED
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
# Save RSP in r29 (non-volatile), and use carefully assembled stack provided by caller.
|
|
42
42
|
.macro prologue
|
|
43
43
|
.cfi_startproc
|
|
44
|
+
hint #34
|
|
44
45
|
stp x29, x30, [sp, -16]!
|
|
45
46
|
.cfi_def_cfa sp, 16
|
|
46
47
|
.cfi_offset 29, 16
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
.endm
|
|
69
70
|
|
|
70
71
|
# Prepare general purpose argument registers from array passed by caller.
|
|
71
|
-
.macro
|
|
72
|
+
.macro forward_gpr
|
|
72
73
|
ldr x8, [x1, 64]
|
|
73
74
|
ldp x6, x7, [x1, 48]
|
|
74
75
|
ldp x4, x5, [x1, 32]
|
|
@@ -86,35 +87,35 @@
|
|
|
86
87
|
|
|
87
88
|
SYMBOL(ForwardCallGG):
|
|
88
89
|
prologue
|
|
89
|
-
|
|
90
|
+
forward_gpr
|
|
90
91
|
epilogue
|
|
91
92
|
|
|
92
93
|
SYMBOL(ForwardCallF):
|
|
93
94
|
prologue
|
|
94
|
-
|
|
95
|
+
forward_gpr
|
|
95
96
|
epilogue
|
|
96
97
|
|
|
97
98
|
SYMBOL(ForwardCallDDDD):
|
|
98
99
|
prologue
|
|
99
|
-
|
|
100
|
+
forward_gpr
|
|
100
101
|
epilogue
|
|
101
102
|
|
|
102
103
|
SYMBOL(ForwardCallXGG):
|
|
103
104
|
prologue
|
|
104
105
|
forward_vec
|
|
105
|
-
|
|
106
|
+
forward_gpr
|
|
106
107
|
epilogue
|
|
107
108
|
|
|
108
109
|
SYMBOL(ForwardCallXF):
|
|
109
110
|
prologue
|
|
110
111
|
forward_vec
|
|
111
|
-
|
|
112
|
+
forward_gpr
|
|
112
113
|
epilogue
|
|
113
114
|
|
|
114
115
|
SYMBOL(ForwardCallXDDDD):
|
|
115
116
|
prologue
|
|
116
117
|
forward_vec
|
|
117
|
-
|
|
118
|
+
forward_gpr
|
|
118
119
|
epilogue
|
|
119
120
|
|
|
120
121
|
# Callback trampolines
|
|
@@ -162,6 +163,7 @@ SYMBOL(ForwardCallXDDDD):
|
|
|
162
163
|
# After the call, simply load these registers from the output struct.
|
|
163
164
|
.macro trampoline id
|
|
164
165
|
.cfi_startproc
|
|
166
|
+
hint #34
|
|
165
167
|
stp x29, x30, [sp, -16]!
|
|
166
168
|
.cfi_def_cfa sp, 16
|
|
167
169
|
.cfi_offset 29, 16
|
|
@@ -192,6 +194,7 @@ SYMBOL(ForwardCallXDDDD):
|
|
|
192
194
|
# Same thing, but also forwards the floating-point argument registers and loads them at the end.
|
|
193
195
|
.macro trampoline_vec id
|
|
194
196
|
.cfi_startproc
|
|
197
|
+
hint #34
|
|
195
198
|
stp x29, x30, [sp, -16]!
|
|
196
199
|
.cfi_def_cfa sp, 16
|
|
197
200
|
.cfi_offset 29, 16
|
|
@@ -298,6 +301,7 @@ SYMBOL(TrampolineX15):
|
|
|
298
301
|
# The first three parameters (x0, x1, x2) are passed through untouched.
|
|
299
302
|
SYMBOL(CallSwitchStack):
|
|
300
303
|
.cfi_startproc
|
|
304
|
+
hint #34
|
|
301
305
|
stp x29, x30, [sp, -16]!
|
|
302
306
|
.cfi_def_cfa sp, 16
|
|
303
307
|
.cfi_offset 29, 16
|
package/src/abi_arm64_fwd.asm
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
|
|
54
54
|
; Prepare general purpose argument registers from array passed by caller.
|
|
55
55
|
MACRO
|
|
56
|
-
|
|
56
|
+
forward_gpr
|
|
57
57
|
|
|
58
58
|
ldr x8, [x1, 64]
|
|
59
59
|
ldp x6, x7, [x1, 48]
|
|
@@ -74,40 +74,40 @@
|
|
|
74
74
|
|
|
75
75
|
ForwardCallGG PROC
|
|
76
76
|
prologue
|
|
77
|
-
|
|
77
|
+
forward_gpr
|
|
78
78
|
epilogue
|
|
79
79
|
ENDP
|
|
80
80
|
|
|
81
81
|
ForwardCallF PROC
|
|
82
82
|
prologue
|
|
83
|
-
|
|
83
|
+
forward_gpr
|
|
84
84
|
epilogue
|
|
85
85
|
ENDP
|
|
86
86
|
|
|
87
87
|
ForwardCallDDDD PROC
|
|
88
88
|
prologue
|
|
89
|
-
|
|
89
|
+
forward_gpr
|
|
90
90
|
epilogue
|
|
91
91
|
ENDP
|
|
92
92
|
|
|
93
93
|
ForwardCallXGG PROC
|
|
94
94
|
prologue
|
|
95
95
|
forward_vec
|
|
96
|
-
|
|
96
|
+
forward_gpr
|
|
97
97
|
epilogue
|
|
98
98
|
ENDP
|
|
99
99
|
|
|
100
100
|
ForwardCallXF PROC
|
|
101
101
|
prologue
|
|
102
102
|
forward_vec
|
|
103
|
-
|
|
103
|
+
forward_gpr
|
|
104
104
|
epilogue
|
|
105
105
|
ENDP
|
|
106
106
|
|
|
107
107
|
ForwardCallXDDDD PROC
|
|
108
108
|
prologue
|
|
109
109
|
forward_vec
|
|
110
|
-
|
|
110
|
+
forward_gpr
|
|
111
111
|
epilogue
|
|
112
112
|
ENDP
|
|
113
113
|
|
package/src/abi_riscv64.cc
CHANGED
|
@@ -476,8 +476,15 @@ Napi::Value CallData::Complete()
|
|
|
476
476
|
|
|
477
477
|
void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegisters *out_reg)
|
|
478
478
|
{
|
|
479
|
-
const
|
|
480
|
-
|
|
479
|
+
const TrampolineInfo &trampoline = instance->trampolines[idx];
|
|
480
|
+
|
|
481
|
+
if (RG_UNLIKELY(trampoline.generation != mem->generation)) {
|
|
482
|
+
ThrowError<Napi::Error>(env, "Cannot use non-persistent callback beyond FFI call");
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const FunctionInfo *proto = trampoline.proto;
|
|
487
|
+
Napi::Function func = trampoline.func.Value();
|
|
481
488
|
|
|
482
489
|
uint64_t *gpr_ptr = (uint64_t *)own_sp;
|
|
483
490
|
uint64_t *vec_ptr = gpr_ptr + 8;
|
package/src/abi_riscv64_fwd.S
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
.endm
|
|
56
56
|
|
|
57
57
|
# Prepare general purpose argument registers from array passed by caller.
|
|
58
|
-
.macro
|
|
58
|
+
.macro forward_gpr
|
|
59
59
|
ld a7, 120(a1)
|
|
60
60
|
ld a6, 112(a1)
|
|
61
61
|
ld a5, 104(a1)
|
|
@@ -80,57 +80,57 @@
|
|
|
80
80
|
|
|
81
81
|
ForwardCallGG:
|
|
82
82
|
prologue
|
|
83
|
-
|
|
83
|
+
forward_gpr
|
|
84
84
|
epilogue
|
|
85
85
|
|
|
86
86
|
ForwardCallF:
|
|
87
87
|
prologue
|
|
88
|
-
|
|
88
|
+
forward_gpr
|
|
89
89
|
epilogue
|
|
90
90
|
|
|
91
91
|
ForwardCallDG:
|
|
92
92
|
prologue
|
|
93
|
-
|
|
93
|
+
forward_gpr
|
|
94
94
|
epilogue
|
|
95
95
|
|
|
96
96
|
ForwardCallGD:
|
|
97
97
|
prologue
|
|
98
|
-
|
|
98
|
+
forward_gpr
|
|
99
99
|
epilogue
|
|
100
100
|
|
|
101
101
|
ForwardCallDD:
|
|
102
102
|
prologue
|
|
103
|
-
|
|
103
|
+
forward_gpr
|
|
104
104
|
epilogue
|
|
105
105
|
|
|
106
106
|
ForwardCallXGG:
|
|
107
107
|
prologue
|
|
108
108
|
forward_vec
|
|
109
|
-
|
|
109
|
+
forward_gpr
|
|
110
110
|
epilogue
|
|
111
111
|
|
|
112
112
|
ForwardCallXF:
|
|
113
113
|
prologue
|
|
114
114
|
forward_vec
|
|
115
|
-
|
|
115
|
+
forward_gpr
|
|
116
116
|
epilogue
|
|
117
117
|
|
|
118
118
|
ForwardCallXDG:
|
|
119
119
|
prologue
|
|
120
120
|
forward_vec
|
|
121
|
-
|
|
121
|
+
forward_gpr
|
|
122
122
|
epilogue
|
|
123
123
|
|
|
124
124
|
ForwardCallXGD:
|
|
125
125
|
prologue
|
|
126
126
|
forward_vec
|
|
127
|
-
|
|
127
|
+
forward_gpr
|
|
128
128
|
epilogue
|
|
129
129
|
|
|
130
130
|
ForwardCallXDD:
|
|
131
131
|
prologue
|
|
132
132
|
forward_vec
|
|
133
|
-
|
|
133
|
+
forward_gpr
|
|
134
134
|
epilogue
|
|
135
135
|
|
|
136
136
|
# Callback trampolines
|
package/src/abi_x64_sysv.cc
CHANGED
|
@@ -527,8 +527,15 @@ Napi::Value CallData::Complete()
|
|
|
527
527
|
|
|
528
528
|
void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegisters *out_reg)
|
|
529
529
|
{
|
|
530
|
-
const
|
|
531
|
-
|
|
530
|
+
const TrampolineInfo &trampoline = instance->trampolines[idx];
|
|
531
|
+
|
|
532
|
+
if (RG_UNLIKELY(trampoline.generation != mem->generation)) {
|
|
533
|
+
ThrowError<Napi::Error>(env, "Cannot use non-persistent callback beyond FFI call");
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
const FunctionInfo *proto = trampoline.proto;
|
|
538
|
+
Napi::Function func = trampoline.func.Value();
|
|
532
539
|
|
|
533
540
|
uint64_t *gpr_ptr = (uint64_t *)own_sp;
|
|
534
541
|
uint64_t *xmm_ptr = gpr_ptr + 6;
|