summaryrefslogtreecommitdiff
path: root/tool/ruby_vm/views/_mjit_compile_insn_body.erb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/ruby_vm/views/_mjit_compile_insn_body.erb')
-rw-r--r--tool/ruby_vm/views/_mjit_compile_insn_body.erb7
1 files changed, 6 insertions, 1 deletions
diff --git a/tool/ruby_vm/views/_mjit_compile_insn_body.erb b/tool/ruby_vm/views/_mjit_compile_insn_body.erb
index 900480ddc0..187e043837 100644
--- a/tool/ruby_vm/views/_mjit_compile_insn_body.erb
+++ b/tool/ruby_vm/views/_mjit_compile_insn_body.erb
@@ -48,10 +48,15 @@
% # TODO: support combination of following macros in the same line
% case line
% when /\A\s+RUBY_VM_CHECK_INTS\(ec\);\s+\z/
-% if insn.leaf_without_check_ints? # lazily move PC here
+% if insn.leaf_without_check_ints? # lazily move PC and optionalize mjit_call_p here
fprintf(f, " if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(ec))) {\n");
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
fprintf(f, " rb_threadptr_execute_interrupts(rb_ec_thread_ptr(ec), 0);\n");
+ fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
+ fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
+ fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
+ fprintf(f, " goto cancel;\n");
+ fprintf(f, " }\n");
fprintf(f, " }\n");
% else
fprintf(f, <%= to_cstr.call(line) %>);