diff options
author | yui-knk <spiketeika@gmail.com> | 2023-06-17 10:21:37 +0900 |
---|---|---|
committer | Yuichiro Kaneko <spiketeika@gmail.com> | 2023-06-17 16:41:08 +0900 |
commit | 19c62b400d3458c4525f174515bcb616af7dfdfe (patch) | |
tree | 59a687fc1573a545cc21f6b529724cd7821a0df8 /vm_eval.c | |
parent | e5ae7a16b49d4cf7c7069aeb01ed5c4e58152055 (diff) |
Replace parser & node compile_option from Hash to bit field
This commit reduces dependency to CRuby object.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7950
Diffstat (limited to 'vm_eval.c')
-rw-r--r-- | vm_eval.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -1626,7 +1626,7 @@ eval_make_iseq(VALUE src, VALUE fname, int line, const rb_binding_t *bind, int isolated_depth = 0; // Conditionally enable coverage depending on the current mode: - VALUE coverage_enabled = RBOOL(rb_get_coverage_mode() & COVERAGE_TARGET_EVAL); + int coverage_enabled = (rb_get_coverage_mode() & COVERAGE_TARGET_EVAL) != 0; { int depth = 1; @@ -1659,17 +1659,13 @@ eval_make_iseq(VALUE src, VALUE fname, int line, const rb_binding_t *bind, rb_gc_register_mark_object(eval_default_path); } fname = eval_default_path; - coverage_enabled = Qfalse; + coverage_enabled = FALSE; } rb_parser_set_context(parser, parent, FALSE); ast = rb_parser_compile_string_path(parser, fname, src, line); if (ast->body.root) { - if (ast->body.compile_option == Qnil) { - ast->body.compile_option = rb_obj_hide(rb_ident_hash_new()); - } - rb_hash_aset(ast->body.compile_option, rb_sym_intern_ascii_cstr("coverage_enabled"), coverage_enabled); - + ast->body.coverage_enabled = coverage_enabled; iseq = rb_iseq_new_eval(&ast->body, ISEQ_BODY(parent)->location.label, fname, Qnil, line, |