|
infix
A JIT-Powered FFI Library for C
|
Defines the ABI-specific implementation interface for reverse trampolines. More...
#include <infix_internals.h>
Public Attributes | |
| infix_status(* | prepare_reverse_call_frame )(infix_arena_t *arena, infix_reverse_call_frame_layout **out_layout, infix_reverse_t *context) |
| Analyzes a function signature to create a layout for the reverse call stub's stack frame. | |
| infix_status(* | generate_reverse_prologue )(code_buffer *buf, infix_reverse_call_frame_layout *layout) |
| Generates the reverse stub's prologue (stack setup). | |
| infix_status(* | generate_reverse_argument_marshalling )(code_buffer *buf, infix_reverse_call_frame_layout *layout, infix_reverse_t *context) |
Generates code to marshal arguments from their native locations (registers/stack) into a void** array. | |
| infix_status(* | generate_reverse_dispatcher_call )(code_buffer *buf, infix_reverse_call_frame_layout *layout, infix_reverse_t *context) |
Generates the call to the universal C dispatcher (infix_internal_dispatch_callback_fn_impl). | |
| infix_status(* | generate_reverse_epilogue )(code_buffer *buf, infix_reverse_call_frame_layout *layout, infix_reverse_t *context) |
| Generates the reverse stub's epilogue (handling return value, restoring stack, returning). | |
Defines the ABI-specific implementation interface for reverse trampolines.
This v-table defines the contract for generating the JIT stub for a reverse call (callback). The stub's primary job is to receive arguments in native ABI format, marshal them into a generic void** array, and call the universal C dispatcher.
| infix_status(* infix_reverse_abi_spec::generate_reverse_argument_marshalling) (code_buffer *buf, infix_reverse_call_frame_layout *layout, infix_reverse_t *context) |
Generates code to marshal arguments from their native locations (registers/stack) into a void** array.
| [in,out] | buf | The code buffer. |
| [in] | layout | The layout blueprint. |
| [in] | context | The reverse context. |
INFIX_SUCCESS on success. | infix_status(* infix_reverse_abi_spec::generate_reverse_dispatcher_call) (code_buffer *buf, infix_reverse_call_frame_layout *layout, infix_reverse_t *context) |
Generates the call to the universal C dispatcher (infix_internal_dispatch_callback_fn_impl).
| [in,out] | buf | The code buffer. |
| [in] | layout | The layout blueprint. |
| [in] | context | The reverse context. |
INFIX_SUCCESS on success. | infix_status(* infix_reverse_abi_spec::generate_reverse_epilogue) (code_buffer *buf, infix_reverse_call_frame_layout *layout, infix_reverse_t *context) |
Generates the reverse stub's epilogue (handling return value, restoring stack, returning).
| [in,out] | buf | The code buffer. |
| [in] | layout | The layout blueprint. |
| [in] | context | The reverse context. |
INFIX_SUCCESS on success. | infix_status(* infix_reverse_abi_spec::generate_reverse_prologue) (code_buffer *buf, infix_reverse_call_frame_layout *layout) |
Generates the reverse stub's prologue (stack setup).
| [in,out] | buf | The code buffer. |
| [in] | layout | The layout blueprint. |
INFIX_SUCCESS on success. | infix_status(* infix_reverse_abi_spec::prepare_reverse_call_frame) (infix_arena_t *arena, infix_reverse_call_frame_layout **out_layout, infix_reverse_t *context) |
Analyzes a function signature to create a layout for the reverse call stub's stack frame.
| [in] | arena | The temporary arena for allocations. |
| [out] | out_layout | Receives the newly created layout blueprint. |
| [in] | context | The reverse trampoline context, containing all type info. |
INFIX_SUCCESS on success.