Commit graph

21 commits

Author SHA1 Message Date
Alan Wu
92b218fbc3 YJIT: ZJIT: Allow both JITs in the same build
This commit allows building YJIT and ZJIT simultaneously, a "combo
build". Previously, `./configure --enable-yjit --enable-zjit` failed. At
runtime, though, only one of the two can be enabled at a time.

Add a root Cargo workspace that contains both the yjit and zjit crate.
The common Rust build integration mechanisms are factored out into
defs/jit.mk.

Combo YJIT+ZJIT dev builds are supported; if either JIT uses
`--enable-*=dev`, both of them are built in dev mode.

The combo build requires Cargo, but building one JIT at a time with only
rustc in release build remains supported.
2025-05-15 00:39:03 +09:00
Alan Wu
545aafa2a2
ZJIT: Add make zjit-test-lldb [ci skip]
Handy for dropping into LLDB for a Rust test.
2025-04-30 19:49:54 +09:00
Takashi Kokubun
5a35c47c82 Stop sharing yjit/bindgen with ZJIT (https://github.com/Shopify/zjit/pull/64)
* cp -r yjit/bindgen zjit/

* Rename YJIT variables

* Stop mentioning YJIT in zjit.c
2025-04-18 21:53:00 +09:00
Takashi Kokubun
9137e24b54 Add a make target to run all ZJIT tests (https://github.com/Shopify/zjit/pull/49)
* Add a make target to run all ZJIT tests

* Remove an unused variable

* Write up a document about testing

* Explain zjit-test-all first

* Clarify what's zjit-test-all
2025-04-18 21:52:59 +09:00
Takashi Kokubun
8b2a4625cb Profile instructions for fixnum arithmetic (https://github.com/Shopify/zjit/pull/24)
* Profile instructions for fixnum arithmetic

* Drop PartialEq from Type

* Do not push PatchPoint onto the stack

* Avoid pushing the output of the guards

* Pop operands after guards

* Test HIR from profiled runs

* Implement Display for new instructions

* Drop unused FIXNUM_BITS

* Use a Rust function to split lines

* Use Display for GuardType operands

Co-authored-by: Max Bernstein <max@bernsteinbear.com>

* Fix tests with Display-ed values

---------

Co-authored-by: Max Bernstein <max@bernsteinbear.com>
2025-04-18 21:52:59 +09:00
Alan Wu
5cbaa2288e Mention that the linker warnings were from capstone. 2025-04-18 21:52:58 +09:00
Alan Wu
24b29afc5a Try macOS linker warning fix 2025-04-18 21:52:58 +09:00
Alan Wu
3f68bcdeb1 Explain libminiruby 2025-04-18 21:52:58 +09:00
Alan Wu
42c1434f9b put libminiruby next to zjit-test 2025-04-18 21:52:58 +09:00
Alan Wu
3fbb4b0953 zjit-test requires cargo 2025-04-18 21:52:58 +09:00
Alan Wu
1ac465f858 copyedit comment 2025-04-18 21:52:58 +09:00
Alan Wu
20ec3c8033 add make zjit-test 2025-04-18 21:52:57 +09:00
Alan Wu
4326b0cece boot_vm boots and runs 2025-04-18 21:52:57 +09:00
Takashi Kokubun
c1199714ed Revert "Suppress ld's macOS version warnings"
This reverts commit 47b810cdb7b2604cf0e83a9e68ebc4a02dbc37db.

It seems to break the CI.
2025-04-18 21:52:57 +09:00
Takashi Kokubun
5b5d54f886 Suppress ld's macOS version warnings 2025-04-18 21:52:57 +09:00
Takashi Kokubun
92d48f47a3 Use separate cargo build flags 2025-04-18 21:52:57 +09:00
Alan Wu
14a4edaea6 bindgen works in --enable-zjit=dev mode. 2025-04-18 21:52:56 +09:00
Takashi Kokubun
9ddce45c7d Fix duplicated make target names 2025-04-18 21:52:56 +09:00
Alan Wu
106b328117 make zjit-bindgen runs, but doesn't graft the right things yet 2025-04-18 21:52:56 +09:00
Takashi Kokubun
8ad08f1126 Fix template/Makefile.in 2025-04-18 21:52:55 +09:00
Takashi Kokubun
82606faaea Add zjit.mk 2025-04-18 21:52:55 +09:00