91202 Commits

Author SHA1 Message Date
Alan Wu
9e31d29e0e Tell GitHub that *.inc.rs files are generated
... and rename hir_type_generated.rs so it gets picked up by the
glob.

This mostly changes how GitHub renders diffs for generated files on
the web interface.

See: https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github
2025-04-18 21:52:59 +09:00
Max Bernstein
91114b9933 Write all bits in Type as easy-to-read names 2025-04-18 21:52:59 +09:00
Max Bernstein
ec41dffd05 Add compact Type lattice
This will be used for local type inference and potentially SCCP.
2025-04-18 21:52:59 +09:00
Takashi Kokubun
0a543daf15 Add zjit_* instructions to profile the interpreter (https://github.com/Shopify/zjit/pull/16)
* Add zjit_* instructions to profile the interpreter

* Rename FixnumPlus to FixnumAdd

* Update a comment about Invalidate

* Rename Guard to GuardType

* Rename Invalidate to PatchPoint

* Drop unneeded debug!()

* Plan on profiling the types

* Use the output of GuardType as type refined outputs
2025-04-18 21:52:59 +09:00
Takashi Kokubun
30db473389 Compile Insn::Const (https://github.com/Shopify/zjit/pull/18)
* Compile Insn::Const

* Update the comment on JITState

* Print insn index like YJIT

* Wrap and unwrap InsnId
2025-04-18 21:52:59 +09:00
Takashi Kokubun
3c38ad605a Rename --zjit-dump-ssa to --zjit-dump-hir (https://github.com/Shopify/zjit/pull/17)
* Rename --zjit-dump-ssa to --zjit-dump-hir

* Update comments

* Add a comment on iseq_to_hir
2025-04-18 21:52:59 +09:00
Takashi Kokubun
e4d4ee7517 Fix inconsistent triggers of workflows
This is another left-over from https://github.com/Shopify/zjit/pull/12.
No reason to duplicate jobs for PRs.
2025-04-18 21:52:59 +09:00
Takashi Kokubun
c443e538b6 Fix inconsistent workflow settings
This is a left-over from https://github.com/Shopify/zjit/pull/12.
It was supposed to be removed from both workflows in the PR, but this
was somehow uncommitted.
2025-04-18 21:52:59 +09:00
Alan Wu
bd0f63507d Use rustup to get 1.85.0 since GitHub's image doesn't have it 2025-04-18 21:52:59 +09:00
Alan Wu
b8f49888a4 Avoid setting RUST_BACKTRACE environment while panicking
The 2024 edition pointed out that setting env vars in multiple threaded
programs is unsafe, due to it being thread unsafe in glibc. Sure don't
want to crash while already crashing! Always grab a backtrace with
force_backtrace().
2025-04-18 21:52:59 +09:00
Alan Wu
e24be0b8d5 Upgrade bindgen, so it generates unsafe extern as 2024 expects 2025-04-18 21:52:59 +09:00
Alan Wu
26e15ed629 Fix 2024 edition errors 2025-04-18 21:52:59 +09:00
Alan Wu
e5d4769bc5 Bump to Rust 1.85.0, 2024 edition 2025-04-18 21:52:59 +09:00
Max Bernstein
949ef70c5d Make pattern match clearer with global 2025-04-18 21:52:59 +09:00
Max Bernstein
778b67e50d Pretty-print Const 2025-04-18 21:52:59 +09:00
Max Bernstein
cdf16b7393 Add sample union-find implementation 2025-04-18 21:52:59 +09:00
Max Bernstein
fcaa7665c9 Remove Opnd 2025-04-18 21:52:58 +09:00
Max Bernstein
25a36aaf5e Fix ep_offset locals math
Thanks to @xrxr for explaining all of the "kindergarten" math :)
2025-04-18 21:52:58 +09:00
Takashi Kokubun
e4fc29785e Rename backend::Opnd to backend::lir::Opnd (https://github.com/Shopify/zjit/pull/13) 2025-04-18 21:52:58 +09:00
Takashi Kokubun
e68f5a1816 Add result CI job to enable auto-merge (https://github.com/Shopify/zjit/pull/12)
* Add `result` CI job to enable auto-merge

* Avoid triggering duplicated jobs on PRs

* Drop cancel-in-progress

We don't run as many jobs as ruby/ruby CI. We shouldn't need this here.

* Fix a typo

* Drop the concurrency group too

Similarly, we shouldn't need this in the Shopify/zjit repo
2025-04-18 21:52:58 +09:00
Takashi Kokubun
fe93c27da5 Add asm comments 2025-04-18 21:52:58 +09:00
Takashi Kokubun
5ee11d515b Fix zjit-test 2025-04-18 21:52:58 +09:00
Takashi Kokubun
562c35a560 Resurrect asm comment support 2025-04-18 21:52:58 +09:00
Takashi Kokubun
53bee25068 Implement --zjit-call-threshold
As a preparation for introducing a profiling layer, we need to be able
to raise the threshold to run a few cycles for profiling.
2025-04-18 21:52:58 +09:00
Takashi Kokubun
06d875b979 Backport the latest jit_compile() 2025-04-18 21:52:58 +09:00
Alan Wu
3e49f3304d remove duplicate yarv_frames.md 2025-04-18 21:52:58 +09:00
Alan Wu
b6e4b37c44 Add explainer for YARV frame layout
Just a first step. Have a read, and let's improve it together.

Close: GH-6
2025-04-18 21:52:58 +09:00
Maxime Chevalier-Boisvert
9644b17279 Add minor comments 2025-04-18 21:52:58 +09:00
Maxime Chevalier-Boisvert
ce9c9e0a6a Rename ir.rs to hir.rs to avoid namespace ambiguity with backend 2025-04-18 21:52:58 +09:00
Takashi Kokubun
22eec65928 Recommend the same task as what CI uses 2025-04-18 21:52:58 +09:00
Max Bernstein
ccbf4441de Add comments for Test and Snapshot 2025-04-18 21:52:58 +09:00
Takashi Kokubun
24f8a78709 btest jobs are now passing 2025-04-18 21:52:58 +09:00
Takashi Kokubun
d68f878976 Ignore btest failures for now 2025-04-18 21:52:58 +09:00
Takashi Kokubun
93f67e24d2 Add a missing use for release build 2025-04-18 21:52:58 +09:00
Takashi Kokubun
bf565fd418 Add --zjit-debug and debug! macro
to print debug messages
2025-04-18 21:52:58 +09:00
Takashi Kokubun
83da2dd1ea Try to fix the BTESTS path 2025-04-18 21:52:58 +09:00
Takashi Kokubun
5321e1479d Rename backend::ir to backend
because it's so confusing to have ir.rs in multiple places.
2025-04-18 21:52:58 +09:00
Takashi Kokubun
ec35162536 Fix BTESTS path 2025-04-18 21:52:58 +09:00
Alan Wu
5cbaa2288e Mention that the linker warnings were from capstone. 2025-04-18 21:52:58 +09:00
Alan Wu
24b29afc5a Try macOS linker warning fix 2025-04-18 21:52:58 +09:00
Alan Wu
3f68bcdeb1 Explain libminiruby 2025-04-18 21:52:58 +09:00
Alan Wu
5925903e38 More about testing in zjit.md 2025-04-18 21:52:58 +09:00
Takashi Kokubun
d093793e6b Pass BTESTS to make properly 2025-04-18 21:52:58 +09:00
Takashi Kokubun
b3dca8d4fe Allow dumping SSA in multiple ways 2025-04-18 21:52:58 +09:00
Takashi Kokubun
fc03b7353d Start testing the actual JIT code on CI 2025-04-18 21:52:58 +09:00
Takashi Kokubun
6f3f69098b Drop redundant options in workflows 2025-04-18 21:52:58 +09:00
Takashi Kokubun
fa4eee51f1 Fix options in zjit.md 2025-04-18 21:52:58 +09:00
Takashi Kokubun
bc443eef7a Let ZJIT and YJIT disable each other 2025-04-18 21:52:58 +09:00
Takashi Kokubun
b0739cd1c1 Rename utils.rs to cast.rs
to avoid making it a place to put anything.
2025-04-18 21:52:58 +09:00
Takashi Kokubun
9cfb860cb3 Let tests share the same ZJITState::init()
to share the initialization of other globals in the future as well
2025-04-18 21:52:58 +09:00