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 changes the managed ABI in the following ways:
1) The PI transition frames becomes simply the shadow stack top. This
"frame" is zero-sized - we don't store the current thread in it,
since the WASM TLS model allows us to elide it.
The obvious benefit from this is that the PI path is now almost
100% optimal: two stores and one load. We can get rid of the load
in an ST build as well, but that's left for a future change.
2) The RPI transition frame is now always allocated at a zero offset
and returned directly from the RPI helper. We thus elide the intermediate
state where we already have the shadow stack, but haven't yet attached
the thread. This brings us in line with other targets.
3) The sparse virtual unwind frame is now allocated right after
the RPI frame, and "combined" RPI helpers introduced that both
effect the transition and push the EH frame.
The RPI changes reduce the number of helper calls that any RPI method
needs to make from 3 to 1 (for epilogs - 2 to 1) in the sparse virtual
unwinding model, and reduce the number of intructions on the critical
path.
Benchmarks:
Node base:
Bench_PInvoke took : 86 ms (8.64 ns / op)
Bench_ReversePInvoke_Empty took : 113 ms (11.30 ns / op)
Bench_ReversePInvoke_WithEH took : 172 ms (17.24 ns / op)
Node diff:
Bench_PInvoke took : 81 ms (8.06 ns / op)
Bench_ReversePInvoke_Empty took : 58 ms (5.81 ns / op)
Bench_ReversePInvoke_WithEH took : 108 ms (10.79 ns / op)
Wasmtime base:
Bench_PInvoke took : 99 ms (9.86 ns / op)
Bench_ReversePInvoke_Empty took : 73 ms (7.28 ns / op)
Bench_ReversePInvoke_WithEH took : 77 ms (7.71 ns / op)
Wasmtime diff:
Bench_PInvoke took : 82 ms (8.16 ns / op)
Bench_ReversePInvoke_Empty took : 31 ms (3.06 ns / op)
Bench_ReversePInvoke_WithEH took : 50 ms (4.98 ns / op)
0 commit comments