summaryrefslogtreecommitdiff
path: root/zjit
AgeCommit message (Collapse)Author
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>
2025-08-07ZJIT: Implement `defined?` codegen for non-yield calls (#14101)Stan Lo
2025-08-07ZJIT: Optimize class guards by directly reading klass field (#14136)Stan Lo
Replace `rb_yarv_class_of` call with: - a constant check for special constants (nil, fixnums, symbols, etc) - a check for false - direct memory read at offset 8 for regular heap objects for the class check
2025-08-07ZJIT: Remove GC offsets overwritten by invalidation (#14102)Takashi Kokubun
ZJIT: Remove GC offsts overwritten by invalidation
2025-08-07ZJIT: Create HeapObject Type (#14140)Max Bernstein
This is a counterpoint to the Immediate type and it represents all BasicObject subclasses except for the several immediate objects. If we know something is a HeapObject, we know we can treat it as an RBasic pointer.
2025-08-07ZJIT: Set PC before StringCopy (#14141)Max Bernstein
ZJIT: Set PC before StringCopy This function allocates.
2025-08-06ZJIT: Inline attr_reader/attr_accessor (#14126)Max Bernstein
We can rewrite SendWithoutBlock to GetIvar.
2025-08-06ZJIT: Implement SingleRactorMode invalidation (#14121)Stan Lo
* ZJIT: Implement SingleRactorMode invalidation * ZJIT: Add macro for compiling jumps * ZJIT: Fix typo in comment * YJIT: Fix typo in comment * ZJIT: Avoid using unexported types in zjit.h `enum ruby_vminsn_type` is declared in `insns.inc` and is not exported. Using it in `zjit.h` would cause build errors when the file including it doesn't include `insns.inc`.
2025-08-06ZJIT: x86: split: Fix live ranges index-out-of-range panicAlan Wu
Previously we crashed panicked due to index bounds check running test_fixnum.rb. On ARM and in other places in the x86 backend, this isn't a problem because they inspect the output of instructions which is never replaced.
2025-08-06ZJIT: Fix "immediate value too large" on cmp for x86_64 (#14125)Takashi Kokubun
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
2025-08-05ZJIT: Fix `Kernel#Float`'s annotation (#14123)Stan Lo
As pointed out in https://github.com/ruby/ruby/pull/14078#discussion_r2255427676, the return type should be `Float` instead.