summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-01-19 14:47:17 -0500
committerPeter Zhu <peter@peterzhu.ca>2023-01-20 08:51:39 -0500
commit056e7a0154fe4c71eca3726c878bb3da7e4138f8 (patch)
tree0cc48f743143edbb7801e5dc103b670b7ad62145 /iseq.c
parent76e3d853ab33d31ab9d5ae6f88b406841e8dbbf2 (diff)
downloadruby-056e7a0154fe4c71eca3726c878bb3da7e4138f8.tar.gz
Make all of the references of iseq movable
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/iseq.c b/iseq.c
index ecacc7963f..97b9da9339 100644
--- a/iseq.c
+++ b/iseq.c
@@ -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);
+ if (FL_TEST_RAW((VALUE)iseq, ISEQ_NOT_LOADED_YET)) {
+ rb_gc_mark_and_move(&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);
+ rb_iseq_mark_and_update_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);
- }
+ rb_gc_mark_and_move((VALUE *)&compile_data->err_info);
+ rb_gc_mark_and_move((VALUE *)&compile_data->catch_table_ary);
+ }
+ else {
+ /* executable */
+ VM_ASSERT(ISEQ_EXECUTABLE_P(iseq));
+
+ if (iseq->aux.exec.local_hooks) {
+ rb_hook_list_mark_and_update(iseq->aux.exec.local_hooks);
}
}