diff options
author | Peter Zhu <peter@peterzhu.ca> | 2022-03-23 15:19:48 -0400 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2022-03-24 10:03:51 -0400 |
commit | 5f10bd634fb6ae8f74a4ea730176233b0ca96954 (patch) | |
tree | 170c1c81ea63184290c9e021cc45bffbfc3f4f41 /vm_eval.c | |
parent | 04591e1be7618f64bd3bed8c53c0fcde5fcbddb8 (diff) | |
download | ruby-5f10bd634fb6ae8f74a4ea730176233b0ca96954.tar.gz |
Add ISEQ_BODY macro
Use ISEQ_BODY macro to get the rb_iseq_constant_body of the ISeq. Using
this macro will make it easier for us to change the allocation strategy
of rb_iseq_constant_body when using Variable Width Allocation.
Diffstat (limited to 'vm_eval.c')
-rw-r--r-- | vm_eval.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1709,7 +1709,7 @@ eval_make_iseq(VALUE src, VALUE fname, int line, const rb_binding_t *bind, ast = rb_parser_compile_string_path(parser, fname, src, line); if (ast->body.root) { iseq = rb_iseq_new_eval(&ast->body, - parent->body->location.label, + ISEQ_BODY(parent)->location.label, fname, Qnil, INT2FIX(line), parent, isolated_depth); } @@ -1772,7 +1772,7 @@ eval_string_with_scope(VALUE scope, VALUE src, VALUE file, int line) vm_set_eval_stack(ec, iseq, NULL, &bind->block); /* save new env */ - if (iseq->body->local_table_size > 0) { + if (ISEQ_BODY(iseq)->local_table_size > 0) { vm_bind_update_env(scope, bind, vm_make_env_object(ec, ec->cfp)); } @@ -2466,8 +2466,8 @@ rb_f_local_variables(VALUE _) local_var_list_init(&vars); while (cfp) { if (cfp->iseq) { - for (i = 0; i < cfp->iseq->body->local_table_size; i++) { - local_var_list_add(&vars, cfp->iseq->body->local_table[i]); + for (i = 0; i < ISEQ_BODY(cfp->iseq)->local_table_size; i++) { + local_var_list_add(&vars, ISEQ_BODY(cfp->iseq)->local_table[i]); } } if (!VM_ENV_LOCAL_P(cfp->ep)) { |