Introduce --enable-rjit=disasm

This commit is contained in:
Takashi Kokubun 2023-04-27 14:27:51 -07:00
parent 5cd4f35da6
commit f2c367734f
2 changed files with 15 additions and 4 deletions

View File

@ -3890,7 +3890,7 @@ AC_ARG_ENABLE(rjit,
) )
AS_CASE(["$RJIT_SUPPORT"], AS_CASE(["$RJIT_SUPPORT"],
[yes|dev], [ [yes|dev|disasm], [
AS_CASE(["$RJIT_SUPPORT"], AS_CASE(["$RJIT_SUPPORT"],
[dev], [ [dev], [
# Link libcapstone for --rjit-dump-disasm # Link libcapstone for --rjit-dump-disasm
@ -3898,6 +3898,10 @@ AS_CASE(["$RJIT_SUPPORT"],
# Enable extra stats (vm_insns_count, ratio_in_rjit) # Enable extra stats (vm_insns_count, ratio_in_rjit)
AC_DEFINE(RJIT_STATS, 1) AC_DEFINE(RJIT_STATS, 1)
],
[disasm], [
# Link libcapstone for --rjit-dump-disasm
AC_CHECK_LIB([capstone], [cs_disasm])
]) ])
AC_DEFINE(USE_RJIT, 1) AC_DEFINE(USE_RJIT, 1)

View File

@ -22,8 +22,14 @@ You may still manually pass `--enable-rjit` to try RJIT on unsupported platforms
### --enable-rjit=dev ### --enable-rjit=dev
`--enable-rjit=dev` makes the interpreter slower, but enables `vm_insns_count` and `ratio_in_rjit` It enables `--rjit-dump-disasm` if libcapstone is available.
in `ruby --rjit-stats` to work.
It also enables `vm_insns_count` and `ratio_in_rjit` in `--rjit-stats`.
However, it makes the interpreter a little slower.
### --enable-rjit=disasm
It enables `--rjit-dump-disasm` if libcapstone is available.
## make ## make
### rjit-bindgen ### rjit-bindgen
@ -40,7 +46,8 @@ This prints RJIT stats at exit. Some stats are available only with `--enable-rji
### --rjit-dump-disasm ### --rjit-dump-disasm
This dumps all JIT code. You need to install libcapstone before configure. This dumps all JIT code. You need to install libcapstone before configure and use `--enable-rjit=dev`
or `--enable-rjit=disasm` on configure.
* Ubuntu: `sudo apt-get install -y libcapstone-dev` * Ubuntu: `sudo apt-get install -y libcapstone-dev`
* macOS: `brew install capstone` * macOS: `brew install capstone`