summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tool/ruby_vm/views/_mjit_compile_send.erb3
-rw-r--r--vm_core.h9
-rw-r--r--vm_insnhelper.c9
3 files changed, 11 insertions, 10 deletions
diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb
index 4cda80e0c2..4adbb1f153 100644
--- a/tool/ruby_vm/views/_mjit_compile_send.erb
+++ b/tool/ruby_vm/views/_mjit_compile_send.erb
@@ -23,7 +23,8 @@
argc += ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0);
% end
- if (cc_copy->me->def->type == VM_METHOD_TYPE_ISEQ && inlinable_iseq_p(ci, cc_copy, iseq = rb_iseq_check(cc_copy->me->def->body.iseq.iseqptr))) { /* CC_SET_FASTPATH in vm_callee_setup_arg */
+ if (!(ci->flag & VM_CALL_TAILCALL) && /* inlining non-tailcall path */
+ cc_copy->me->def->type == VM_METHOD_TYPE_ISEQ && inlinable_iseq_p(ci, cc_copy, iseq = def_iseq_ptr(cc_copy->me->def)) /* CC_SET_FASTPATH in vm_callee_setup_arg */) {
int param_size = iseq->body->param.size; /* TODO: check calling->argc for argument_arity_error */
fprintf(f, "{\n");
diff --git a/vm_core.h b/vm_core.h
index 818a6f9707..fbcb013e46 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -507,6 +507,15 @@ rb_iseq_check(const rb_iseq_t *iseq)
return iseq;
}
+static inline const rb_iseq_t *
+def_iseq_ptr(rb_method_definition_t *def)
+{
+#if VM_CHECK_MODE > 0
+ if (def->type != VM_METHOD_TYPE_ISEQ) rb_bug("def_iseq_ptr: not iseq (%d)", def->type);
+#endif
+ return rb_iseq_check(def->body.iseq.iseqptr);
+}
+
enum ruby_special_exceptions {
ruby_error_reenter,
ruby_error_nomemory,
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 8fb5fdfe66..e162e9d32f 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1590,15 +1590,6 @@ static inline VALUE vm_call_method(rb_execution_context_t *ec, rb_control_frame_
static vm_call_handler vm_call_iseq_setup_func(const struct rb_call_info *ci, const int param_size, const int local_size);
-static const rb_iseq_t *
-def_iseq_ptr(rb_method_definition_t *def)
-{
-#if VM_CHECK_MODE > 0
- if (def->type != VM_METHOD_TYPE_ISEQ) rb_bug("def_iseq_ptr: not iseq (%d)", def->type);
-#endif
- return rb_iseq_check(def->body.iseq.iseqptr);
-}
-
static VALUE
vm_call_iseq_setup_tailcall_0start(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
{