@psnext/slingcli 2.4.20260526-1 → 2.4.20260527-2
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/bin/sling.js +4 -1
- package/node_modules/@aws-sdk/core/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +12 -6
- package/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js +12 -6
- package/node_modules/@aws-sdk/credential-provider-http/package.json +3 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +1 -2
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +18 -24
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/cli.js +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +73 -58
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +8 -22
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +60 -40
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +55 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +45 -69
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +5 -2
- package/node_modules/@earendil-works/pi-ai/package.json +4 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +2 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +18 -12
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +8 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +2 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +18 -24
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/index.js +8 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.js +6 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +12 -29
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +5 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.js +52 -22
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +63 -36
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js +6 -20
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +38 -31
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +9 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +32 -24
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +6 -13
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +8 -22
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +54 -53
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.js +8 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +44 -81
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.js +27 -12
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +2 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +5 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js +9 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js +39 -21
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +9 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/truncate.js +12 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +20 -35
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +5 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +14 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +29 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +37 -28
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +64 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +15 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.js +14 -8
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +124 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +31 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +75 -115
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/paths.js +33 -7
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +13 -26
- package/node_modules/@earendil-works/pi-coding-agent/package.json +6 -6
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +40 -55
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +2 -2
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +12 -2
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +53 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +4 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +38 -16
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +19 -12
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/package.json +3 -5
- package/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/package.json +6 -6
- package/slingshot/index.js +246 -244
- package/node_modules/koffi/CHANGELOG.md +0 -1093
- package/node_modules/koffi/LICENSE.txt +0 -22
- package/node_modules/koffi/README.md +0 -43
- package/node_modules/koffi/build/koffi/darwin_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/darwin_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/freebsd_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/freebsd_ia32/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/freebsd_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_armhf/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_ia32/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_loong64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_riscv64d/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/linux_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/musl_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/musl_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/openbsd_ia32/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/openbsd_x64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/win32_arm64/koffi.exp +0 -0
- package/node_modules/koffi/build/koffi/win32_arm64/koffi.lib +0 -0
- package/node_modules/koffi/build/koffi/win32_arm64/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/win32_ia32/koffi.exp +0 -0
- package/node_modules/koffi/build/koffi/win32_ia32/koffi.lib +0 -0
- package/node_modules/koffi/build/koffi/win32_ia32/koffi.node +0 -0
- package/node_modules/koffi/build/koffi/win32_x64/koffi.exp +0 -0
- package/node_modules/koffi/build/koffi/win32_x64/koffi.lib +0 -0
- package/node_modules/koffi/build/koffi/win32_x64/koffi.node +0 -0
- package/node_modules/koffi/doc/benchmarks.md +0 -126
- package/node_modules/koffi/doc/callbacks.md +0 -210
- package/node_modules/koffi/doc/contribute.md +0 -148
- package/node_modules/koffi/doc/functions.md +0 -250
- package/node_modules/koffi/doc/index.md +0 -61
- package/node_modules/koffi/doc/input.md +0 -471
- package/node_modules/koffi/doc/migration.md +0 -159
- package/node_modules/koffi/doc/misc.md +0 -180
- package/node_modules/koffi/doc/output.md +0 -305
- package/node_modules/koffi/doc/packaging.md +0 -88
- package/node_modules/koffi/doc/platforms.md +0 -36
- package/node_modules/koffi/doc/pointers.md +0 -328
- package/node_modules/koffi/doc/start.md +0 -118
- package/node_modules/koffi/doc/unions.md +0 -186
- package/node_modules/koffi/doc/variables.md +0 -102
- package/node_modules/koffi/index.d.ts +0 -288
- package/node_modules/koffi/index.js +0 -634
- package/node_modules/koffi/indirect.js +0 -533
- package/node_modules/koffi/lib/native/base/base.cc +0 -11015
- package/node_modules/koffi/lib/native/base/base.hh +0 -6003
- package/node_modules/koffi/lib/native/base/crc.inc +0 -2214
- package/node_modules/koffi/lib/native/base/crc_gen.py +0 -72
- package/node_modules/koffi/lib/native/base/mimetypes.inc +0 -1248
- package/node_modules/koffi/lib/native/base/mimetypes_gen.py +0 -58
- package/node_modules/koffi/lib/native/base/tower.cc +0 -821
- package/node_modules/koffi/lib/native/base/tower.hh +0 -81
- package/node_modules/koffi/lib/native/base/unicode.inc +0 -408
- package/node_modules/koffi/lib/native/base/unicode_gen.py +0 -152
- package/node_modules/koffi/package.json +0 -38
- package/node_modules/koffi/src/cnoke/LICENSE.txt +0 -22
- package/node_modules/koffi/src/cnoke/README.md +0 -99
- package/node_modules/koffi/src/cnoke/assets/FindCNoke.cmake +0 -127
- package/node_modules/koffi/src/cnoke/assets/toolchains.json +0 -126
- package/node_modules/koffi/src/cnoke/assets/win_delay_hook.c +0 -36
- package/node_modules/koffi/src/cnoke/cnoke.js +0 -170
- package/node_modules/koffi/src/cnoke/package.json +0 -24
- package/node_modules/koffi/src/cnoke/src/builder.js +0 -511
- package/node_modules/koffi/src/cnoke/src/index.js +0 -10
- package/node_modules/koffi/src/cnoke/src/tools.js +0 -407
- package/node_modules/koffi/src/koffi/CMakeLists.txt +0 -182
- package/node_modules/koffi/src/koffi/src/abi_arm32.cc +0 -1018
- package/node_modules/koffi/src/koffi/src/abi_arm32_asm.S +0 -169
- package/node_modules/koffi/src/koffi/src/abi_arm64.cc +0 -1295
- package/node_modules/koffi/src/koffi/src/abi_arm64_asm.S +0 -195
- package/node_modules/koffi/src/koffi/src/abi_arm64_asm.asm +0 -174
- package/node_modules/koffi/src/koffi/src/abi_loong64.cc +0 -5
- package/node_modules/koffi/src/koffi/src/abi_loong64_asm.S +0 -204
- package/node_modules/koffi/src/koffi/src/abi_riscv64.cc +0 -915
- package/node_modules/koffi/src/koffi/src/abi_riscv64_asm.S +0 -203
- package/node_modules/koffi/src/koffi/src/abi_x64_sysv.cc +0 -939
- package/node_modules/koffi/src/koffi/src/abi_x64_sysv_asm.S +0 -231
- package/node_modules/koffi/src/koffi/src/abi_x64_win.cc +0 -715
- package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.S +0 -166
- package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.asm +0 -192
- package/node_modules/koffi/src/koffi/src/abi_x86.cc +0 -860
- package/node_modules/koffi/src/koffi/src/abi_x86_asm.S +0 -193
- package/node_modules/koffi/src/koffi/src/abi_x86_asm.asm +0 -177
- package/node_modules/koffi/src/koffi/src/call.cc +0 -1326
- package/node_modules/koffi/src/koffi/src/call.hh +0 -179
- package/node_modules/koffi/src/koffi/src/errno.inc +0 -462
- package/node_modules/koffi/src/koffi/src/ffi.cc +0 -2702
- package/node_modules/koffi/src/koffi/src/ffi.hh +0 -354
- package/node_modules/koffi/src/koffi/src/init.js +0 -105
- package/node_modules/koffi/src/koffi/src/parser.cc +0 -220
- package/node_modules/koffi/src/koffi/src/parser.hh +0 -54
- package/node_modules/koffi/src/koffi/src/util.cc +0 -1807
- package/node_modules/koffi/src/koffi/src/util.hh +0 -221
- package/node_modules/koffi/src/koffi/src/uv.cc +0 -193
- package/node_modules/koffi/src/koffi/src/uv.def +0 -10
- package/node_modules/koffi/src/koffi/src/uv.hh +0 -40
- package/node_modules/koffi/src/koffi/src/win32.cc +0 -198
- package/node_modules/koffi/src/koffi/src/win32.hh +0 -119
- package/node_modules/koffi/src/koffi/tools/write_trampolines.js +0 -77
- package/node_modules/koffi/vendor/node-addon-api/LICENSE.md +0 -9
- package/node_modules/koffi/vendor/node-addon-api/README.md +0 -95
- package/node_modules/koffi/vendor/node-addon-api/napi-inl.deprecated.h +0 -186
- package/node_modules/koffi/vendor/node-addon-api/napi-inl.h +0 -7033
- package/node_modules/koffi/vendor/node-addon-api/napi.h +0 -3309
- package/node_modules/koffi/vendor/node-api-headers/LICENSE +0 -21
- package/node_modules/koffi/vendor/node-api-headers/README.md +0 -95
- package/node_modules/koffi/vendor/node-api-headers/def/js_native_api.def +0 -125
- package/node_modules/koffi/vendor/node-api-headers/def/node_api.def +0 -157
- package/node_modules/koffi/vendor/node-api-headers/include/js_native_api.h +0 -591
- package/node_modules/koffi/vendor/node-api-headers/include/js_native_api_types.h +0 -210
- package/node_modules/koffi/vendor/node-api-headers/include/node_api.h +0 -265
- package/node_modules/koffi/vendor/node-api-headers/include/node_api_types.h +0 -58
- package/node_modules/koffi/vendor/node-api-headers/include/uv/aix.h +0 -32
- package/node_modules/koffi/vendor/node-api-headers/include/uv/bsd.h +0 -34
- package/node_modules/koffi/vendor/node-api-headers/include/uv/darwin.h +0 -61
- package/node_modules/koffi/vendor/node-api-headers/include/uv/errno.h +0 -483
- package/node_modules/koffi/vendor/node-api-headers/include/uv/linux.h +0 -34
- package/node_modules/koffi/vendor/node-api-headers/include/uv/os390.h +0 -33
- package/node_modules/koffi/vendor/node-api-headers/include/uv/posix.h +0 -31
- package/node_modules/koffi/vendor/node-api-headers/include/uv/sunos.h +0 -44
- package/node_modules/koffi/vendor/node-api-headers/include/uv/threadpool.h +0 -37
- package/node_modules/koffi/vendor/node-api-headers/include/uv/tree.h +0 -521
- package/node_modules/koffi/vendor/node-api-headers/include/uv/unix.h +0 -512
- package/node_modules/koffi/vendor/node-api-headers/include/uv/version.h +0 -43
- package/node_modules/koffi/vendor/node-api-headers/include/uv/win.h +0 -698
- package/node_modules/koffi/vendor/node-api-headers/include/uv.h +0 -1990
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
# SPDX-License-Identifier: MIT
|
|
2
|
-
# SPDX-FileCopyrightText: 2025 Niels Martignène <niels.martignene@protonmail.com>
|
|
3
|
-
|
|
4
|
-
#if defined(__APPLE__)
|
|
5
|
-
#define SYMBOL(Symbol) _ ## Symbol
|
|
6
|
-
#else
|
|
7
|
-
#define SYMBOL(Symbol) Symbol
|
|
8
|
-
#endif
|
|
9
|
-
|
|
10
|
-
# Forward
|
|
11
|
-
# ----------------------------
|
|
12
|
-
|
|
13
|
-
# These five are the same, but they differ (in the C side) by their return type.
|
|
14
|
-
# Unlike the five next functions, these ones don't forward XMM argument registers.
|
|
15
|
-
.global SYMBOL(ForwardCallGG)
|
|
16
|
-
.global SYMBOL(ForwardCallF)
|
|
17
|
-
.global SYMBOL(ForwardCallDG)
|
|
18
|
-
.global SYMBOL(ForwardCallGD)
|
|
19
|
-
.global SYMBOL(ForwardCallDD)
|
|
20
|
-
|
|
21
|
-
# The X variants are slightly slower, and are used when XMM arguments must be forwarded.
|
|
22
|
-
.global SYMBOL(ForwardCallXGG)
|
|
23
|
-
.global SYMBOL(ForwardCallXF)
|
|
24
|
-
.global SYMBOL(ForwardCallXDG)
|
|
25
|
-
.global SYMBOL(ForwardCallXGD)
|
|
26
|
-
.global SYMBOL(ForwardCallXDD)
|
|
27
|
-
|
|
28
|
-
#define ENDBR64 .byte 0xf3, 0x0f, 0x1e, 0xfa
|
|
29
|
-
|
|
30
|
-
# Copy function pointer to R11, in order to save it through argument forwarding.
|
|
31
|
-
# Also make a copy of the SP to CallData::old_sp because the callback system might need it.
|
|
32
|
-
# Save RSP in RBX (non-volatile), and use carefully assembled stack provided by caller.
|
|
33
|
-
.macro prologue
|
|
34
|
-
.cfi_startproc
|
|
35
|
-
.cfi_def_cfa rsp, 8
|
|
36
|
-
ENDBR64
|
|
37
|
-
movq %rdi, %r11
|
|
38
|
-
pushq %rbp
|
|
39
|
-
.cfi_def_cfa rsp, 16
|
|
40
|
-
movq %rsp, (%rdx)
|
|
41
|
-
movq %rsp, %rbp
|
|
42
|
-
.cfi_def_cfa rbp, 16
|
|
43
|
-
leaq 112(%rsi), %rsp
|
|
44
|
-
.endm
|
|
45
|
-
|
|
46
|
-
# Call native function.
|
|
47
|
-
# Once done, restore normal stack pointer and return.
|
|
48
|
-
# The return value is passed untouched through RAX or XMM0.
|
|
49
|
-
.macro epilogue
|
|
50
|
-
call *%r11
|
|
51
|
-
movq %rbp, %rsp
|
|
52
|
-
popq %rbp
|
|
53
|
-
.cfi_def_cfa rsp, 8
|
|
54
|
-
ret
|
|
55
|
-
.cfi_endproc
|
|
56
|
-
.endm
|
|
57
|
-
|
|
58
|
-
# Prepare integer argument registers from array passed by caller.
|
|
59
|
-
.macro forward_gpr
|
|
60
|
-
movq 40(%rsi), %r9
|
|
61
|
-
movq 32(%rsi), %r8
|
|
62
|
-
movq 24(%rsi), %rcx
|
|
63
|
-
movq 16(%rsi), %rdx
|
|
64
|
-
movq 0(%rsi), %rdi
|
|
65
|
-
movq 8(%rsi), %rsi
|
|
66
|
-
.endm
|
|
67
|
-
|
|
68
|
-
# Prepare XMM argument registers from array passed by caller.
|
|
69
|
-
.macro forward_xmm
|
|
70
|
-
movsd 104(%rsi), %xmm7
|
|
71
|
-
movsd 96(%rsi), %xmm6
|
|
72
|
-
movsd 88(%rsi), %xmm5
|
|
73
|
-
movsd 80(%rsi), %xmm4
|
|
74
|
-
movsd 72(%rsi), %xmm3
|
|
75
|
-
movsd 64(%rsi), %xmm2
|
|
76
|
-
movsd 56(%rsi), %xmm1
|
|
77
|
-
movsd 48(%rsi), %xmm0
|
|
78
|
-
.endm
|
|
79
|
-
|
|
80
|
-
SYMBOL(ForwardCallGG):
|
|
81
|
-
prologue
|
|
82
|
-
forward_gpr
|
|
83
|
-
movb $0, %al
|
|
84
|
-
epilogue
|
|
85
|
-
|
|
86
|
-
SYMBOL(ForwardCallF):
|
|
87
|
-
prologue
|
|
88
|
-
forward_gpr
|
|
89
|
-
movb $0, %al
|
|
90
|
-
epilogue
|
|
91
|
-
|
|
92
|
-
SYMBOL(ForwardCallDG):
|
|
93
|
-
prologue
|
|
94
|
-
forward_gpr
|
|
95
|
-
movb $0, %al
|
|
96
|
-
epilogue
|
|
97
|
-
|
|
98
|
-
SYMBOL(ForwardCallGD):
|
|
99
|
-
prologue
|
|
100
|
-
forward_gpr
|
|
101
|
-
movb $0, %al
|
|
102
|
-
epilogue
|
|
103
|
-
|
|
104
|
-
SYMBOL(ForwardCallDD):
|
|
105
|
-
prologue
|
|
106
|
-
forward_gpr
|
|
107
|
-
movb $0, %al
|
|
108
|
-
epilogue
|
|
109
|
-
|
|
110
|
-
SYMBOL(ForwardCallXGG):
|
|
111
|
-
prologue
|
|
112
|
-
forward_xmm
|
|
113
|
-
forward_gpr
|
|
114
|
-
movb $8, %al
|
|
115
|
-
epilogue
|
|
116
|
-
|
|
117
|
-
SYMBOL(ForwardCallXF):
|
|
118
|
-
prologue
|
|
119
|
-
forward_xmm
|
|
120
|
-
forward_gpr
|
|
121
|
-
movb $8, %al
|
|
122
|
-
epilogue
|
|
123
|
-
|
|
124
|
-
SYMBOL(ForwardCallXDG):
|
|
125
|
-
prologue
|
|
126
|
-
forward_xmm
|
|
127
|
-
forward_gpr
|
|
128
|
-
movb $8, %al
|
|
129
|
-
epilogue
|
|
130
|
-
|
|
131
|
-
SYMBOL(ForwardCallXGD):
|
|
132
|
-
prologue
|
|
133
|
-
forward_xmm
|
|
134
|
-
forward_gpr
|
|
135
|
-
movb $8, %al
|
|
136
|
-
epilogue
|
|
137
|
-
|
|
138
|
-
SYMBOL(ForwardCallXDD):
|
|
139
|
-
prologue
|
|
140
|
-
forward_xmm
|
|
141
|
-
forward_gpr
|
|
142
|
-
movb $8, %al
|
|
143
|
-
epilogue
|
|
144
|
-
|
|
145
|
-
# Callbacks
|
|
146
|
-
# ----------------------------
|
|
147
|
-
|
|
148
|
-
.global SYMBOL(RelayCallback)
|
|
149
|
-
.global SYMBOL(SwitchAndRelay)
|
|
150
|
-
.global SYMBOL(RelayDirect)
|
|
151
|
-
.global SYMBOL(TrampolineEnd)
|
|
152
|
-
|
|
153
|
-
# First, make a copy of argument registers.
|
|
154
|
-
# Then call the C function RelayCallback with the following arguments:
|
|
155
|
-
# static trampoline ID, a pointer to the saved GPR array, a pointer to the stack
|
|
156
|
-
# arguments of this call, and a pointer to a struct that will contain the result registers.
|
|
157
|
-
# After the call, simply load these registers from the output struct.
|
|
158
|
-
.macro trampoline id
|
|
159
|
-
.cfi_startproc
|
|
160
|
-
.cfi_def_cfa rsp, 8
|
|
161
|
-
ENDBR64
|
|
162
|
-
movq $\id, %rax
|
|
163
|
-
jmp RelayTrampoline
|
|
164
|
-
.cfi_endproc
|
|
165
|
-
.endm
|
|
166
|
-
|
|
167
|
-
RelayTrampoline:
|
|
168
|
-
.cfi_startproc
|
|
169
|
-
.cfi_def_cfa rsp, 8
|
|
170
|
-
subq $152, %rsp
|
|
171
|
-
.cfi_def_cfa rsp, 160
|
|
172
|
-
movq %rdi, 0(%rsp)
|
|
173
|
-
movq %rsi, 8(%rsp)
|
|
174
|
-
movq %rdx, 16(%rsp)
|
|
175
|
-
movq %rcx, 24(%rsp)
|
|
176
|
-
movq %r8, 32(%rsp)
|
|
177
|
-
movq %r9, 40(%rsp)
|
|
178
|
-
movsd %xmm0, 48(%rsp)
|
|
179
|
-
movsd %xmm1, 56(%rsp)
|
|
180
|
-
movsd %xmm2, 64(%rsp)
|
|
181
|
-
movsd %xmm3, 72(%rsp)
|
|
182
|
-
movsd %xmm4, 80(%rsp)
|
|
183
|
-
movsd %xmm5, 88(%rsp)
|
|
184
|
-
movsd %xmm6, 96(%rsp)
|
|
185
|
-
movsd %xmm7, 104(%rsp)
|
|
186
|
-
movq %rax, %rdi
|
|
187
|
-
movq %rsp, %rsi
|
|
188
|
-
#if defined(__linux__)
|
|
189
|
-
call *RelayCallback@GOTPCREL(%rip)
|
|
190
|
-
#else
|
|
191
|
-
call SYMBOL(RelayCallback)
|
|
192
|
-
#endif
|
|
193
|
-
movq 112(%rsp), %rax
|
|
194
|
-
movq 120(%rsp), %rdx
|
|
195
|
-
movsd 128(%rsp), %xmm0
|
|
196
|
-
movsd 136(%rsp), %xmm1
|
|
197
|
-
addq $152, %rsp
|
|
198
|
-
.cfi_def_cfa rsp, 8
|
|
199
|
-
ret
|
|
200
|
-
.cfi_endproc
|
|
201
|
-
|
|
202
|
-
# When a callback is relayed, Koffi will call into Node.js and V8 to execute Javascript.
|
|
203
|
-
# The problem is that we're still running on the separate Koffi stack, and V8 will
|
|
204
|
-
# probably misdetect this as a "stack overflow". We have to restore the old
|
|
205
|
-
# stack pointer, call Node.js/V8 and go back to ours.
|
|
206
|
-
# The first three parameters (rdi, rsi, rdx) are passed through untouched.
|
|
207
|
-
SYMBOL(SwitchAndRelay):
|
|
208
|
-
.cfi_startproc
|
|
209
|
-
.cfi_def_cfa rsp, 8
|
|
210
|
-
ENDBR64
|
|
211
|
-
push %rbp
|
|
212
|
-
.cfi_def_cfa rsp, 16
|
|
213
|
-
movq %rsp, %rbp
|
|
214
|
-
movq %rsp, %r10
|
|
215
|
-
subq 0(%r8), %r10
|
|
216
|
-
andq $-16, %r10
|
|
217
|
-
movq %r10, 8(%r8)
|
|
218
|
-
movq %rcx, %rsp
|
|
219
|
-
.cfi_def_cfa rsp, 16
|
|
220
|
-
call SYMBOL(RelayDirect)
|
|
221
|
-
mov %rbp, %rsp
|
|
222
|
-
.cfi_def_cfa rsp, 16
|
|
223
|
-
pop %rbp
|
|
224
|
-
.cfi_def_cfa rsp, 8
|
|
225
|
-
ret
|
|
226
|
-
.cfi_endproc
|
|
227
|
-
|
|
228
|
-
#include "gnu.inc"
|
|
229
|
-
|
|
230
|
-
SYMBOL(TrampolineEnd):
|
|
231
|
-
ret
|