aboutsummaryrefslogtreecommitdiffstats
path: root/mjit.h
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-07 04:17:59 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-07 04:17:59 +0000
commitef2ef7761b5a0387b3e91687bd314654d6de272f (patch)
tree829b60da286751ccf0b8560cee81b6f237722a27 /mjit.h
parent24685ec25c039399c8394ae5ac323fb83e2301a0 (diff)
downloadruby-ef2ef7761b5a0387b3e91687bd314654d6de272f.tar.gz
mjit.h: call compiled code immediately
after the first compilation on --jit-wait. Previously the assignment to `func` didn't have meaning for the behavior, and the compiled code wasn't called immediately after the synchronous compilation. It wasn't intentional. Fixing this issue without impacting performance without --jit-wait is not so obvious. Adding branch or goto to call func in mjit_exec spoiled the performance without --jit-wait. Instead of that, I called the func inside mjit_wait_call() (former mjit_get_iseq_func()) which is never inlined to mjit_exec(). Thanks to that, this commit has no impact for normal performance. mjit.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit.h')
-rw-r--r--mjit.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/mjit.h b/mjit.h
index eee3a8badb..0efa04ac8d 100644
--- a/mjit.h
+++ b/mjit.h
@@ -59,7 +59,7 @@ RUBY_EXTERN struct mjit_options mjit_opts;
RUBY_EXTERN int mjit_call_p;
extern void mjit_add_iseq_to_process(const rb_iseq_t *iseq);
-extern mjit_func_t mjit_get_iseq_func(struct rb_iseq_constant_body *body);
+extern VALUE mjit_wait_call(rb_execution_context_t *ec, struct rb_iseq_constant_body *body);
RUBY_SYMBOL_EXPORT_END
extern int mjit_compile(FILE *f, const struct rb_iseq_constant_body *body, const char *funcname);
@@ -110,7 +110,7 @@ mjit_exec(rb_execution_context_t *ec)
if (total_calls == mjit_opts.min_calls && mjit_target_iseq_p(body)) {
mjit_add_iseq_to_process(iseq);
if (UNLIKELY(mjit_opts.wait)) {
- func = mjit_get_iseq_func(body);
+ return mjit_wait_call(ec, body);
}
}
return Qundef;