diff options
author | Kevin Newton <[email protected]> | 2024-05-30 14:33:12 -0400 |
---|---|---|
committer | Kevin Newton <[email protected]> | 2024-05-30 15:38:02 -0400 |
commit | 4e36abbab3a143842b2fbed8b00ba7ba6e45ac3f () | |
tree | 97a7255bc9e6dd4c55057330c364ff36bdefc7ec /mini_builtin.c | |
parent | 4558abec020b786eb337f6edf4e114cae80228aa (diff) |
[PRISM] Support for compiling builtins
-rw-r--r-- | mini_builtin.c | 47 |
1 files changed, 34 insertions, 13 deletions
@@ -12,22 +12,16 @@ static struct st_table *loaded_builtin_table; #endif VALUE rb_builtin_ast_value(const char *feature_name, VALUE *name_str); static const rb_iseq_t * builtin_iseq_load(const char *feature_name, const struct rb_builtin_function *table) { VALUE name_str = 0; - rb_ast_t *ast; - VALUE ast_value = rb_builtin_ast_value(feature_name, &name_str); - rb_vm_t *vm = GET_VM(); - if (NIL_P(ast_value)) { - rb_fatal("builtin_iseq_load: can not find %s; " - "probably miniprelude.c is out of date", - feature_name); - } - vm->builtin_function_table = table; static const rb_compile_option_t optimization = { .inline_const_cache = TRUE, .peephole_optimization = TRUE, @@ -40,11 +34,38 @@ builtin_iseq_load(const char *feature_name, const struct rb_builtin_function *ta .coverage_enabled = FALSE, .debug_level = 0, }; - ast = rb_ruby_ast_data_get(ast_value); - const rb_iseq_t *iseq = rb_iseq_new_with_opt(ast_value, name_str, name_str, Qnil, 0, NULL, 0, ISEQ_TYPE_TOP, &optimization, Qnil); - GET_VM()->builtin_function_table = NULL; - rb_ast_dispose(ast); // for debug if (0 && strcmp("prelude", feature_name) == 0) { |