@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,203 +0,0 @@
|
|
|
1
|
-
# SPDX-License-Identifier: MIT
|
|
2
|
-
# SPDX-FileCopyrightText: 2025 Niels Martignène <niels.martignene@protonmail.com>
|
|
3
|
-
|
|
4
|
-
#define SYMBOL(Symbol) Symbol
|
|
5
|
-
|
|
6
|
-
# Forward
|
|
7
|
-
# ----------------------------
|
|
8
|
-
|
|
9
|
-
# These three are the same, but they differ (in the C side) by their return type.
|
|
10
|
-
# Unlike the three next functions, these ones don't forward FA argument registers.
|
|
11
|
-
.global ForwardCallGG
|
|
12
|
-
.global ForwardCallF
|
|
13
|
-
.global ForwardCallDG
|
|
14
|
-
.global ForwardCallGD
|
|
15
|
-
.global ForwardCallDD
|
|
16
|
-
|
|
17
|
-
# The X variants are slightly slower, and are used when FA arguments must be forwarded.
|
|
18
|
-
.global ForwardCallXGG
|
|
19
|
-
.global ForwardCallXF
|
|
20
|
-
.global ForwardCallXDG
|
|
21
|
-
.global ForwardCallXGD
|
|
22
|
-
.global ForwardCallXDD
|
|
23
|
-
|
|
24
|
-
# Copy function pointer to t0, in order to save it through argument forwarding.
|
|
25
|
-
# Also make a copy of the SP to CallData::old_sp because the callback system might need it.
|
|
26
|
-
# Save SP in s1, and use carefully assembled stack provided by caller.
|
|
27
|
-
.macro prologue
|
|
28
|
-
addi sp, sp, -16
|
|
29
|
-
mv t0, a0
|
|
30
|
-
sd ra, 0(sp)
|
|
31
|
-
sd s1, 8(sp)
|
|
32
|
-
mv s1, sp
|
|
33
|
-
sd sp, 0(a2)
|
|
34
|
-
addi sp, a1, 128
|
|
35
|
-
.endm
|
|
36
|
-
|
|
37
|
-
# Call native function.
|
|
38
|
-
# Once done, restore normal stack pointer and return.
|
|
39
|
-
# The return value is passed untouched through registers.
|
|
40
|
-
.macro epilogue
|
|
41
|
-
jalr t0
|
|
42
|
-
mv sp, s1
|
|
43
|
-
ld ra, 0(sp)
|
|
44
|
-
ld s1, 8(sp)
|
|
45
|
-
addi sp, sp, 16
|
|
46
|
-
ret
|
|
47
|
-
.endm
|
|
48
|
-
|
|
49
|
-
# Prepare general purpose argument registers from array passed by caller.
|
|
50
|
-
.macro forward_gpr
|
|
51
|
-
ld a7, 120(a1)
|
|
52
|
-
ld a6, 112(a1)
|
|
53
|
-
ld a5, 104(a1)
|
|
54
|
-
ld a4, 96(a1)
|
|
55
|
-
ld a3, 88(a1)
|
|
56
|
-
ld a2, 80(a1)
|
|
57
|
-
ld a0, 64(a1)
|
|
58
|
-
ld a1, 72(a1)
|
|
59
|
-
.endm
|
|
60
|
-
|
|
61
|
-
# Prepare vector argument registers from array passed by caller.
|
|
62
|
-
.macro forward_vec
|
|
63
|
-
fld fa7, 56(a1)
|
|
64
|
-
fld fa6, 48(a1)
|
|
65
|
-
fld fa5, 40(a1)
|
|
66
|
-
fld fa4, 32(a1)
|
|
67
|
-
fld fa3, 24(a1)
|
|
68
|
-
fld fa2, 16(a1)
|
|
69
|
-
fld fa1, 8(a1)
|
|
70
|
-
fld fa0, 0(a1)
|
|
71
|
-
.endm
|
|
72
|
-
|
|
73
|
-
ForwardCallGG:
|
|
74
|
-
prologue
|
|
75
|
-
forward_gpr
|
|
76
|
-
epilogue
|
|
77
|
-
|
|
78
|
-
ForwardCallF:
|
|
79
|
-
prologue
|
|
80
|
-
forward_gpr
|
|
81
|
-
epilogue
|
|
82
|
-
|
|
83
|
-
ForwardCallDG:
|
|
84
|
-
prologue
|
|
85
|
-
forward_gpr
|
|
86
|
-
epilogue
|
|
87
|
-
|
|
88
|
-
ForwardCallGD:
|
|
89
|
-
prologue
|
|
90
|
-
forward_gpr
|
|
91
|
-
epilogue
|
|
92
|
-
|
|
93
|
-
ForwardCallDD:
|
|
94
|
-
prologue
|
|
95
|
-
forward_gpr
|
|
96
|
-
epilogue
|
|
97
|
-
|
|
98
|
-
ForwardCallXGG:
|
|
99
|
-
prologue
|
|
100
|
-
forward_vec
|
|
101
|
-
forward_gpr
|
|
102
|
-
epilogue
|
|
103
|
-
|
|
104
|
-
ForwardCallXF:
|
|
105
|
-
prologue
|
|
106
|
-
forward_vec
|
|
107
|
-
forward_gpr
|
|
108
|
-
epilogue
|
|
109
|
-
|
|
110
|
-
ForwardCallXDG:
|
|
111
|
-
prologue
|
|
112
|
-
forward_vec
|
|
113
|
-
forward_gpr
|
|
114
|
-
epilogue
|
|
115
|
-
|
|
116
|
-
ForwardCallXGD:
|
|
117
|
-
prologue
|
|
118
|
-
forward_vec
|
|
119
|
-
forward_gpr
|
|
120
|
-
epilogue
|
|
121
|
-
|
|
122
|
-
ForwardCallXDD:
|
|
123
|
-
prologue
|
|
124
|
-
forward_vec
|
|
125
|
-
forward_gpr
|
|
126
|
-
epilogue
|
|
127
|
-
|
|
128
|
-
# Callbacks
|
|
129
|
-
# ----------------------------
|
|
130
|
-
|
|
131
|
-
.global RelayCallback
|
|
132
|
-
.global SwitchAndRelay
|
|
133
|
-
.global RelayDirect
|
|
134
|
-
.global TrampolineEnd
|
|
135
|
-
|
|
136
|
-
# First, make a copy of argument registers.
|
|
137
|
-
# Then call the C function RelayCallback with the following arguments:
|
|
138
|
-
# static trampoline ID, a pointer to the saved GPR array, a pointer to the stack
|
|
139
|
-
# arguments of this call, and a pointer to a struct that will contain the result registers.
|
|
140
|
-
# After the call, simply load these registers from the output struct.
|
|
141
|
-
.macro trampoline id
|
|
142
|
-
li t0, \id
|
|
143
|
-
j RelayTrampoline
|
|
144
|
-
.balign 16
|
|
145
|
-
.endm
|
|
146
|
-
|
|
147
|
-
RelayTrampoline:
|
|
148
|
-
addi sp, sp, -176
|
|
149
|
-
sd ra, 0(sp)
|
|
150
|
-
sd a0, 8(sp)
|
|
151
|
-
sd a1, 16(sp)
|
|
152
|
-
sd a2, 24(sp)
|
|
153
|
-
sd a3, 32(sp)
|
|
154
|
-
sd a4, 40(sp)
|
|
155
|
-
sd a5, 48(sp)
|
|
156
|
-
sd a6, 56(sp)
|
|
157
|
-
sd a7, 64(sp)
|
|
158
|
-
fsd fa0, 72(sp)
|
|
159
|
-
fsd fa1, 80(sp)
|
|
160
|
-
fsd fa2, 88(sp)
|
|
161
|
-
fsd fa3, 96(sp)
|
|
162
|
-
fsd fa4, 104(sp)
|
|
163
|
-
fsd fa5, 112(sp)
|
|
164
|
-
fsd fa6, 120(sp)
|
|
165
|
-
fsd fa7, 128(sp)
|
|
166
|
-
mv a0, t0
|
|
167
|
-
addi a1, sp, 8
|
|
168
|
-
call RelayCallback
|
|
169
|
-
ld ra, 0(sp)
|
|
170
|
-
ld a0, 136(sp)
|
|
171
|
-
ld a1, 144(sp)
|
|
172
|
-
fld fa0, 152(sp)
|
|
173
|
-
fld fa1, 160(sp)
|
|
174
|
-
addi sp, sp, 176
|
|
175
|
-
ret
|
|
176
|
-
|
|
177
|
-
# When a callback is relayed, Koffi will call into Node.js and V8 to execute Javascript.
|
|
178
|
-
# The problem is that we're still running on the separate Koffi stack, and V8 will
|
|
179
|
-
# probably misdetect this as a "stack overflow". We have to restore the old
|
|
180
|
-
# stack pointer, call Node.js/V8 and go back to ours.
|
|
181
|
-
# The first three parameters (a0, a1, a2) are passed through untouched.
|
|
182
|
-
SwitchAndRelay:
|
|
183
|
-
addi sp, sp, -16
|
|
184
|
-
sd ra, 0(sp)
|
|
185
|
-
sd s1, 8(sp)
|
|
186
|
-
mv s1, sp
|
|
187
|
-
ld t0, 0(a4)
|
|
188
|
-
sub t0, sp, t0
|
|
189
|
-
andi t0, t0, -16
|
|
190
|
-
sd t0, 8(a4)
|
|
191
|
-
mv sp, a3
|
|
192
|
-
call RelayDirect
|
|
193
|
-
mv sp, s1
|
|
194
|
-
ld ra, 0(sp)
|
|
195
|
-
ld s1, 8(sp)
|
|
196
|
-
addi sp, sp, 16
|
|
197
|
-
ret
|
|
198
|
-
|
|
199
|
-
.balign 16
|
|
200
|
-
#include "gnu.inc"
|
|
201
|
-
|
|
202
|
-
TrampolineEnd:
|
|
203
|
-
ret
|