summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-23 14:11:19 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-23 14:11:19 +0000
commite1be448840da9ac2db4eeeed5d07ae8a765bacce (patch)
tree0d2ffded9f46497fa10af1a2bc7193750fba49ec /mjit.c
parenta62a776d575ada3cb3a8ae2beb8a2908a27648a1 (diff)
mjit.c: disable calling JIT-ed code
when TracePoint is enabled. We're cancelling JIT-ed code execution AFTER each instruction, but there is no guard before the first insn of method. To prevent spoiling performance, I don't want to modify the JIT-ed code to fix this. So this commit replaces `mjit_enabled` check with `mjit_call_p` check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mjit.c b/mjit.c
index b760691459..5c6cf47cc7 100644
--- a/mjit.c
+++ b/mjit.c
@@ -171,6 +171,9 @@ struct rb_mjit_unit_list {
/* TRUE if MJIT is enabled. */
int mjit_enabled = FALSE;
+/* TRUE if JIT-ed code should be called. When `ruby_vm_event_enabled_flags & ISEQ_TRACE_EVENTS`
+ and `mjit_call_p == FALSE`, any JIT-ed code execution is cancelled as soon as possible. */
+int mjit_call_p = FALSE;
/* Priority queue of iseqs waiting for JIT compilation.
This variable is a pointer to head unit of the queue. */
@@ -1410,6 +1413,7 @@ mjit_init(struct mjit_options *opts)
mjit_opts = *opts;
mjit_enabled = TRUE;
+ mjit_call_p = TRUE;
/* Normalize options */
if (mjit_opts.min_calls == 0)
@@ -1549,6 +1553,7 @@ mjit_finish(void)
xfree(pch_file); pch_file = NULL;
xfree(header_file); header_file = NULL;
+ mjit_call_p = FALSE;
free_list(&unit_queue);
free_list(&active_units);
finish_conts();