Skip to content

Commit ca5385e

Browse files
authored
Update doc/jit/zjit.md
1 parent 98bcd54 commit ca5385e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

doc/jit/zjit.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,19 @@ stackprof path/to/zjit_exits_{pid}.dump
308308

309309
### Viewing HIR as text
310310

311-
The compiled zjit HIR can be viewed as text using the `--zjit-dump-hir` option. However, HIR will only be generated if the `zjit-call-threshold` is reached (default 30). By setting the threshold to 1 you can easily view the HIR for code snippets such as `1 + 1`:
311+
The compiled ZJIT HIR can be viewed as text using the `--zjit-dump-hir` option. However, HIR will only be generated if the call threshold is reached (default 30). By setting the threshold to 1 you can easily view the HIR for code snippets such as `1 + 1`:
312312

313313
```bash
314314
./miniruby --zjit --zjit-dump-hir --zjit-call-threshold=1 -e "1 + 1"
315315
```
316316

317+
Note that this disables profiling. To inject interpreter profiles into ZJIT, consider running your sample code 30 times:
318+
319+
```bash
320+
./miniruby --zjit --zjit-dump-hir -e "30.times { 1 + 1 }"
321+
```
322+
```
323+
317324
### Viewing HIR in Iongraph
318325
319326
Using `--zjit-dump-hir-iongraph` will dump all compiled functions into a directory named `/tmp/zjit-iongraph-{PROCESS_PID}`. Each file will be named `func_{ZJIT_FUNC_NAME}.json`. In order to use them in the Iongraph viewer, you'll need to use `jq` to collate them to a single file. An example invocation of `jq` is shown below for reference.

0 commit comments

Comments
 (0)