summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mjit_compile.c13
-rw-r--r--tool/ruby_vm/views/_mjit_compile_ivar.erb4
-rw-r--r--tool/ruby_vm/views/_mjit_compile_send.erb5
3 files changed, 15 insertions, 7 deletions
diff --git a/mjit_compile.c b/mjit_compile.c
index 0db1f15..1062fd8 100644
--- a/mjit_compile.c
+++ b/mjit_compile.c
@@ -190,6 +190,19 @@ static void
compile_cancel_handler(FILE *f, const struct rb_iseq_constant_body *body, struct compile_status *status)
{
unsigned int i;
+
+ fprintf(f, "\nsend_cancel:\n");
+ fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_send_inline);\n");
+ fprintf(f, " rb_mjit_iseq_compile_info(original_iseq->body)->disable_send_cache = true;\n");
+ fprintf(f, " rb_mjit_recompile_iseq(original_iseq);\n");
+ fprintf(f, " goto cancel;\n");
+
+ fprintf(f, "\nivar_cancel:\n");
+ fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_ivar_inline);\n");
+ fprintf(f, " rb_mjit_iseq_compile_info(original_iseq->body)->disable_ivar_cache = true;\n");
+ fprintf(f, " rb_mjit_recompile_iseq(original_iseq);\n");
+ fprintf(f, " goto cancel;\n");
+
fprintf(f, "\ncancel:\n");
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel);\n");
if (status->local_stack_p) {
diff --git a/tool/ruby_vm/views/_mjit_compile_ivar.erb b/tool/ruby_vm/views/_mjit_compile_ivar.erb
index eef3d7e..cf00269 100644
--- a/tool/ruby_vm/views/_mjit_compile_ivar.erb
+++ b/tool/ruby_vm/views/_mjit_compile_ivar.erb
@@ -43,9 +43,7 @@
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, " RB_DEBUG_COUNTER_INC(mjit_cancel_ivar);\n");
- fprintf(f, " rb_mjit_iseq_compile_info(original_iseq->body)->disable_ivar_cache = true;\n");
- fprintf(f, " rb_mjit_recompile_iseq(original_iseq);\n");
- fprintf(f, " goto cancel;\n");
+ fprintf(f, " goto ivar_cancel;\n");
fprintf(f, " }\n");
% # compiler: Move JIT compiler's internal stack pointer
diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb
index 90b9a07..e2d24bd 100644
--- a/tool/ruby_vm/views/_mjit_compile_send.erb
+++ b/tool/ruby_vm/views/_mjit_compile_send.erb
@@ -38,10 +38,7 @@
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
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, " RB_DEBUG_COUNTER_INC(mjit_cancel_send_inline);\n");
- fprintf(f, " rb_mjit_iseq_compile_info(original_iseq->body)->disable_send_cache = true;\n");
- fprintf(f, " rb_mjit_recompile_iseq(original_iseq);\n");
- fprintf(f, " goto cancel;\n");
+ fprintf(f, " goto send_cancel;\n");
fprintf(f, " }\n");
% # JIT: move sp and pc if necessary