Call Agreements
Julia’s own call agreement
The proprietary calling agreement is designed for fast non-universal calls. As a rule, it uses a specialized signature.
*LLVM phantom instances (zero-length types) are omitted. *LLVM scalars and vectors are passed by value. *LLVM aggregates (arrays and structures) are passed by reference.
A small return value is returned as an LLVM return value. Large return values are returned by the "structure return" convention (sret
), where the caller provides a pointer to the return slot.
An argument or return values that are a homogeneous tuple are sometimes represented as an LLVM vector instead of an LLVM array.
JL Call Agreement
The JL Call agreement is intended for embedded modules and general dispatching. Handwritten functions using this convention are declared using the macro `JL_CALLABLE'. The agreement uses exactly three parameters:
*F
— representation in Julia of the function used *args
— pointer to an array of pointers to heaps *nargs
— length of the array.
The return value is a pointer to the heap.