aboutsummaryrefslogtreecommitdiffstats
path: root/vm_eval.c
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2023-06-17 10:21:37 +0900
committerYuichiro Kaneko <spiketeika@gmail.com>2023-06-17 16:41:08 +0900
commit19c62b400d3458c4525f174515bcb616af7dfdfe (patch)
tree59a687fc1573a545cc21f6b529724cd7821a0df8 /vm_eval.c
parente5ae7a16b49d4cf7c7069aeb01ed5c4e58152055 (diff)
downloadruby-19c62b400d3458c4525f174515bcb616af7dfdfe.tar.gz
Replace parser & node compile_option from Hash to bit field
This commit reduces dependency to CRuby object.
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/vm_eval.c b/vm_eval.c
index d5fbcf5f56..9beae74731 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -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,