summaryrefslogtreecommitdiff
path: root/zjit/src
AgeCommit message (Collapse)Author
2025-08-21ZJIT: Fill nils before function_stub_hit exit (#14294)Takashi Kokubun
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com> Co-authored-by: Max Bernstein <ruby@bernsteinbear.com> Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2025-08-21ZJIT: Allocate register for VRegs that begin and end at the same index (#14270)Max Bernstein
If the LiveRange looks like (idx, idx), we will currently not allocate a register. This change allocates a register and then immediately deallocates it. Fix https://github.com/Shopify/ruby/issues/614
2025-08-21Remove unused SPECIAL_CONST_SHAPE_IDÉtienne Barrié
Its usage was removed in 306d50811dd060d876d1eb364a0d5e6106f5e4f1.
2025-08-21ZJIT: Refactor `gen_new_hash` (#14293)Stan Lo
We can use the `gen_push_opnds` and `gen_pop_opnds` helpers added in #14200 to simplify the code.
2025-08-20ZJIT: Remove unnecessary option return type on gen_branch_params (#14286)Stan Lo
2025-08-19ZJIT: Mark Insn::NewRange as having side effectsAlan Wu
2025-08-19ZJIT: Prepare for rb_range_new() calling <=>Alan Wu
gen_prepare_call_with_gc() was not enough because of the rb_funcall() usage in range_init(). Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Co-authored-by: Max Bernstein <rubybugs@bernsteinbear.com>
2025-08-19ZJIT: Remove try_num_bits (#14272)Takashi Kokubun
2025-08-19ZJIT: Remove more Option from codegen (#14265)Max Bernstein
2025-08-19ZJIT: Compile toregexp (#14200)Daniel Colson
`toregexp` is fairly similar to `concatstrings`, so this commit extracts a helper for pushing and popping operands on the native stack. There's probably opportunity to move some of this into lir (e.g. Alan suggested a push_many that could use STP on ARM to push 2 at a time), but I might save that for another day.
2025-08-18Don't allow looking at the shape ID of immediates (#14266)Max Bernstein
It only makes sense for heap objects.
2025-08-18ZJIT: Fix BorrowError on --zjit-dump-disasm (#14267)Takashi Kokubun
2025-08-18ZJIT: Handle ISEQ moves (#14250)Takashi Kokubun
* ZJIT: Handle ISEQ moves in IseqCall * ZJIT: Handle ISEQ moves in Invariants * Let gen_iseq_call take a reference * Avoid unneeded iter()
2025-08-18ZJIT: Temporarily disable buggy defined? codegenMax Bernstein
2025-08-18ZJIT: Refine type of DefinedMax Bernstein
2025-08-18ZJIT: Make Defined retain its SnapshotMax Bernstein
2025-08-18ZJIT: Make a fix a bunch of other cases using OptionMax Bernstein
2025-08-18ZJIT: Don't return Option from counter incrementMax Bernstein
2025-08-18ZJIT: Don't return Option from side exitsMax Bernstein
2025-08-18ZJIT: Remove empty returns from control instructions in codegenMax Bernstein
2025-08-18ZJIT: Don't return Option from codegen helper functionsMax Bernstein
They don't need it anymore; jit.get_opnd doesn't return Option anymore.
2025-08-18ZJIT: Make jit.get_opnd noisily failMax Bernstein
We have a verifier that runs in debug mode that should prevent this. Simplify a bunch of call sites.
2025-08-18ZJIT: Make sure output operands are not VRegs (#14188)Max Bernstein
Make LIR SSA.
2025-08-18ZJIT: Codegen for NewHash (#14059)Donghee Na
This is my first contribution to ZJIT. Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Co-authored-by: Max Bernstein <ruby@bernsteinbear.com>
2025-08-15ZJIT: Guide WB skipping for Insn::SetLocal using HIR type infoAlan Wu
2025-08-15ZJIT: Make `opnd!()` work on both `&InsnId` and `InsnId`Alan Wu
2025-08-15ZJIT: Remove unused HIR test code (#14248)Max Bernstein
2025-08-15ZJIT: Share function stub code using a trampoline (#14225)Takashi Kokubun
2025-08-15ZJIT: Implement getspecial (#13642)Eileen
ZJIT: Implement getspecial in ZJIT Adds support for the getspecial instruction in zjit. We split getspecial into two instructions, one for special symbols (`$&`, $'`, etc) and one for special backrefs (`$1`, `$2`, etc). Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2025-08-15ZJIT: Make --zjit-dump-hir work with HIR opt disabled (#14242)Takashi Kokubun
2025-08-15ZJIT: Set PC before function_stub_hit_body (#14234)Takashi Kokubun
2025-08-14ZJIT: Stop duplicating context-less side exits (#14215)Takashi Kokubun
2025-08-13ZJIT: Enable or remove comments from YJIT (#14214)Takashi Kokubun
2025-08-13ZJIT: Implement `StringIntern` codegen (#14207)Stan Lo
* ZJIT: Add test and implement display for StringIntern HIR Co-authored-by: Emily Samp <emily.samp@shopify.com> * ZJIT: Implement StringIntern codegen Co-authored-by: Emily Samp <emily.samp@shopify.com> * ZJIT: Fix StringIntern's return type --------- Co-authored-by: Emily Samp <emily.samp@shopify.com>
2025-08-13ZJIT: Fix `ObjToString` rewrite (#14196)Stan Lo
ZJIT: Fix ObjToString rewrite Currently, the rewrite for `ObjToString` always replaces it with a `SendWithoutBlock(to_s)` instruction when the receiver is not a string literal. This is incorrect because it calls `to_s` on the receiver even if it's already a string. This change fixes it by: - Avoiding the `SendWithoutBlock(to_s)` rewrite - Implement codegen for `ObjToString`
2025-08-13ZJIT: Don't eliminate NewHash with operandsMax Bernstein
Hashing and checking operands for equality is re-entrant. We could later optimize this to check for hash/eq methods on operands and eliminate if they don't have side effects, but this is fine for now.
2025-08-13ZJIT: Only validate HIR in debug modeMax Bernstein
2025-08-12ZJIT: Prepare non-leaf calls for SetGlobal (#14197)Stan Lo
When trace_var is used, setting a global variable can cause exceptions to be raised. We need to prepare for that.
2025-08-12ZJIT: Avoid compiling failed ISEQs repeatedly (#14195)Takashi Kokubun
2025-08-12ZJIT: Add flag to disable the HIR optimizer (#14181)Max Bernstein
Also add a check in the bisect script that can assign blame to the HIR optimizer.
2025-08-12ZJIT: Avoid splitting add_into/sub_into for x86_64 (#14177)Takashi Kokubun
* ZJIT: Avoid splitting add_into/sub_into * Require add_into/sub_into to take a Reg
2025-08-11CI: Surface Rust warnings on PRs that touch any Rust codeAlan Wu
Rust PRs will have a failed CI step if they trigger any warnings. This helps us stay on top of warnings from new Rust releases and also ones we accidentally write. Fix a typo for demo, since this only runs when Rust files are changed.
2025-08-11ZJIT: Add --zjit-exec-mem-size (#14175)Takashi Kokubun
* ZJIT: Add --zjit-exec-mem-size * Add a comment about the limit
2025-08-11ZJIT: Implement `concatstrings` insn (#14154)Stan Lo
Co-authored-by: Alexander Momchilov <alexander.momchilov@shopify.com>
2025-08-11ZJIT: Add compile/profile/GC/invalidation time stats (#14158)Takashi Kokubun
Co-authored-by: Stan Lo <stan001212@gmail.com>
2025-08-11ZJIT: Fix `mismatched_lifetime_syntaxes`, new in Rust 1.89.0Alan Wu
2025-08-08ZJIT: Avoid compiling and direct sends to forwardable ISEQsAlan Wu
These `...` ISEQs have a special calling convention in the interpreter and our stubs and JIT calling convention don't deal well. Reject for now. Debugged with help from `@tekknolagi` and `tool/zjit_bisect.rb`. Merely avoiding direct sends is enough to pass the attached test, but also avoid compiling ISEQs with `...` parameter to limit exposure for now. `SendWithoutBlock`, which does dynamic dispatch using interpreter code, seems to handle calling into forwardable ISEQs correctly, so they are fine -- we can't predict where these dynamic sends land anyways.
2025-08-08ZJIT: Fix "memory operand with non-register base" (#14153)Takashi Kokubun
2025-08-08ZJIT: Add a graphviz dumper for HIR (#14117)Max Bernstein
This is moderately useful just in stdout (copy and paste into a renderer) but potentially more useful alongside a tool that parses stdout looking for `digraph G { ... }` and renders those automatically.
2025-08-07ZJIT: Remove the need for unwrap() on with_num_bits() (#14144)Takashi Kokubun
* ZJIT: Remove the need for unwrap() on with_num_bits() * Fix arm64 tests * Track the caller of with_num_bits Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> --------- Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>