Stream: git-wasmtime

Topic: wasmtime / PR #2356 machinst ABI: Support for accumulatin...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 03 2020 at 17:50):

uweigand opened PR #2356 from abi-outgoingargs to main:

When performing a function call, the platform ABI may require space
on the stack to hold outgoing arguments and/or return values.

Currently, this is supported via decrementing the stack pointer
before the call and incrementing it afterwards, using the
emit_stack_pre_adjust and emit_stack_post_adjust methods of
ABICaller. However, on some platforms it would be preferable
to just allocate enough space for any call done in the function
in the caller's prologue instead.

This patch adds support to allow back-ends to choose that method.
Instead of calling emit_stack_pre/post_adjust around a call, they
simply call a new accumulate_outgoing_args_size method of
ABICaller instead. This will pass on the required size to the
ABICallee structure of the calling function, which will accumulate
the maximum size required for all function calls.

That accumulated size is then passed to the gen_clobber_save
and gen_clobber_restore functions so they can include the size
in the stack allocation / deallocation that already happens in
the prologue / epilogue code.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 03 2020 at 18:26):

cfallin submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 03 2020 at 18:26):

cfallin merged PR #2356.


Last updated: Nov 22 2024 at 17:03 UTC