summaryrefslogtreecommitdiff
path: root/mjit.c
AgeCommit message (Collapse)Author
2022-10-18Allow passing a Rust closure to rb_iseq_callback (#6575)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-10-17Make mjit_cont sharable with YJIT (#6556)Takashi Kokubun
* Make mjit_cont sharable with YJIT * Update dependencies * Update YJIT binding Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-09-26Rework vm_core to use `int first_lineno` struct member.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/6430
2022-09-07Fix typoTakashi Kokubun
I meant the other one. Otherwise this option doesn't make sense.
2022-09-06Adjust pch_status for --mjit=pauseTakashi Kokubun
to let mjit_add_iseq_to_process work
2022-09-06Skip early mjit_add_iseq_to_process on --mjit=pauseTakashi Kokubun
2022-09-06Skip calling check_unit_queue with mjit_opts.customTakashi Kokubun
fixing the behavior of b726c06e7eeafff52e368179dbe79a11b1aff975
2022-09-06Allow hooking a different method after --mjit=pauseTakashi Kokubun
The interface is similar to RubyVM::ISeq.translate; it's used if defined. Same as --mjit=pause, this is an undocumented feature for MJIT experiments.
2022-09-06Cache RubyVM::MJIT constantsTakashi Kokubun
for performance
2022-09-06Add an option to lazily boot MJIT for experimentsTakashi Kokubun
You may use `RUBYOPT=--mjit=pause irb` to play with RubyVM::MJIT::C, control the boot timing of MJIT, or customize the implementation while paused. It's an undocumented feature for such experiments.
2022-09-06Do not fork the process on --mjit-waitTakashi Kokubun
fork is for parallel compilation, but --mjit-wait cancels it. It's more useful to not fork it for binding.irb, debugging, etc.
2022-09-05Deal with MJIT_FORCE_ENABLE minirubyTakashi Kokubun
http://ci.rvm.jp/results/trunk-mjit@phosphorus-docker/4225469
2022-09-04Ruby MJIT (#6028)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-09-04Call appropriate hooks on MJIT's forkTakashi Kokubun
This takes care of signal_self_pipe and other things.
2022-09-03Prefer stdbool for MJIT optionsTakashi Kokubun
same motivation as d6f21b308bcff03e82f8b3dbf11a852ce111b3b3
2022-08-21Use `rb_fork` to suppress deprecated-declarations warningsNobuyoshi Nakada
2022-08-20Drop mswin support of MJIT (#6265)Takashi Kokubun
The current MJIT relies on SIGCHLD and fork(2) to be performant, and it's something mswin can't offer. You could run Linux MJIT on WSL instead. [Misc #18968] Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-08-20Execute MJIT in a forked Ruby process (#6264)Takashi Kokubun
[Misc #18968] Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-08-04Add `-bundle_loader` to mjit compilation args on macOSYuta Saito
Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-07-27Adjust styles [ci skip]Nobuyoshi Nakada
2022-07-14MJIT: Share rb_mjit_unit through mjit_unit.hTakashi Kokubun
mjit_compile.c should be able to access this more easily. Notes: Merged: https://github.com/ruby/ruby/pull/6140
2022-07-14MJIT: Merge mjit_worker.c back to mjit.c (#6138)Takashi Kokubun
Since #6006, we no longer avoid executing GC on mjit_worker.c and thus there's no need to carefully change how we write code whether you're in mjit.c or mjit_worker.c anymore. Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-07-11MJIT: s/assert/VM_ASSERT/Takashi Kokubun
include/ruby/assert.h sets NDEBUG by default. As MJIT CI uses -DVM_CHECK_MODE, using only VM_ASSERT might be more helpful.
2022-06-16MJIT: Consider compaction on CC failureTakashi Kokubun
2022-06-15MJIT: Handle compaction units on stop_workerTakashi Kokubun
2022-06-15MJIT: Get rid of obsoleted compiling_iseqsTakashi Kokubun
2022-06-15MJIT: Deal with mjit_free_iseq on mjit_notify_waitpidTakashi Kokubun
2022-06-15MJIT: Fix test_jit_failure for mswinTakashi Kokubun
2022-06-15MJIT: Handle C compiler failuresTakashi Kokubun
2022-06-15MJIT: Handle JIT failure properlyTakashi Kokubun
2022-06-15Remove unused rb_thread_create_mjit_threadTakashi Kokubun
follow up https://github.com/ruby/ruby/pull/6006
2022-06-15Move RubyVM::MJIT to builtin RubyTakashi Kokubun
just less C code to maintain
2022-06-15Remove MJIT worker thread (#6006)Takashi Kokubun
[Misc #18830] Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-06-13Drop MinGW support of MJIT (#6012)Takashi Kokubun
[Feature #18824] Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-03-30Prefix ccan headers (#4568)Nobuyoshi Nakada
* Prefixed ccan headers * Remove unprefixed names in ccan/build_assert * Remove unprefixed names in ccan/check_type * Remove unprefixed names in ccan/container_of * Remove unprefixed names in ccan/list Co-authored-by: Samuel Williams <samuel.williams@oriontransfer.co.nz> Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-03-24Add ISEQ_BODY macroPeter Zhu
Use ISEQ_BODY macro to get the rb_iseq_constant_body of the ISeq. Using this macro will make it easier for us to change the allocation strategy of rb_iseq_constant_body when using Variable Width Allocation. Notes: Merged: https://github.com/ruby/ruby/pull/5698
2022-01-15Transfer the responsibility for MJIT options to mjit.cNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5448
2021-08-13Revert "Pause an MJIT worker when JIT is cancelled"Takashi Kokubun
This reverts commit b64f81c81729bbc248d19af01cafde88eb60fdc7. It seems to cause a problem in --jit / --jit-wait CIs. Reverting for now.
2021-08-12Don't run mjit_cancel_all when MJIT is disabledTakashi Kokubun
2021-08-12Pause an MJIT worker when JIT is cancelledTakashi Kokubun
2021-08-12Print JIT cancel when all JIT-ed code is cancelledTakashi Kokubun
2021-06-10Cast jit_func for WindowsTakashi Kokubun
https://ci.appveyor.com/project/ruby/ruby/builds/39542385/job/8b7aq951f9t01x4x
2021-06-10Avoid enqueueing the same ISeq twiceTakashi Kokubun
by a race condition by multiple Ractors. Atmically incrementing body->total_calls may have its own cost, so for now we intentionally leave the unreliable total_calls. So we allow an ISeq to be never pushed when you use multiple Ractors. However, if you enqueue a single ccan node twice, get_from_list loops infinitely. Thus this patch takes care of such a situation.
2021-06-02Do not doubly hold an MJIT lockTakashi Kokubun
This is a follow-up of 86c262541ad07528842d76dab4b9b34bd888d5f4. CRITICAL_SECTION_START/FINISH are not needed when it's called from an MJIT worker. Also, ZALLOC needs to be calloc because ZALLOC may trigger GC, which an MJIT worker must not do.
2021-06-02Fix a race condition around mjit_recompileTakashi Kokubun
This fixes SEGVs like https://github.com/ruby/ruby/runs/2715166621?check_suite_focus=true. When mjit_recompile is called when mjit_compile is compiling the exact same iseq (and after it called mjit_capture_cc_entries), iseq->body->jit_unit is re-created and its cc_entries becomes NULL. Then, when it tries to lookup cc_entries through iseq->body->jit_unit, it fails.
2021-05-31Change the default --jit-max-cache to 10000Takashi Kokubun
This is useful for large applications like Rails. https://k0kubun.medium.com/ruby-3-jit-can-make-rails-faster-756310f235a
2021-05-31Drop JIT_ISEQ_SIZE_THRESHOLDTakashi Kokubun
Compiling everything seems to contributed to improving the final performance in general. MJIT's compilation is slow anyway, especially when you need to wait for JIT compaction. This might make sense for short-time benchmarks like Optcarrot with default parameters, but it didn't give benefits in my local environment.
2021-05-30Mark inlined ISeqs during MJIT compilation (#4539)Takashi Kokubun
[Bug #17584] Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2021-01-05enable constant cache on ractorsKoichi Sasada
constant cache `IC` is accessed by non-atomic manner and there are thread-safety issues, so Ruby 3.0 disables to use const cache on non-main ractors. This patch enables it by introducing `imemo_constcache` and allocates it by every re-fill of const cache like `imemo_callcache`. [Bug #17510] Now `IC` only has one entry `IC::entry` and it points to `iseq_inline_constant_cache_entry`, managed by T_IMEMO object. `IC` is atomic data structure so `rb_mjit_before_vm_ic_update()` and `rb_mjit_after_vm_ic_update()` is not needed. Notes: Merged: https://github.com/ruby/ruby/pull/4022
2021-01-04Skip mjit_wait if iseq is not a targetTakashi Kokubun