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"]
    "25" [label="refc_binary.h" tooltip="refc_binary.h"]
    "34" [label="defaultatoms.h" tooltip="defaultatoms.h"]
    "4" [label="atom.h" tooltip="atom.h"]
    "12" [label="assert.h" tooltip="assert.h"]
    "35" [label="dictionary.h" tooltip="dictionary.h"]
    "23" [label="utils.h" tooltip="utils.h"]
    "17" [label="synclist.h" tooltip="synclist.h"]
    "16" [label="list.h" tooltip="list.h"]
    "5" [label="stdint.h" tooltip="stdint.h"]
    "1" [label="/__w/AtomVM/AtomVM/src/libAtomVM/bif.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/bif.c" fillcolor="#BFBFBF"]
    "6" [label="stdlib.h" tooltip="stdlib.h"]
    "7" [label="context.h" tooltip="context.h"]
    "2" [label="bif.h" tooltip="bif.h"]
    "22" [label="memory.h" tooltip="memory.h"]
    "38" [label="bifs_hash.h" tooltip="bifs_hash.h"]
    "30" [label="module.h" tooltip="module.h"]
    "32" [label="valueshashtable.h" tooltip="valueshashtable.h"]
    "26" [label="resources.h" tooltip="resources.h"]
    "20" [label="term.h" tooltip="term.h"]
    "24" [label="stddef.h" tooltip="stddef.h"]
    "10" [label="erl_nif.h" tooltip="erl_nif.h"]
    "29" [label="exportedfunction.h" tooltip="exportedfunction.h"]
    "13" [label="limits.h" tooltip="limits.h"]
    "9" [label="atom_table.h" tooltip="atom_table.h"]
    "21" [label="string.h" tooltip="string.h"]
    "11" [label="term_typedef.h" tooltip="term_typedef.h"]
    "8" [label="globalcontext.h" tooltip="globalcontext.h"]
    "36" [label="overflow_helpers.h" tooltip="overflow_helpers.h"]
    "19" [label="smp.h" tooltip="smp.h"]
    "31" [label="atomshashtable.h" tooltip="atomshashtable.h"]
    "33" [label="math.h" tooltip="math.h"]
    "28" [label="timer_list.h" tooltip="timer_list.h"]
    "27" [label="mailbox.h" tooltip="mailbox.h"]
    "37" [label="trace.h" tooltip="trace.h"]
    "18" [label="stdio.h" tooltip="stdio.h"]
    "15" [label="ets.h" tooltip="ets.h"]
    "14" [label="inttypes.h" tooltip="inttypes.h"]
    "25" -> "3" [dir=forward tooltip="include"]
    "25" -> "6" [dir=forward tooltip="include"]
    "25" -> "16" [dir=forward tooltip="include"]
    "25" -> "26" [dir=forward tooltip="include"]
    "34" -> "8" [dir=forward tooltip="include"]
    "4" -> "5" [dir=forward tooltip="include"]
    "4" -> "6" [dir=forward tooltip="include"]
    "35" -> "16" [dir=forward tooltip="include"]
    "35" -> "20" [dir=forward tooltip="include"]
    "23" -> "24" [dir=forward tooltip="include"]
    "23" -> "18" [dir=forward tooltip="include"]
    "23" -> "6" [dir=forward tooltip="include"]
    "17" -> "18" [dir=forward tooltip="include"]
    "17" -> "16" [dir=forward tooltip="include"]
    "17" -> "19" [dir=forward tooltip="include"]
    "16" -> "3" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "6" [dir=forward tooltip="include"]
    "1" -> "33" [dir=forward tooltip="include"]
    "1" -> "4" [dir=forward tooltip="include"]
    "1" -> "34" [dir=forward tooltip="include"]
    "1" -> "35" [dir=forward tooltip="include"]
    "1" -> "36" [dir=forward tooltip="include"]
    "1" -> "20" [dir=forward tooltip="include"]
    "1" -> "37" [dir=forward tooltip="include"]
    "1" -> "23" [dir=forward tooltip="include"]
    "1" -> "38" [dir=forward tooltip="include"]
    "7" -> "8" [dir=forward tooltip="include"]
    "7" -> "16" [dir=forward tooltip="include"]
    "7" -> "27" [dir=forward tooltip="include"]
    "7" -> "19" [dir=forward tooltip="include"]
    "7" -> "20" [dir=forward tooltip="include"]
    "7" -> "28" [dir=forward tooltip="include"]
    "2" -> "3" [dir=forward tooltip="include"]
    "2" -> "4" [dir=forward tooltip="include"]
    "2" -> "7" [dir=forward tooltip="include"]
    "2" -> "29" [dir=forward tooltip="include"]
    "2" -> "30" [dir=forward tooltip="include"]
    "22" -> "5" [dir=forward tooltip="include"]
    "22" -> "6" [dir=forward tooltip="include"]
    "22" -> "10" [dir=forward tooltip="include"]
    "22" -> "11" [dir=forward tooltip="include"]
    "22" -> "23" [dir=forward tooltip="include"]
    "30" -> "3" [dir=forward tooltip="include"]
    "30" -> "5" [dir=forward tooltip="include"]
    "30" -> "4" [dir=forward tooltip="include"]
    "30" -> "9" [dir=forward tooltip="include"]
    "30" -> "31" [dir=forward tooltip="include"]
    "30" -> "7" [dir=forward tooltip="include"]
    "30" -> "29" [dir=forward tooltip="include"]
    "30" -> "8" [dir=forward tooltip="include"]
    "30" -> "20" [dir=forward tooltip="include"]
    "30" -> "32" [dir=forward tooltip="include"]
    "26" -> "6" [dir=forward tooltip="include"]
    "26" -> "10" [dir=forward tooltip="include"]
    "26" -> "16" [dir=forward tooltip="include"]
    "26" -> "22" [dir=forward tooltip="include"]
    "20" -> "3" [dir=forward tooltip="include"]
    "20" -> "5" [dir=forward tooltip="include"]
    "20" -> "18" [dir=forward tooltip="include"]
    "20" -> "6" [dir=forward tooltip="include"]
    "20" -> "21" [dir=forward tooltip="include"]
    "20" -> "22" [dir=forward tooltip="include"]
    "20" -> "25" [dir=forward tooltip="include"]
    "20" -> "23" [dir=forward tooltip="include"]
    "20" -> "11" [dir=forward tooltip="include"]
    "10" -> "11" [dir=forward tooltip="include"]
    "29" -> "20" [dir=forward tooltip="include"]
    "9" -> "3" [dir=forward tooltip="include"]
    "9" -> "4" [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"]
    "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" -> "27" [dir=forward tooltip="include"]
    "8" -> "19" [dir=forward tooltip="include"]
    "8" -> "17" [dir=forward tooltip="include"]
    "8" -> "20" [dir=forward tooltip="include"]
    "8" -> "28" [dir=forward tooltip="include"]
    "36" -> "20" [dir=forward tooltip="include"]
    "36" -> "5" [dir=forward tooltip="include"]
    "19" -> "3" [dir=forward tooltip="include"]
    "31" -> "4" [dir=forward tooltip="include"]
    "28" -> "3" [dir=forward tooltip="include"]
    "28" -> "5" [dir=forward tooltip="include"]
    "28" -> "16" [dir=forward tooltip="include"]
    "27" -> "3" [dir=forward tooltip="include"]
    "27" -> "16" [dir=forward tooltip="include"]
    "27" -> "11" [dir=forward tooltip="include"]
    "27" -> "23" [dir=forward tooltip="include"]
    "15" -> "16" [dir=forward tooltip="include"]
    "15" -> "17" [dir=forward tooltip="include"]
    "15" -> "20" [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)