#ifndef FX_REFLECTION_DARWIN_ARM64_CALLVM_H_ #define FX_REFLECTION_DARWIN_ARM64_CALLVM_H_ #include #include #include #define MAX_FIXED_ARGS ((unsigned int)-1) #define MAX_DOUBLE_ARGS 8 #define MAX_INT_ARGS 8 /* dyn-dispatch.S depends on the layout of this struct */ struct callvm { uint64_t vm_arg_int_count; uint64_t vm_arg_double_count; /* any args pushed after this limit is reached will be stored in the * excess buffer. used for calling varargs functions */ uint64_t vm_arg_count, vm_arg_fixed; uint64_t vm_arg_excess_count; uint64_t vm_arg_excess_max; uintptr_t vm_arg_int[MAX_INT_ARGS]; double vm_arg_double[MAX_DOUBLE_ARGS]; uintptr_t *vm_arg_excess; }; extern void callvm_reset(struct callvm *vm, unsigned int max_fixed_args); extern void callvm_push(struct callvm *vm, const fx_value *value); extern fx_value callvm_invoke( struct callvm *vm, fx_function_impl impl, fx_value_type return_type); #endif