You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Learning about the HIR format is difficult if you can't get zjit to
generate it for code snippets. It's not obvious to newcomers that HIR
won't be generated unless the `zjit-call-threshold` is reached (default
30).
Copy file name to clipboardExpand all lines: doc/jit/zjit.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -306,6 +306,14 @@ A file called `zjit_exits_{pid}.dump` will be created in the same directory as `
306
306
stackprof path/to/zjit_exits_{pid}.dump
307
307
```
308
308
309
+
### Viewing HIR as text
310
+
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`:
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