summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2023-01-19 14:47:17 -0500
committerPeter Zhu <[email protected]>2023-01-20 08:51:39 -0500
commit056e7a0154fe4c71eca3726c878bb3da7e4138f8 ()
tree0cc48f743143edbb7801e5dc103b670b7ad62145
parent76e3d853ab33d31ab9d5ae6f88b406841e8dbbf2 (diff)
Make all of the references of iseq movable
Notes: Merged: https://.com/ruby/ruby/pull/7156
-rw-r--r--compile.c10
-rw-r--r--iseq.c35
-rw-r--r--iseq.h2
-rw-r--r--vm_core.h1
-rw-r--r--vm_trace.c11
5 files changed, 30 insertions, 29 deletions
@@ -10736,7 +10736,7 @@ iseq_build_kw(rb_iseq_t *iseq, VALUE params, VALUE keywords)
}
void
-rb_iseq_mark_insn_storage(struct iseq_compile_data_storage *storage)
{
INSN *iobj = 0;
size_t size = sizeof(INSN);
@@ -10772,13 +10772,7 @@ rb_iseq_mark_insn_storage(struct iseq_compile_data_storage *storage)
case TS_VALUE:
case TS_IC: // constant path array
case TS_CALLDATA: // ci is stored.
- {
- VALUE op = OPERAND_AT(iobj, j);
-
- if (!SPECIAL_CONST_P(op)) {
- rb_gc_mark(op);
- }
- }
break;
default:
break;
@@ -373,28 +373,23 @@ rb_iseq_mark_and_update(rb_iseq_t *iseq, bool reference_updating)
}
}
- // TODO: make these not pinned
- if (!reference_updating) {
- if (FL_TEST_RAW((VALUE)iseq, ISEQ_NOT_LOADED_YET)) {
- rb_gc_mark(iseq->aux.loader.obj);
- }
- else if (FL_TEST_RAW((VALUE)iseq, ISEQ_USE_COMPILE_DATA)) {
- const struct iseq_compile_data *const compile_data = ISEQ_COMPILE_DATA(iseq);
- rb_iseq_mark_insn_storage(compile_data->insn.storage_head);
- RUBY_MARK_UNLESS_NULL(compile_data->err_info);
- if (RTEST(compile_data->catch_table_ary)) {
- rb_gc_mark(compile_data->catch_table_ary);
- }
- VM_ASSERT(compile_data != NULL);
- }
- else {
- /* executable */
- VM_ASSERT(ISEQ_EXECUTABLE_P(iseq));
- if (iseq->aux.exec.local_hooks) {
- rb_hook_list_mark(iseq->aux.exec.local_hooks);
- }
}
}
@@ -186,7 +186,7 @@ VALUE *rb_iseq_original_iseq(const rb_iseq_t *iseq);
void rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc,
VALUE locals, VALUE args,
VALUE exception, VALUE body);
-void rb_iseq_mark_insn_storage(struct iseq_compile_data_storage *arena);
VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
@@ -2015,6 +2015,7 @@ struct rb_trace_arg_struct {
};
void rb_hook_list_mark(rb_hook_list_t *hooks);
void rb_hook_list_free(rb_hook_list_t *hooks);
void rb_hook_list_connect_tracepoint(VALUE target, rb_hook_list_t *list, VALUE tpval, unsigned int target_line);
void rb_hook_list_remove_tracepoint(rb_hook_list_t *list, VALUE tpval);
@@ -66,6 +66,17 @@ rb_hook_list_mark(rb_hook_list_t *hooks)
}
}
static void clean_hooks(const rb_execution_context_t *ec, rb_hook_list_t *list);
void