summaryrefslogtreecommitdiff
path: root/zjit/src/codegen.rs
AgeCommit message (Collapse)Author
2025-08-29ZJIT: Repurpose ExitCounters for unhandled YARV insns (#14392)Takashi Kokubun
2025-08-28ZJIT: Compile Insn::SendTakashi Kokubun
2025-08-28ZJIT: Prepare getglobal for non-leaf call (#14387)Stan Lo
Depending on the user's warning level, getting certain global variables may lead to calling `Warning#warn`, which can be redefined by the user. This fixes another `bootstraptest/test_yjit.rb` failure.
2025-08-28ZJIT: Disable profiling in compile_iseq (#14385)Max Bernstein
This catches both the interpreter-JIT and JIT-JIT cases. Fixes https://github.com/Shopify/ruby/issues/719
2025-08-28ZJIT: Generate code for ArrayExtendMax Bernstein
2025-08-28ZJIT: Generate code for DefinedIvarMax Bernstein
2025-08-28ZJIT: Generate code for ToArray, ToNewArrayMax Bernstein
2025-08-28ZJIT: Generate code for ArrayPushMax Bernstein
2025-08-28ZJIT: Generate code for HashDupMax Bernstein
2025-08-28ZJIT: Refactor stats implementations (#14378)Takashi Kokubun
* ZJIT: Refactor stats implementations * s/num_send_dynamic/dynamic_send_count/
2025-08-27ZJIT: Count dynamic dispatch (SendWithoutBlock)Max Bernstein
2025-08-27ZJIT: Implement side exit stats (#14357)Takashi Kokubun
2025-08-26Follow up cleanup for `opt_(aref|aset)_with` removalStan Lo
Just removing some unneeded tests, outdated comments...etc.
2025-08-26ZJIT: Side-exit on unknown instructions (#14212)Max Bernstein
Don't abort the entire compilation. Fix https://github.com/Shopify/ruby/issues/700
2025-08-25ZJIT: Add compilation failure stats (#14310)Takashi Kokubun
2025-08-22ZJIT: Spill whole FrameState in `Insn::SendWithoutBlock`Alan Wu
Previously, we only spilled the arguments necessary for the particular send. In case the callee raises and a rescue resumes the ISEQ, that did not present a complete stack state. E.g. in `[1, (raise rescue 2)]` the raise send only spills `self`, when `1` also needs to be spilled. Spill the whole stack. Adjust parsing for `opt_aref_with` since the key argument for the send now needs to be described by the frame state of the send. This changes the contract for `Insn::SendWithoutBlock` to use arguments from the interpreter stack as described by its frame state.
2025-08-22ZJIT: Add CheckInterrupts HIR instructionMax Bernstein
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: 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: 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-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: 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: 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: 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: 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: 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-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-08ZJIT: Fix "memory operand with non-register base" (#14153)Takashi Kokubun
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>