You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This ABI is intended for use in scenarios where we want a very
lightweight callsite that can be turned on and off by patching in one
instruction. (The actual patchable call instruction is not in this PR;
that will be a separate PR.)
The idea is that we define a call to clobber *no* registers -- not
even the arguments! And we restrict signatures such that on all of our
supported architectures, all arguments go into registers only. Those
two requirements together mean that all callsites for this ABI should
have only a raw call instruction, with no loads/stores to stackslots;
and have the minimum possible impact on regalloc, by only imposing
constraints on args to ensure they are in certain registers but not
altering those registers.
Given this, we could implement, e.g., breakpoints with patchable
callsites (off by default) at every sequence point in compiled
code. In a typical use-case with Wasmtime-compiled Wasm, that would
put a bunch of uses of vmctx constrained to the first argument
register in every code path, but vmctx likely already sits there most
of the time anyway (for any call to other Wasm functions or for
libcalls). Thus, the impact is just the one instruction and nothing
else.
This PR adds the calling convention itself and tests that show
that *two* consecutive callsites can be compiled with no register
setup re-occurring from one call to the next (thus demonstrating no
clobbers).
0 commit comments