зеркало из https://github.com/github/ruby.git
Add debug counters for MJIT
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
fe904f1eec
Коммит
bb5ab13bf5
|
@ -255,6 +255,14 @@ RB_DEBUG_COUNTER(theap_alloc)
|
||||||
RB_DEBUG_COUNTER(theap_alloc_fail)
|
RB_DEBUG_COUNTER(theap_alloc_fail)
|
||||||
RB_DEBUG_COUNTER(theap_evacuate)
|
RB_DEBUG_COUNTER(theap_evacuate)
|
||||||
|
|
||||||
|
/* mjit_exec() counts */
|
||||||
|
RB_DEBUG_COUNTER(mjit_exec)
|
||||||
|
RB_DEBUG_COUNTER(mjit_exec_call_func)
|
||||||
|
RB_DEBUG_COUNTER(mjit_exec_not_added)
|
||||||
|
RB_DEBUG_COUNTER(mjit_exec_not_added_add_iseq)
|
||||||
|
RB_DEBUG_COUNTER(mjit_exec_not_ready)
|
||||||
|
RB_DEBUG_COUNTER(mjit_exec_not_compiled)
|
||||||
|
|
||||||
/* load (not implemented yet) */
|
/* load (not implemented yet) */
|
||||||
/*
|
/*
|
||||||
RB_DEBUG_COUNTER(load_files)
|
RB_DEBUG_COUNTER(load_files)
|
||||||
|
|
8
mjit.h
8
mjit.h
|
@ -10,6 +10,7 @@
|
||||||
#define RUBY_MJIT_H 1
|
#define RUBY_MJIT_H 1
|
||||||
|
|
||||||
#include "ruby.h"
|
#include "ruby.h"
|
||||||
|
#include "debug_counter.h"
|
||||||
|
|
||||||
#if USE_MJIT
|
#if USE_MJIT
|
||||||
|
|
||||||
|
@ -101,6 +102,7 @@ mjit_exec(rb_execution_context_t *ec)
|
||||||
|
|
||||||
if (!mjit_call_p)
|
if (!mjit_call_p)
|
||||||
return Qundef;
|
return Qundef;
|
||||||
|
RB_DEBUG_COUNTER_INC(mjit_exec);
|
||||||
|
|
||||||
iseq = ec->cfp->iseq;
|
iseq = ec->cfp->iseq;
|
||||||
body = iseq->body;
|
body = iseq->body;
|
||||||
|
@ -110,7 +112,9 @@ mjit_exec(rb_execution_context_t *ec)
|
||||||
if (UNLIKELY((uintptr_t)func <= (uintptr_t)LAST_JIT_ISEQ_FUNC)) {
|
if (UNLIKELY((uintptr_t)func <= (uintptr_t)LAST_JIT_ISEQ_FUNC)) {
|
||||||
switch ((enum rb_mjit_iseq_func)func) {
|
switch ((enum rb_mjit_iseq_func)func) {
|
||||||
case NOT_ADDED_JIT_ISEQ_FUNC:
|
case NOT_ADDED_JIT_ISEQ_FUNC:
|
||||||
|
RB_DEBUG_COUNTER_INC(mjit_exec_not_added);
|
||||||
if (total_calls == mjit_opts.min_calls && mjit_target_iseq_p(body)) {
|
if (total_calls == mjit_opts.min_calls && mjit_target_iseq_p(body)) {
|
||||||
|
RB_DEBUG_COUNTER_INC(mjit_exec_not_added_add_iseq);
|
||||||
mjit_add_iseq_to_process(iseq);
|
mjit_add_iseq_to_process(iseq);
|
||||||
if (UNLIKELY(mjit_opts.wait)) {
|
if (UNLIKELY(mjit_opts.wait)) {
|
||||||
return mjit_wait_call(ec, body);
|
return mjit_wait_call(ec, body);
|
||||||
|
@ -118,13 +122,17 @@ mjit_exec(rb_execution_context_t *ec)
|
||||||
}
|
}
|
||||||
return Qundef;
|
return Qundef;
|
||||||
case NOT_READY_JIT_ISEQ_FUNC:
|
case NOT_READY_JIT_ISEQ_FUNC:
|
||||||
|
RB_DEBUG_COUNTER_INC(mjit_exec_not_ready);
|
||||||
|
return Qundef;
|
||||||
case NOT_COMPILED_JIT_ISEQ_FUNC:
|
case NOT_COMPILED_JIT_ISEQ_FUNC:
|
||||||
|
RB_DEBUG_COUNTER_INC(mjit_exec_not_compiled);
|
||||||
return Qundef;
|
return Qundef;
|
||||||
default: /* to avoid warning with LAST_JIT_ISEQ_FUNC */
|
default: /* to avoid warning with LAST_JIT_ISEQ_FUNC */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RB_DEBUG_COUNTER_INC(mjit_exec_call_func);
|
||||||
return func(ec, ec->cfp);
|
return func(ec, ec->cfp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче