ruby-changes:74480
From: Takashi <ko1@a...>
Date: Mon, 14 Nov 2022 07:41:54 +0900 (JST)
Subject: [ruby-changes:74480] e377875cff (master): s/mjit_func_t/jit_func_t/
https://git.ruby-lang.org/ruby.git/commit/?id=e377875cff From e377875cff5dd93758296180c3bd6a35c3bbbc12 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Sun, 13 Nov 2022 14:41:08 -0800 Subject: s/mjit_func_t/jit_func_t/ --- mjit.c | 18 +++++++++--------- mjit.h | 2 +- vm.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mjit.c b/mjit.c index 075c30fb67..d1a9e71f4f 100644 --- a/mjit.c +++ b/mjit.c @@ -349,7 +349,7 @@ static void https://github.com/ruby/ruby/blob/trunk/mjit.c#L349 free_unit(struct rb_mjit_unit *unit) { if (unit->iseq) { // ISeq is not GCed - ISEQ_BODY(unit->iseq)->jit_func = (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; + ISEQ_BODY(unit->iseq)->jit_func = (jit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; ISEQ_BODY(unit->iseq)->jit_unit = NULL; } if (unit->cc_entries) { @@ -786,7 +786,7 @@ load_compact_funcs_from_so(struct rb_mjit_unit *unit, char *c_file, char *so_fil https://github.com/ruby/ruby/blob/trunk/mjit.c#L786 if (cur->iseq) { // Check whether GCed or not // Usage of jit_code might be not in a critical section. - MJIT_ATOMIC_SET(ISEQ_BODY(cur->iseq)->jit_func, (mjit_func_t)func); + MJIT_ATOMIC_SET(ISEQ_BODY(cur->iseq)->jit_func, (jit_func_t)func); } } verbose(1, "JIT compaction (%.1fms): Compacted %d methods %s -> %s", end_time - current_cc_ms, active_units.length, c_file, so_file); @@ -1175,7 +1175,7 @@ check_unit_queue(void) https://github.com/ruby/ruby/blob/trunk/mjit.c#L1175 current_cc_pid = start_mjit_compile(unit); if (current_cc_pid == -1) { // JIT failure current_cc_pid = 0; - current_cc_unit->iseq->body->jit_func = (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; // TODO: consider unit->compact_p + current_cc_unit->iseq->body->jit_func = (jit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; // TODO: consider unit->compact_p current_cc_unit = NULL; return; } @@ -1250,7 +1250,7 @@ mjit_notify_waitpid(int exit_code) https://github.com/ruby/ruby/blob/trunk/mjit.c#L1250 if (exit_code != 0) { verbose(2, "Failed to generate so"); if (!current_cc_unit->compact_p) { - current_cc_unit->iseq->body->jit_func = (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; + current_cc_unit->iseq->body->jit_func = (jit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; } free_unit(current_cc_unit); current_cc_unit = NULL; @@ -1329,7 +1329,7 @@ mjit_hook_custom_compile(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/mjit.c#L1329 VALUE iseq_class = rb_funcall(rb_mMJITC, rb_intern("rb_iseq_t"), 0); VALUE iseq_ptr = rb_funcall(iseq_class, rb_intern("new"), 1, ULONG2NUM((size_t)iseq)); VALUE jit_func = rb_funcall(rb_mMJIT, rb_intern("compile"), 1, iseq_ptr); - ISEQ_BODY(iseq)->jit_func = (mjit_func_t)NUM2ULONG(jit_func); + ISEQ_BODY(iseq)->jit_func = (jit_func_t)NUM2ULONG(jit_func); mjit_call_p = original_call_p; } @@ -1346,12 +1346,12 @@ mjit_add_iseq_to_process(const rb_iseq_t *iseq, const struct rb_mjit_compile_inf https://github.com/ruby/ruby/blob/trunk/mjit.c#L1346 return; } if (!mjit_target_iseq_p(iseq)) { - ISEQ_BODY(iseq)->jit_func = (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; // skip mjit_wait + ISEQ_BODY(iseq)->jit_func = (jit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; // skip mjit_wait return; } RB_DEBUG_COUNTER_INC(mjit_add_iseq_to_process); - ISEQ_BODY(iseq)->jit_func = (mjit_func_t)NOT_READY_JIT_ISEQ_FUNC; + ISEQ_BODY(iseq)->jit_func = (jit_func_t)NOT_READY_JIT_ISEQ_FUNC; create_unit(iseq); if (ISEQ_BODY(iseq)->jit_unit == NULL) // Failure in creating the unit. @@ -1384,11 +1384,11 @@ mjit_wait(struct rb_iseq_constant_body *body) https://github.com/ruby/ruby/blob/trunk/mjit.c#L1384 int tries = 0; tv.tv_sec = 0; tv.tv_usec = 1000; - while (body == NULL ? current_cc_pid == initial_pid : body->jit_func == (mjit_func_t)NOT_READY_JIT_ISEQ_FUNC) { // TODO: refactor this + while (body == NULL ? current_cc_pid == initial_pid : body->jit_func == (jit_func_t)NOT_READY_JIT_ISEQ_FUNC) { // TODO: refactor this tries++; if (tries / 1000 > MJIT_WAIT_TIMEOUT_SECONDS || pch_status == PCH_FAILED) { if (body != NULL) { - body->jit_func = (mjit_func_t) NOT_COMPILED_JIT_ISEQ_FUNC; // JIT worker seems dead. Give up. + body->jit_func = (jit_func_t) NOT_COMPILED_JIT_ISEQ_FUNC; // JIT worker seems dead. Give up. } mjit_warning("timed out to wait for JIT finish"); break; diff --git a/mjit.h b/mjit.h index 7211e460ab..7b5ca54c6f 100644 --- a/mjit.h +++ b/mjit.h @@ -79,7 +79,7 @@ struct rb_mjit_compile_info { https://github.com/ruby/ruby/blob/trunk/mjit.h#L79 bool disable_const_cache; }; -typedef VALUE (*mjit_func_t)(rb_execution_context_t *, rb_control_frame_t *); +typedef VALUE (*jit_func_t)(rb_execution_context_t *, rb_control_frame_t *); RUBY_SYMBOL_EXPORT_BEGIN RUBY_EXTERN struct mjit_options mjit_opts; diff --git a/vm.c b/vm.c index b441d70716..87c6b47825 100644 --- a/vm.c +++ b/vm.c @@ -438,7 +438,7 @@ jit_exec(rb_execution_context_t *ec) https://github.com/ruby/ruby/blob/trunk/vm.c#L438 if (!(mjit_call_p || yjit_enabled)) return Qundef; - mjit_func_t func = body->jit_func; + jit_func_t func = body->jit_func; // YJIT tried compiling this function once before and couldn't do // it, so return Qundef so the interpreter handles it. -- cgit v1.2.3 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/