2023-03-10 07:57:06 +03:00
|
|
|
# RJIT: Ruby JIT
|
2022-09-05 09:12:37 +03:00
|
|
|
|
2023-03-07 10:15:30 +03:00
|
|
|
This document has some tips that might be useful when you work on RJIT.
|
2022-09-05 09:12:37 +03:00
|
|
|
|
2023-03-10 07:57:06 +03:00
|
|
|
## Project purpose
|
|
|
|
|
|
|
|
This project is for experimental purposes.
|
|
|
|
For production deployment, consider using YJIT instead.
|
|
|
|
|
2022-09-05 09:12:37 +03:00
|
|
|
## Supported platforms
|
|
|
|
|
2023-03-08 10:30:49 +03:00
|
|
|
The following platforms are assumed to work. `linux-x86_64` is tested on CI.
|
2022-09-05 09:12:37 +03:00
|
|
|
|
2023-03-08 10:30:49 +03:00
|
|
|
* OS: Linux, macOS, BSD
|
|
|
|
* Arch: x86\_64
|
2022-09-05 09:12:37 +03:00
|
|
|
|
2023-03-10 22:27:04 +03:00
|
|
|
## configure
|
|
|
|
### --enable-rjit
|
|
|
|
|
|
|
|
On supported platforms, `--enable-rjit` is set by default. You usually don't need to specify this.
|
|
|
|
You may still manually pass `--enable-rjit` to try RJIT on unsupported platforms.
|
|
|
|
|
|
|
|
### --enable-rjit=dev
|
2022-09-05 09:12:37 +03:00
|
|
|
|
2023-04-28 00:27:51 +03:00
|
|
|
It enables `--rjit-dump-disasm` if libcapstone is available.
|
|
|
|
|
2023-03-10 22:27:04 +03:00
|
|
|
## make
|
|
|
|
### rjit-bindgen
|
2022-09-05 09:12:37 +03:00
|
|
|
|
2023-03-07 10:15:30 +03:00
|
|
|
If you see an "RJIT bindgen" GitHub Actions failure, please commit the `git diff` shown on the failed job.
|
2022-09-05 09:12:37 +03:00
|
|
|
|
2023-03-07 10:17:25 +03:00
|
|
|
For doing the same thing locally, run `make rjit-bindgen` after installing libclang.
|
2022-12-22 22:14:58 +03:00
|
|
|
macOS seems to have libclang by default. On Ubuntu, you can install it with `apt install libclang1`.
|
2022-09-05 09:12:37 +03:00
|
|
|
|
2023-03-10 22:27:04 +03:00
|
|
|
## ruby
|
|
|
|
### --rjit-stats
|
2022-09-05 09:12:37 +03:00
|
|
|
|
2023-12-22 03:18:30 +03:00
|
|
|
This prints RJIT stats at exit.
|
2022-09-05 09:12:37 +03:00
|
|
|
|
2023-03-10 22:27:04 +03:00
|
|
|
### --rjit-dump-disasm
|
2022-09-05 09:12:37 +03:00
|
|
|
|
2023-12-22 03:18:30 +03:00
|
|
|
This dumps all JIT code. You need to install libcapstone before configure and use `--enable-rjit=dev` on configure.
|
2022-09-05 09:12:37 +03:00
|
|
|
|
2023-03-10 22:27:04 +03:00
|
|
|
* Ubuntu: `sudo apt-get install -y libcapstone-dev`
|
|
|
|
* macOS: `brew install capstone`
|