summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--iseq.c3
-rw-r--r--tool/ruby_vm/views/_mjit_compile_send.erb5
2 files changed, 4 insertions, 4 deletions
diff --git a/iseq.c b/iseq.c
index 0697fef53b..b6d463526d 100644
--- a/iseq.c
+++ b/iseq.c
@@ -364,7 +364,8 @@ rb_iseq_mark(const rb_iseq_t *iseq)
for (unsigned int i=0; i<body->ci_size; i++) {
const struct rb_callcache *cc = cc_entries[i];
if (cc != NULL) {
- rb_gc_mark((VALUE)cc); // pindown
+ // Pin cc against GC.compact as the the address may be written in JIT-ed code.
+ rb_gc_mark((VALUE)cc);
}
}
}
diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb
index d076b0bc33..9642e46d10 100644
--- a/tool/ruby_vm/views/_mjit_compile_send.erb
+++ b/tool/ruby_vm/views/_mjit_compile_send.erb
@@ -38,9 +38,8 @@
}
% # JIT: Invalidate call cache if it requires vm_search_method. This allows to inline some of following things.
- fprintf(f, " const struct rb_call_data *cd = (const struct rb_callcache *)0x%"PRIxVALUE";\n", (VALUE)cd);
fprintf(f, " const struct rb_callcache *cc = (const struct rb_callcache *)0x%"PRIxVALUE";\n", (VALUE)captured_cc);
- fprintf(f, " if (UNLIKELY(cd->cc != cc || !vm_cc_valid_p(cc, CLASS_OF(stack[%d])))) {\n", b->stack_size - 1 - argc);
+ fprintf(f, " if (UNLIKELY(!vm_cc_valid_p(cc, CLASS_OF(stack[%d])))) {\n", b->stack_size - 1 - argc);
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
fprintf(f, " goto send_cancel;\n");
@@ -63,7 +62,7 @@
fprintf(f, " {\n");
fprintf(f, " struct rb_calling_info calling;\n");
% if insn.name == 'send'
- fprintf(f, " calling.block_handler = vm_caller_setup_arg_block(ec, reg_cfp, cd->ci, (rb_iseq_t *)0x%"PRIxVALUE", FALSE);\n", (VALUE)blockiseq);
+ fprintf(f, " calling.block_handler = vm_caller_setup_arg_block(ec, reg_cfp, (const struct rb_callinfo *)0x%"PRIxVALUE", (rb_iseq_t *)0x%"PRIxVALUE", FALSE);\n", (VALUE)ci, (VALUE)blockiseq);
% else
fprintf(f, " calling.block_handler = VM_BLOCK_HANDLER_NONE;\n");
% end