MACROS

AT8U

UTF-8 Atoms table section

ATOM_STR(LENSTR, STR)

No-op macro: just syntax sugar for avoiding mistakes or clang-format dividing atoms in multiple lines. Usage: ATOM_STR(“\x5”, “hello”).

BEGIN_WITH_STACK_HEAP(size, name)
END_WITH_STACK_HEAP(name, global)
CALL_FUN(fun, args_count, next_off)
CODE

Code chunk section

CONTAINER_OF(ptr, type, member)
DECODE_ALLOCATOR_LIST(need, code_chunk, base_index, off)
DECODE_ATOM(atom, code_chunk, base_index, off)
DECODE_COMPACT_TERM(dest_term, code_chunk, base_index, off)
DECODE_DEST_REGISTER(dreg, dreg_type, code_chunk, base_index, off)
DECODE_EXTENDED_LIST_TAG(code_chunk, base_index, off)
DECODE_FLAGS_LIST(flags_value, flags, opcode)
DECODE_FP_REGISTER(freg, code_chunk, base_index, off)
DECODE_INTEGER(integer, code_chunk, base_index, off)
DECODE_LABEL(label, code_chunk, base_index, off)
DECODE_LITERAL(val, code_chunk, base_index, off)
DECODE_VALUE(val, code_chunk, base_index, off)
DECODE_XREG(reg, code_chunk, base_index, off)
DECODE_YREG(reg, code_chunk, base_index, off)
END_WITH_STACK_HEAP(name, global)
ENDIAN_SWAP_32(value)
EXPT

Exported functions table section

FUNT

Funs table section

GET_LIST_ENTRY(list_item, type, list_head_member)

gets a pointer to the struct that contains a certain list head

This macro should be used to retrieve a pointer to the struct that is containing the given ListHead.

IFF_SECTION_HEADER_SIZE

sizeof IFF section header in bytes

IMPT

Imported functions table section

IS_EXTENDED_ALLOCATOR(code_chunk, base_index, off)
IS_EXTENDED_FP_REGISTER(code_chunk, base_index, off)
IS_NULL_PTR(x)
JUMP_TO_ADDRESS(address)
LIKELY(x)
LINT

Str table section

LIST_FOR_EACH(item, head)
LITU

Uncompressed literals table section

LOCT

Local functions table section

MAX_OFFS

Required size for offsets array

MAX_SIZES

Required size for sizes array

MIN(X, Y)
MUTABLE_LIST_FOR_EACH(item, tmp, head)
NEXT_INSTRUCTION(operands_size)
NO_DISCARD(...)
POINTER_TO_II(instruction_pointer)
PRINTF_FORMAT_ARGS(...)
PROCESS_MAYBE_TRAP_RETURN_VALUE(return_value)
PROCESS_MAYBE_TRAP_RETURN_VALUE_LAST(return_value)
PROCESS_MAYBE_TRAP_RETURN_VALUE_RESTORE_I(return_value, rest_i)
RAISE_ERROR(error_type_atom)
READ_16_UNALIGNED(ptr)
READ_32_ALIGNED(ptr)
READ_32_UNALIGNED(ptr)
READ_DEST_REGISTER(dreg_type, dreg)
SCHEDULE_NEXT(restore_mod, restore_to)
SELECT_INT_DEFAULT(i_val)

An idiomatic macro for marking an AtomStringIntPair table entry as a interop_atom_term_select_int default.

SET_ERROR(error_type_atom)
STRT

Str table section

SWAP_KV_PAIR(I, J)
T_DEST_REG(dreg_type, dreg)
TO_ATOMSHASHTABLE_VALUE(value)
TRACE(...)
TRACE_APPLY(...)
TRACE_CALL(...)
TRACE_CALL_EXT(...)
TRACE_RECEIVE(...)
TRACE_RETURN(...)
TRACE_SEND(...)
UNLIKELY(x)
UNUSED(x)
USED_BY_TRACE(x)
VALIDATE_VALUE(value, verify_function)
VERIFY_IS_ANY_INTEGER(t, opcode_name)
VERIFY_IS_BINARY(t, opcode_name)
VERIFY_IS_INTEGER(t, opcode_name)
VERIFY_IS_MATCH_OR_BINARY(t, opcode_name)
VERIFY_IS_MATCH_STATE(t, opcode_name)
VM_ABORT()
WRITE_16_UNALIGNED(ptr, val)
WRITE_16LE_UNALIGNED(t, ptr, val)
WRITE_32_UNALIGNED(ptr, val)
WRITE_32LE_UNALIGNED(t, ptr, val)
WRITE_64LE_UNALIGNED(t, ptr, val)
WRITE_REGISTER(dreg_type, dreg, value)