jit.h
Include dependency graph for jit.h:
This graph shows which files directly or indirectly include jit.h:
Defines
-
TYPEDEF_MODULE
-
CALL_EXT_NO_DEALLOC -1
-
CALL_EXT_NO_DEALLOC_MFA -2
-
JIT_FORMAT_VERSION 1
-
JIT_ARCH_X86_64 1
-
JIT_ARCH_AARCH64 2
-
JIT_ARCH_ARMV6M 3
-
JIT_ARCH_RISCV32 4
-
JIT_ARCH_RISCV64 5
-
JIT_ARCH_ARM32 6
-
JIT_VARIANT_PIC 1
-
JIT_VARIANT_FLOAT32 2
-
JIT_VARIANT_THUMB2 4
Typedefs
-
typedef Context *(*ModuleNativeEntryPoint)(Context *ctx, JITState *jit_state, const ModuleNativeInterface *p)
Enums
Functions
-
ModuleNativeEntryPoint jit_stream_entry_point(Context *ctx, term jit_stream)
Return the entry point from a given jit stream.
Platform implementing JIT must provide this function which is called by code_server:set_native_code/2
- Parameters:
ctx – the current context (code_server)
jit_stream – the jit stream term
- Returns:
the pointer to the first function
-
enum TrapAndLoadResult jit_trap_and_load(Context *ctx, Module *mod, uint32_t label)
Trap a process and load module, process shall be resumed at given label.
- Parameters:
ctx – the process to trap
mod – the module to load
label – the label to resume the process to
-
void jit_debug_register_code(Module *mod, const void *native_code, size_t native_size, ModuleNativeEntryPoint entry_point)
Register JIT-compiled code with debug info with GDB/LLDB.
This function registers native code and associated DWARF debug information with the debugger using the GDB JIT interface. This allows debuggers to show function names and source line information for JIT code.
- Parameters:
mod – The module containing the JIT code
native_code – Pointer to the native machine code
native_size – Size of the native code in bytes
entry_point – The actual mapped entry point address
Variables
-
const ModuleNativeInterface module_native_interface
-
struct JITState
- #include <jit.h>
Collaboration diagram for JITState:
-
struct ModuleNativeInterface
- #include <jit.h>
Collaboration diagram for ModuleNativeInterface:
Public Members
-
Context *(*call_ext)(Context *ctx, JITState *jit_state, int offset, int arity, int index, int n_words)
-
bool (*allocate)(Context *ctx, JITState *jit_state, uint32_t stack_need, uint32_t heap_need, uint32_t live)
-
TermCompareResult (*term_compare)(Context *ctx, JITState *jit_state, term t, term other, TermCompareOpts opts)
-
Context *(*raise_error_tuple)(Context *ctx, JITState *jit_state, int offset, term error_atom, term arg1)
-
Context *(*call_fun)(Context *ctx, JITState *jit_state, int offset, term fun, unsigned int args_count)
-
bool (*term_is_number)(term t)
-
bool (*memory_ensure_free_with_roots)(Context *ctx, JITState *jit_state, int sz, int live, int flags)
-
term (*bitstring_extract_integer)(Context *ctx, JITState *jit_state, term *bin_ptr, size_t offset, int n, int bs_flags)
-
size_t (*term_sub_binary_heap_size)(term *bin_ptr, size_t size)
-
int (*bitstring_utf8_size)(int c)
-
int (*bitstring_utf16_size)(int c)
-
int (*bitstring_insert_utf8)(term bin, size_t offset, int c)
-
int (*bitstring_insert_utf16)(term bin, size_t offset, int c, enum BitstringFlags flags)
-
bool (*bitstring_insert_utf32)(term bin, size_t offset, uint32_t c, enum BitstringFlags flags)
-
bool (*bitstring_insert_integer)(term bin, size_t offset, term value, size_t n, enum BitstringFlags flags)
-
void (*bitstring_copy_module_str)(Context *ctx, JITState *jit_state, term bin, size_t offset, int str_id, size_t len)
-
int (*bitstring_copy_binary)(Context *ctx, JITState *jit_state, term t, size_t offset, term src, term size)
-
Context *(*apply)(Context *ctx, JITState *jit_state, int offset, term module, term function, unsigned int arity)
-
void (*free)(void *ptr)
-
term (*put_map_assoc)(Context *ctx, JITState *jit_state, term src, size_t new_entries, size_t num_elements, term *kv)
-
bool (*bitstring_match_module_str)(Context *ctx, JITState *jit_state, term bin, size_t offset, int str_id, size_t len)
-
term (*bitstring_get_utf8)(term src)
-
term (*bitstring_get_utf16)(term src, int flags_value)
-
term (*bitstring_get_utf32)(term src, int flags_value)
-
bool (*bitstring_insert_float)(term bin, size_t offset, term value, size_t n, enum BitstringFlags flags)
-
Context *(*call_ext)(Context *ctx, JITState *jit_state, int offset, int arity, int index, int n_words)