Skip to content

Commit

Permalink
Remove unused debug counters
Browse files Browse the repository at this point in the history
The structure and readability of jit_exec is messed up right now. I'd
like to help the current situation by this for now. I'll resurrect
them when I need it again.
  • Loading branch information
k0kubun committed Nov 13, 2022
1 parent 6246788 commit 68e0523
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
7 changes: 0 additions & 7 deletions debug_counter.h
Expand Up @@ -346,13 +346,6 @@ RB_DEBUG_COUNTER(vm_sync_lock_enter_nb)
RB_DEBUG_COUNTER(vm_sync_lock_enter_cr)
RB_DEBUG_COUNTER(vm_sync_barrier)

/* jit_exec() counts */
RB_DEBUG_COUNTER(jit_exec)
RB_DEBUG_COUNTER(mjit_exec_not_added)
RB_DEBUG_COUNTER(mjit_exec_not_ready)
RB_DEBUG_COUNTER(mjit_exec_not_compiled)
RB_DEBUG_COUNTER(mjit_exec_call_func)

/* MJIT enqueue / unload */
RB_DEBUG_COUNTER(mjit_add_iseq_to_process)
RB_DEBUG_COUNTER(mjit_unload_units)
Expand Down
22 changes: 1 addition & 21 deletions vm.c
Expand Up @@ -391,7 +391,6 @@ mjit_check_iseq(rb_execution_context_t *ec, const rb_iseq_t *iseq, struct rb_ise
ASSUME(func_i <= LAST_JIT_ISEQ_FUNC);
switch ((enum rb_mjit_iseq_func)func_i) {
case NOT_ADDED_JIT_ISEQ_FUNC:
RB_DEBUG_COUNTER_INC(mjit_exec_not_added);
if (body->total_calls == mjit_opts.min_calls) {
rb_mjit_add_iseq_to_process(iseq);
if (UNLIKELY(mjit_opts.wait && (uintptr_t)body->jit_func > LAST_JIT_ISEQ_FUNC)) {
Expand All @@ -400,11 +399,7 @@ mjit_check_iseq(rb_execution_context_t *ec, const rb_iseq_t *iseq, struct rb_ise
}
break;
case NOT_READY_JIT_ISEQ_FUNC:
RB_DEBUG_COUNTER_INC(mjit_exec_not_ready);
break;
case NOT_COMPILED_JIT_ISEQ_FUNC:
RB_DEBUG_COUNTER_INC(mjit_exec_not_compiled);
break;
default: // to avoid warning with LAST_JIT_ISEQ_FUNC
break;
}
Expand Down Expand Up @@ -443,8 +438,6 @@ jit_exec(rb_execution_context_t *ec)
if (!(mjit_call_p || yjit_enabled))
return Qundef;

RB_DEBUG_COUNTER_INC(jit_exec);

mjit_func_t func = body->jit_func;

// YJIT tried compiling this function once before and couldn't do
Expand All @@ -454,23 +447,10 @@ jit_exec(rb_execution_context_t *ec)
}

if (UNLIKELY((uintptr_t)func <= LAST_JIT_ISEQ_FUNC)) {
# ifdef MJIT_HEADER
RB_DEBUG_COUNTER_INC(mjit_frame_JT2VM);
# else
RB_DEBUG_COUNTER_INC(mjit_frame_VM2VM);
# endif
return mjit_check_iseq(ec, iseq, body);
}

# ifdef MJIT_HEADER
RB_DEBUG_COUNTER_INC(mjit_frame_JT2JT);
# else
RB_DEBUG_COUNTER_INC(mjit_frame_VM2JT);
# endif
RB_DEBUG_COUNTER_INC(mjit_exec_call_func);
// Under SystemV x64 calling convention
// ec -> RDI
// cfp -> RSI
// Under SystemV x64 calling convention: ec -> RDI, cfp -> RSI
return func(ec, ec->cfp);
}
#endif
Expand Down

0 comments on commit 68e0523

Please sign in to comment.