Skip to content

Commit 7ea0ffc

Browse files
committed
Update ZJIT docs
1 parent 66b2cc3 commit 7ea0ffc

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ A lot of work has gone into making Ractors more stable, performant, and usable.
384384
## JIT
385385
386386
* ZJIT
387-
* Introduce an experimental method-based JIT compiler.
387+
* Introduce an [experimental method-based JIT compiler](https://docs.ruby-lang.org/en/master/jit/zjit_md.html).
388388
To enable `--zjit` support, build Ruby with Rust 1.85.0 or later.
389389
* As of Ruby 4.0.0, ZJIT is faster than the interpreter, but not yet as fast as YJIT.
390390
We encourage experimentation with ZJIT, but advise against deploying it in production for now.

doc/jit/zjit.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,49 @@
11
# ZJIT: ADVANCED RUBY JIT PROTOTYPE
22

3+
ZJIT is a method-based just-in-time (JIT) compiler for Ruby. It uses profile
4+
information from the interpreter to guide optimization in the compiler.
5+
6+
ZJIT is currently supported for macOS, Linux and BSD on x86-64 and arm64/aarch64 CPUs.
7+
This project is open source and falls under the same license as CRuby.
8+
9+
## Current Limitations
10+
11+
ZJIT may not be suitable for certain applications. It currently only supports macOS, Linux and BSD on x86-64 and arm64/aarch64 CPUs. ZJIT will use more memory than the Ruby interpreter because the JIT compiler needs to generate machine code in memory and maintain additional state information.
12+
You can change how much executable memory is allocated using [ZJIT's command-line options](#command-line-options).
13+
314
## Build Instructions
415

16+
### For normal use
17+
18+
To build ZJIT on macOS:
19+
20+
```bash
21+
./autogen.sh
22+
23+
./configure \
24+
--enable-zjit \
25+
--prefix="$HOME"/.rubies/ruby-zjit \
26+
--disable-install-doc \
27+
--with-opt-dir="$(brew --prefix openssl):$(brew --prefix readline):$(brew --prefix libyaml)"
28+
29+
make -j miniruby
30+
```
31+
32+
To build ZJIT on Linux:
33+
34+
```bash
35+
./autogen.sh
36+
37+
./configure \
38+
--enable-zjit \
39+
--prefix="$HOME"/.rubies/ruby-zjit \
40+
--disable-install-doc
41+
42+
make -j miniruby
43+
```
44+
45+
### For development
46+
547
To build ZJIT on macOS:
648

749
```bash

0 commit comments

Comments
 (0)