bif.c

Include dependency graph for bif.c:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "3" [label="stdbool.h" tooltip="stdbool.h"]
    "1" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.c" fillcolor="#BFBFBF"]
    "2" [label="bif.h" tooltip="bif.h"]
    "34" [label="dictionary.h" tooltip="dictionary.h"]
    "4" [label="atom.h" tooltip="atom.h"]
    "36" [label="trace.h" tooltip="trace.h"]
    "12" [label="assert.h" tooltip="assert.h"]
    "21" [label="synclist.h" tooltip="synclist.h"]
    "33" [label="defaultatoms.h" tooltip="defaultatoms.h"]
    "5" [label="stdint.h" tooltip="stdint.h"]
    "6" [label="stdlib.h" tooltip="stdlib.h"]
    "31" [label="valueshashtable.h" tooltip="valueshashtable.h"]
    "28" [label="exportedfunction.h" tooltip="exportedfunction.h"]
    "37" [label="bifs_hash.h" tooltip="bifs_hash.h"]
    "7" [label="context.h" tooltip="context.h"]
    "17" [label="utils.h" tooltip="utils.h"]
    "9" [label="atom_table.h" tooltip="atom_table.h"]
    "35" [label="overflow_helpers.h" tooltip="overflow_helpers.h"]
    "11" [label="term_typedef.h" tooltip="term_typedef.h"]
    "18" [label="stddef.h" tooltip="stddef.h"]
    "13" [label="limits.h" tooltip="limits.h"]
    "25" [label="refc_binary.h" tooltip="refc_binary.h"]
    "23" [label="string.h" tooltip="string.h"]
    "16" [label="mailbox.h" tooltip="mailbox.h"]
    "29" [label="module.h" tooltip="module.h"]
    "22" [label="term.h" tooltip="term.h"]
    "10" [label="erl_nif.h" tooltip="erl_nif.h"]
    "32" [label="math.h" tooltip="math.h"]
    "26" [label="resources.h" tooltip="resources.h"]
    "20" [label="smp.h" tooltip="smp.h"]
    "30" [label="atomshashtable.h" tooltip="atomshashtable.h"]
    "8" [label="globalcontext.h" tooltip="globalcontext.h"]
    "24" [label="memory.h" tooltip="memory.h"]
    "19" [label="stdio.h" tooltip="stdio.h"]
    "27" [label="timer_list.h" tooltip="timer_list.h"]
    "15" [label="list.h" tooltip="list.h"]
    "14" [label="inttypes.h" tooltip="inttypes.h"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "6" [dir=forward tooltip="include"]
    "1" -> "32" [dir=forward tooltip="include"]
    "1" -> "4" [dir=forward tooltip="include"]
    "1" -> "33" [dir=forward tooltip="include"]
    "1" -> "34" [dir=forward tooltip="include"]
    "1" -> "35" [dir=forward tooltip="include"]
    "1" -> "22" [dir=forward tooltip="include"]
    "1" -> "36" [dir=forward tooltip="include"]
    "1" -> "17" [dir=forward tooltip="include"]
    "1" -> "37" [dir=forward tooltip="include"]
    "2" -> "3" [dir=forward tooltip="include"]
    "2" -> "4" [dir=forward tooltip="include"]
    "2" -> "7" [dir=forward tooltip="include"]
    "2" -> "28" [dir=forward tooltip="include"]
    "2" -> "29" [dir=forward tooltip="include"]
    "34" -> "15" [dir=forward tooltip="include"]
    "34" -> "22" [dir=forward tooltip="include"]
    "4" -> "5" [dir=forward tooltip="include"]
    "4" -> "6" [dir=forward tooltip="include"]
    "21" -> "19" [dir=forward tooltip="include"]
    "21" -> "15" [dir=forward tooltip="include"]
    "21" -> "20" [dir=forward tooltip="include"]
    "33" -> "8" [dir=forward tooltip="include"]
    "28" -> "22" [dir=forward tooltip="include"]
    "7" -> "8" [dir=forward tooltip="include"]
    "7" -> "15" [dir=forward tooltip="include"]
    "7" -> "16" [dir=forward tooltip="include"]
    "7" -> "20" [dir=forward tooltip="include"]
    "7" -> "22" [dir=forward tooltip="include"]
    "7" -> "27" [dir=forward tooltip="include"]
    "17" -> "18" [dir=forward tooltip="include"]
    "17" -> "19" [dir=forward tooltip="include"]
    "17" -> "6" [dir=forward tooltip="include"]
    "9" -> "3" [dir=forward tooltip="include"]
    "9" -> "4" [dir=forward tooltip="include"]
    "35" -> "22" [dir=forward tooltip="include"]
    "35" -> "5" [dir=forward tooltip="include"]
    "11" -> "12" [dir=forward tooltip="include"]
    "11" -> "13" [dir=forward tooltip="include"]
    "11" -> "14" [dir=forward tooltip="include"]
    "11" -> "5" [dir=forward tooltip="include"]
    "25" -> "3" [dir=forward tooltip="include"]
    "25" -> "6" [dir=forward tooltip="include"]
    "25" -> "15" [dir=forward tooltip="include"]
    "25" -> "26" [dir=forward tooltip="include"]
    "16" -> "3" [dir=forward tooltip="include"]
    "16" -> "15" [dir=forward tooltip="include"]
    "16" -> "11" [dir=forward tooltip="include"]
    "16" -> "17" [dir=forward tooltip="include"]
    "29" -> "3" [dir=forward tooltip="include"]
    "29" -> "5" [dir=forward tooltip="include"]
    "29" -> "4" [dir=forward tooltip="include"]
    "29" -> "9" [dir=forward tooltip="include"]
    "29" -> "30" [dir=forward tooltip="include"]
    "29" -> "7" [dir=forward tooltip="include"]
    "29" -> "28" [dir=forward tooltip="include"]
    "29" -> "8" [dir=forward tooltip="include"]
    "29" -> "22" [dir=forward tooltip="include"]
    "29" -> "31" [dir=forward tooltip="include"]
    "22" -> "3" [dir=forward tooltip="include"]
    "22" -> "5" [dir=forward tooltip="include"]
    "22" -> "19" [dir=forward tooltip="include"]
    "22" -> "6" [dir=forward tooltip="include"]
    "22" -> "23" [dir=forward tooltip="include"]
    "22" -> "24" [dir=forward tooltip="include"]
    "22" -> "25" [dir=forward tooltip="include"]
    "22" -> "17" [dir=forward tooltip="include"]
    "22" -> "11" [dir=forward tooltip="include"]
    "10" -> "11" [dir=forward tooltip="include"]
    "26" -> "6" [dir=forward tooltip="include"]
    "26" -> "10" [dir=forward tooltip="include"]
    "26" -> "15" [dir=forward tooltip="include"]
    "26" -> "24" [dir=forward tooltip="include"]
    "20" -> "3" [dir=forward tooltip="include"]
    "30" -> "4" [dir=forward tooltip="include"]
    "8" -> "5" [dir=forward tooltip="include"]
    "8" -> "4" [dir=forward tooltip="include"]
    "8" -> "9" [dir=forward tooltip="include"]
    "8" -> "10" [dir=forward tooltip="include"]
    "8" -> "15" [dir=forward tooltip="include"]
    "8" -> "16" [dir=forward tooltip="include"]
    "8" -> "20" [dir=forward tooltip="include"]
    "8" -> "21" [dir=forward tooltip="include"]
    "8" -> "22" [dir=forward tooltip="include"]
    "8" -> "27" [dir=forward tooltip="include"]
    "24" -> "5" [dir=forward tooltip="include"]
    "24" -> "6" [dir=forward tooltip="include"]
    "24" -> "10" [dir=forward tooltip="include"]
    "24" -> "11" [dir=forward tooltip="include"]
    "24" -> "17" [dir=forward tooltip="include"]
    "27" -> "3" [dir=forward tooltip="include"]
    "27" -> "5" [dir=forward tooltip="include"]
    "27" -> "15" [dir=forward tooltip="include"]
}

Defines

RAISE_ERROR(error_type_atom)     ctx->x[0] = ERROR_ATOM

;          \

ctx->x[1] = (error_type_atom);   \

return

term_invalid_term();
RAISE_ERROR_BIF(fail_label, error_type_atom)

if (fail_label == 0) {                           \

ctx->x[0] =

ERROR_ATOM

;                      \

ctx->x[1] = (error_type_atom);               \

}                                                \

return

term_invalid_term();
VALIDATE_VALUE_BIF(fail_label, value, verify_function)     if (UNLIKELY(!verify_function((value)))) {                 \         RAISE_ERROR_BIF(fail_label, BADARG_ATOM

);              \

}


Typedefs

typedef int64_t (*bitwise_op)(int64_t a, int64_t b)
typedef int64_t (*bitshift_op)(int64_t a, avm_int_t b)

Functions

const struct ExportedFunction *bif_registry_get_handler(AtomString module, AtomString function, int arity)
term bif_erlang_self_0(Context *ctx)
term bif_erlang_byte_size_1(Context *ctx, uint32_t fail_label, int live, term arg1)
term bif_erlang_bit_size_1(Context *ctx, uint32_t fail_label, int live, term arg1)
term bif_erlang_is_atom_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_is_binary_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_is_boolean_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_is_float_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_is_function_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_is_integer_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_is_list_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_is_number_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_is_pid_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_is_reference_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_is_tuple_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_is_map_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_is_map_key_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_length_1(Context *ctx, uint32_t fail_label, int live, term arg1)
term bif_erlang_hd_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_tl_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_element_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_tuple_size_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_map_size_1(Context *ctx, uint32_t fail_label, int live, term arg1)
term bif_erlang_map_get_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
static inline term make_boxed_int(Context *ctx, uint32_t fail_label, uint32_t live, avm_int_t value)
static inline term make_boxed_int64(Context *ctx, uint32_t fail_label, uint32_t live, avm_int64_t value)
static inline term make_maybe_boxed_int(Context *ctx, uint32_t fail_label, uint32_t live, avm_int_t value)
static inline term make_maybe_boxed_int64(Context *ctx, uint32_t fail_label, uint32_t live, avm_int64_t value)
static term add_overflow_helper(Context *ctx, uint32_t fail_label, uint32_t live, term arg1, term arg2)
static term add_boxed_helper(Context *ctx, uint32_t fail_label, uint32_t live, term arg1, term arg2)
term bif_erlang_add_2(Context *ctx, uint32_t fail_label, int live, term arg1, term arg2)
static term sub_overflow_helper(Context *ctx, uint32_t fail_label, uint32_t live, term arg1, term arg2)
static term sub_boxed_helper(Context *ctx, uint32_t fail_label, uint32_t live, term arg1, term arg2)
term bif_erlang_sub_2(Context *ctx, uint32_t fail_label, int live, term arg1, term arg2)
static term mul_overflow_helper(Context *ctx, uint32_t fail_label, uint32_t live, term arg1, term arg2)
static term mul_boxed_helper(Context *ctx, uint32_t fail_label, uint32_t live, term arg1, term arg2)
term bif_erlang_mul_2(Context *ctx, uint32_t fail_label, int live, term arg1, term arg2)
static term div_boxed_helper(Context *ctx, uint32_t fail_label, uint32_t live, term arg1, term arg2)
term bif_erlang_div_2(Context *ctx, uint32_t fail_label, int live, term arg1, term arg2)
static term neg_boxed_helper(Context *ctx, uint32_t fail_label, uint32_t live, term arg1)
term bif_erlang_neg_1(Context *ctx, uint32_t fail_label, int live, term arg1)
static term abs_boxed_helper(Context *ctx, uint32_t fail_label, uint32_t live, term arg1)
term bif_erlang_abs_1(Context *ctx, uint32_t fail_label, int live, term arg1)
static term rem_boxed_helper(Context *ctx, uint32_t fail_label, uint32_t live, term arg1, term arg2)
term bif_erlang_rem_2(Context *ctx, uint32_t fail_label, int live, term arg1, term arg2)
term bif_erlang_ceil_1(Context *ctx, uint32_t fail_label, int live, term arg1)
term bif_erlang_floor_1(Context *ctx, uint32_t fail_label, int live, term arg1)
term bif_erlang_round_1(Context *ctx, uint32_t fail_label, int live, term arg1)
term bif_erlang_trunc_1(Context *ctx, uint32_t fail_label, int live, term arg1)
static inline term bitwise_helper(Context *ctx, uint32_t fail_label, int live, term arg1, term arg2, bitwise_op op)
static inline int64_t bor(int64_t a, int64_t b)
term bif_erlang_bor_2(Context *ctx, uint32_t fail_label, int live, term arg1, term arg2)
static inline int64_t band(int64_t a, int64_t b)
term bif_erlang_band_2(Context *ctx, uint32_t fail_label, int live, term arg1, term arg2)
static inline int64_t bxor(int64_t a, int64_t b)
term bif_erlang_bxor_2(Context *ctx, uint32_t fail_label, int live, term arg1, term arg2)
static inline term bitshift_helper(Context *ctx, uint32_t fail_label, int live, term arg1, term arg2, bitshift_op op)
static inline int64_t bsl(int64_t a, avm_int_t b)
term bif_erlang_bsl_2(Context *ctx, uint32_t fail_label, int live, term arg1, term arg2)
static inline int64_t bsr(int64_t a, avm_int_t b)
term bif_erlang_bsr_2(Context *ctx, uint32_t fail_label, int live, term arg1, term arg2)
term bif_erlang_bnot_1(Context *ctx, uint32_t fail_label, int live, term arg1)
term bif_erlang_not_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_and_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_or_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_xor_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_equal_to_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_not_equal_to_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_exactly_equal_to_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_exactly_not_equal_to_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_greater_than_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_less_than_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_less_than_or_equal_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_greater_than_or_equal_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_get_1(Context *ctx, uint32_t fail_label, term arg1)
term bif_erlang_min_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_max_2(Context *ctx, uint32_t fail_label, term arg1, term arg2)
term bif_erlang_size_1(Context *ctx, uint32_t fail_label, int live, term arg1)