6#include "builtin_binary.inc"
8#ifndef BUILTIN_BINARY_SIZE
10#define BUILTIN_LOADED(feature_name, iseq) ((void)0)
11#include "mini_builtin.c"
15static const unsigned char *
16bin4feature(
const struct builtin_binary *bb,
const char *feature,
size_t *psize)
18 *psize = bb->bin_size;
19 return strcmp(bb->feature, feature) ? NULL : bb->bin;
22static const unsigned char*
23builtin_lookup(
const char *feature,
size_t *psize)
26 const unsigned char *bin = bin4feature(&
builtin_binary[index++], feature, psize);
30 bin = bin4feature(bb++, feature, psize);
36rb_load_with_builtin_functions(
const char *feature_name,
const struct rb_builtin_function *table)
40 const unsigned char *bin = builtin_lookup(feature_name, &size);
42 rb_bug(
"builtin_lookup: can not find %s", feature_name);
47 if (vm->builtin_function_table != NULL) rb_bug(
"vm->builtin_function_table should be NULL.");
48 vm->builtin_function_table = table;
49 const rb_iseq_t *iseq = rb_iseq_ibf_load_bytes((
const char *)bin, size);
51 vm->builtin_function_table = NULL;
54 rb_iseq_eval(rb_iseq_check(iseq));
60rb_free_loaded_builtin_table(
void)
72Init_builtin_features(
void)
74 rb_load_with_builtin_functions(
"gem_prelude", NULL);
#define ASSUME
Old name of RBIMPL_ASSUME.
Defines RBIMPL_HAS_BUILTIN.