summaryrefslogtreecommitdiff
path: root/zjit
AgeCommit message (Collapse)Author
2025-04-28ZJIT: Drop a duplicated call into optimize (#13196)Takashi Kokubun
* ZJIT: Drop a duplicated call into optimize * Update a comment Co-authored-by: Max Bernstein <[email protected]> --------- Co-authored-by: Max Bernstein <[email protected]> Notes: Merged-By: k0kubun <[email protected]>
2025-04-28ZJIT: Drop trace_zjit_* instructions (#13189)Takashi Kokubun
Notes: Merged-By: k0kubun <[email protected]>
2025-04-25maybe fix bindgenAaron Patterson
2025-04-25ZJIT: Bail out of HIR translation if we can't handle a send flag (#13182)Max Bernstein
Bail out of HIR translation if we can't handle a send flag Notes: Merged-By: k0kubun <[email protected]>
2025-04-25ZJIT: Emit CCall if we know the type statically, not just from profiles (#13173)Max Bernstein
Emit CCall if we know the type statically, not just from profiles Notes: Merged-By: k0kubun <[email protected]>
2025-04-24ZJIT: Fold Send into SendWithoutBlockDirect if we know the class statically ↵Max Bernstein
(#13172) Fold Send into SendWithoutBlockDirect if we know the class statically This applies for constants and also for values where we know the type for other reasons. Notes: Merged-By: k0kubun <[email protected]>
2025-04-24Add testsMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13162
2025-04-24Make type_of use union-findMax Bernstein
Otherwise we might have stale types floating around Notes: Merged: https://github.com/ruby/ruby/pull/13162
2025-04-24Make PatchPoint(CalleeModifiedLocals) implicitMax Bernstein
We don't have a good model for modeling weakref-like instruction dependency behavior and I don't think we should add it just for this. Notes: Merged: https://github.com/ruby/ruby/pull/13162
2025-04-24Strength reduce sends on Fixnums in the optimizer instead of HIR builderMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13162
2025-04-24Simplify fixnum guarding codeMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13162
2025-04-22ZJIT: Add option to dump LIR (#13139)Max Bernstein
Now we can dump HIR, optimized HIR, LIR, and assembly. Notes: Merged-By: k0kubun <[email protected]>
2025-04-18Change mentions of YJIT to ZJIT (https://github.com/Shopify/zjit/pull/113)Aiden Fox Ivey
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Display Snapshot's FrameState using Display ↵Max Bernstein
(https://github.com/Shopify/zjit/pull/111) This makes the output a little nicer when doing --zjit-dump-hir=all Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add codegen for NewArray instruction (https://github.com/Shopify/zjit/pull/110)Aiden Fox Ivey
* Show failing test * Add second test case * Add empty NewArray setup * Update opt_tests and fix NewArray instantiation * Add code generation for NewArray * Add NewArray ordering test Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Implement JIT-to-JIT calls (https://github.com/Shopify/zjit/pull/109)Takashi Kokubun
* Implement JIT-to-JIT calls * Use a closer dummy address for Arm64 * Revert an obsoleted change * Revert a few more obsoleted changes * Fix outdated comments * Explain PosMarkers for CCall * s/JIT code/machine code/ * Get rid of ParallelMov Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Use GuardType output variableAlan Wu
Helps with readability and threads type info that's there around for longer. Amend test so `GuardType` doesn't DCE'ed. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add codegen support for ArrayDupAiden Fox Ivey
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Mark Guard* as depending on Snapshot in DCEMax Bernstein
We need to keep the Snapshot instruction alive. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Remove any object specialization in CCall optimizationMax Bernstein
We don't want to only guard on the class Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add return_type to FnProperties and CCallMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Strength reduce to `CCall` for sends landing in simple C methodsAlan Wu
A new optimization pass. Also: - Printing for `Insn::CCall` - Wrap `ID` and add convenience method for printing, replacing calls to rb_id2name() Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Insert PatchPoint after each SendMax Bernstein
In case the callee writes to the caller's locals, we need to be able to immediately side-exit because our frame's invariants might have been invalidated. If in the course of optimization we rewrite the Send, we can choose to remove the PatchPoint too---but it's not an error to keep it around. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Disable ZJIT profiling at call-threshold ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/99) * Disable ZJIT profiling at call-threshold * Stop referencing ZJIT instructions in codegen Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add --zjit-num-profiles option (https://github.com/Shopify/zjit/pull/98)Takashi Kokubun
* Add --zjit-profile-interval option * Fix min to max * Avoid rewriting instructions for --zjit-call-threshold=1 * Rename the option to --zjit-num-profiles Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add miscellaneous Clippy 'corrections' pt. 2 ↵Aiden Fox Ivey
(https://github.com/Shopify/zjit/pull/95) * Remove immediately deferenced borrow operators source: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow * Remove unnecessary cast as i64 Since Const::CInt64 wraps i64, it is unnecessary to cast to i64. * Remove unnecessary borrow operators * Beautify assign operation syntax * Use .is_null() convenience method * Omit .into() call from u32 to u32 * Use more descriptive std::ptr::null<VALUE>() In lieu of casting a literal as a type, opt to use the convenience type. * Use sized integer literal * Simplify pattern matching to explicit check Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Let --zjit-dump-hir dump the input HIR to codegen ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/96) Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Split LHS of CMP if it's an immediate (https://github.com/Shopify/zjit/pull/94)Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Print block param names in asm comment (https://github.com/Shopify/zjit/pull/93)Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Fix opt_neq HIR codegenMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Use find() in frame_state()Max Bernstein
We want to return representatives for the stack and locals. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add miscellaneous Clippy 'corrections' (https://github.com/Shopify/zjit/pull/92)Aiden Fox Ivey
* Remove redundant statements * Remove .clone() since A64 implements Copy * Remove .clone() since InsnId implements Copy . * Dereference since *const rb_call_data implements Copy * Remove unnecessary return statement * Remove unnecessary braces * Use .is_empty() over length checks * Remove unnecessary conversion handling Since i32 can always fit into i64 (the inner type in Opnd::Imm), the conversion is infallibile. * Use slice notation in lieu of Vec https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg * Simplify match statement Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Improve register alloc and dealloc error messaging ↵Aiden Fox Ivey
(https://github.com/Shopify/zjit/pull/90) Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Fix inconsistent indentationTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Make NewArray DCE-ableMax Bernstein
Initialize with a vector of operands instead of ArraySet instructions. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add dead code elimination passMax Bernstein
Dead code elimination (DCE) is like garbage collection for your HIR graph: it removes instructions that are not referenced by the "root set"---in this case, the instructions marked critical. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Reduce the number of Snapshots emittedMax Bernstein
Only emit them on-demand. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Make Snapshot own FrameState objectsMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Remove an outdated commentTakashi Kokubun
https://github.com/Shopify/zjit/pull/87#discussion_r2025152210 Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Move get_class_name into crubyMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Remove Option from get_class_name parameterMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Rewrite SendWithoutBlock to SendWithoutBlockDirect when possibleMax Bernstein
In calls to top-level functions, we assume that call targets will not get rewritten, so we can insert a PatchPoint and do the lookup at compile-time. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Compile Param into VReg and ParallelMov ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/87) Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Update the VReg comment to imply spillingTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Disassociate InsnOut from Insn indexTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Fix s/Raw/Debug/gMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Print iseq names in HIR dumpsMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add option to dump optimized HIRMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Only map pointers in testsMax Bernstein
We want to otherwise see real pointers in print output. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Default to BasicObject subclass if unknownMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131