diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-06 23:17:25 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-06 23:44:01 -0800 |
commit | 23ec248e48f696ae986e2b19cd572ece02a5ba55 (patch) | |
tree | 3973e15ea1c34d000b40a64bd64e78880f28efec /process.c | |
parent | 2e875549a934fa04b7939810fa0d8a2762702aaa (diff) |
s/mjit/rjit/
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7462
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 40 |
1 files changed, 20 insertions, 20 deletions
@@ -109,7 +109,7 @@ int initgroups(const char *, rb_gid_t); #include "internal/thread.h" #include "internal/variable.h" #include "internal/warnings.h" -#include "mjit.h" +#include "rjit.h" #include "ruby/io.h" #include "ruby/st.h" #include "ruby/thread.h" @@ -1080,12 +1080,12 @@ void rb_sigwait_fd_put(const rb_thread_t *, int fd); void rb_thread_sleep_interruptible(void); #if USE_RJIT -static struct waitpid_state mjit_waitpid_state; +static struct waitpid_state rjit_waitpid_state; // variables shared with thread.c // TODO: implement the same thing with postponed_job and obviate these variables -bool mjit_waitpid_finished = false; -int mjit_waitpid_status = 0; +bool rjit_waitpid_finished = false; +int rjit_waitpid_status = 0; #endif static int @@ -1096,9 +1096,9 @@ waitpid_signal(struct waitpid_state *w) return TRUE; } #if USE_RJIT - else if (w == &mjit_waitpid_state && w->ret) { /* mjit_add_waiting_pid */ - mjit_waitpid_finished = true; - mjit_waitpid_status = w->status; + else if (w == &rjit_waitpid_state && w->ret) { /* rjit_add_waiting_pid */ + rjit_waitpid_finished = true; + rjit_waitpid_status = w->status; return TRUE; } #endif @@ -1202,11 +1202,11 @@ waitpid_state_init(struct waitpid_state *w, rb_pid_t pid, int options) * must be called with vm->waitpid_lock held, this is not interruptible */ void -mjit_add_waiting_pid(rb_vm_t *vm, rb_pid_t pid) +rjit_add_waiting_pid(rb_vm_t *vm, rb_pid_t pid) { - waitpid_state_init(&mjit_waitpid_state, pid, 0); - mjit_waitpid_state.ec = 0; // switch the behavior of waitpid_signal - ccan_list_add(&vm->waiting_pids, &mjit_waitpid_state.wnode); + waitpid_state_init(&rjit_waitpid_state, pid, 0); + rjit_waitpid_state.ec = 0; // switch the behavior of waitpid_signal + ccan_list_add(&vm->waiting_pids, &rjit_waitpid_state.wnode); } #endif @@ -1250,7 +1250,7 @@ waitpid_wait(struct waitpid_state *w) /* * Lock here to prevent do_waitpid from stealing work from the - * ruby_waitpid_locked done by mjit workers since mjit works + * ruby_waitpid_locked done by rjit workers since rjit works * outside of GVL */ rb_native_mutex_lock(&vm->waitpid_lock); @@ -3078,7 +3078,7 @@ rb_f_exec(int argc, const VALUE *argv) execarg_obj = rb_execarg_new(argc, argv, TRUE, FALSE); eargp = rb_execarg_get(execarg_obj); - if (mjit_enabled) mjit_finish(false); // avoid leaking resources, and do not leave files. XXX: JIT-ed handle can leak after exec error is rescued. + if (rjit_enabled) rjit_finish(false); // avoid leaking resources, and do not leave files. XXX: JIT-ed handle can leak after exec error is rescued. before_exec(); /* stop timer thread before redirects */ rb_protect(rb_execarg_parent_start1, execarg_obj, &state); @@ -4190,7 +4190,7 @@ retry_fork_async_signal_safe(struct rb_process_status *status, int *ep, #if USE_RJIT // This is used to create RJIT's child Ruby process pid_t -rb_mjit_fork(void) +rb_rjit_fork(void) { struct child_handler_disabler_state old; rb_vm_t *vm = GET_VM(); @@ -4200,7 +4200,7 @@ rb_mjit_fork(void) rb_native_mutex_lock(&vm->waitpid_lock); pid_t pid = rb_fork(); - if (pid > 0) mjit_add_waiting_pid(vm, pid); + if (pid > 0) rjit_add_waiting_pid(vm, pid); rb_native_mutex_unlock(&vm->waitpid_lock); after_fork_ruby(); @@ -4297,7 +4297,7 @@ rb_fork_ruby2(struct rb_process_status *status) while (1) { prefork(); - if (mjit_enabled) mjit_pause(false); // Don't leave locked mutex to child. Note: child_handler must be enabled to pause RJIT. + if (rjit_enabled) rjit_pause(false); // Don't leave locked mutex to child. Note: child_handler must be enabled to pause RJIT. disable_child_handler_before_fork(&old); before_fork_ruby(); pid = rb_fork(); @@ -4309,7 +4309,7 @@ rb_fork_ruby2(struct rb_process_status *status) after_fork_ruby(); disable_child_handler_fork_parent(&old); /* yes, bad name */ - if (mjit_enabled && pid > 0) mjit_resume(); /* child (pid == 0) is cared by rb_thread_atfork */ + if (rjit_enabled && pid > 0) rjit_resume(); /* child (pid == 0) is cared by rb_thread_atfork */ if (pid >= 0) { /* fork succeed */ if (pid == 0) rb_thread_atfork(); @@ -4722,7 +4722,7 @@ rb_execarg_spawn(VALUE execarg_obj, char *errmsg, size_t errmsg_buflen) * Prevent a race with RJIT where the compiler process where * can hold an FD of ours in between vfork + execve */ - if (!eargp->waitpid_state && mjit_enabled) { + if (!eargp->waitpid_state && rjit_enabled) { eargp->waitpid_state = WAITPID_LOCK_ONLY; } @@ -7088,11 +7088,11 @@ rb_daemon(int nochdir, int noclose) { int err = 0; #ifdef HAVE_DAEMON - if (mjit_enabled) mjit_pause(false); // Don't leave locked mutex to child. + if (rjit_enabled) rjit_pause(false); // Don't leave locked mutex to child. before_fork_ruby(); err = daemon(nochdir, noclose); after_fork_ruby(); - rb_thread_atfork(); /* calls mjit_resume() */ + rb_thread_atfork(); /* calls rjit_resume() */ #else int n; |