diff options
author | Aaron Patterson <[email protected]> | 2021-07-19 11:12:51 -0700 |
---|---|---|
committer | Alan Wu <[email protected]> | 2021-10-20 18:19:38 -0400 |
commit | 71cef74432ef67edfd5635a9b9f8dffbbc33d392 (patch) | |
tree | f445f22df98ec453d4d9e1a02824213b1f4b7a58 /iseq.c | |
parent | e8617d0e7ea8039f3757896f547107f51566256b (diff) |
Clear JIT code when tracepoints get enabled
Clear out any JIT code on iseqs when tracepoints get enabled. We can't
handle tracepoints right now, so we'll just try to recompile later.
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -3293,6 +3293,8 @@ rb_iseq_trace_flag_cleared(const rb_iseq_t *iseq, size_t pos) encoded_iseq_trace_instrument(&iseq_encoded[pos], 0, false); } +typedef VALUE (*jit_func_t)(struct rb_execution_context_struct *, struct rb_control_frame_struct *); + static int iseq_add_local_tracepoint(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line) { @@ -3303,6 +3305,11 @@ iseq_add_local_tracepoint(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VM_ASSERT(ISEQ_EXECUTABLE_P(iseq)); +#if USE_MJIT + // Force write the jit function to NULL + *((jit_func_t *)(&body->jit_func)) = 0; +#endif + for (pc=0; pc<body->iseq_size;) { const struct iseq_insn_info_entry *entry = get_insn_info(iseq, pc); rb_event_flag_t pc_events = entry->events; @@ -3438,6 +3445,10 @@ rb_iseq_trace_set(const rb_iseq_t *iseq, rb_event_flag_t turnon_events) rb_event_flag_t pc_events = rb_iseq_event_flags(iseq, pc); pc += encoded_iseq_trace_instrument(&iseq_encoded[pc], pc_events & enabled_events, true); } +#if USE_MJIT + // Force write the jit function to NULL + *((jit_func_t *)(&body->jit_func)) = 0; +#endif } } |