summaryrefslogtreecommitdiff
path: root/zjit/src
AgeCommit message (Collapse)Author
2025-09-18ZJIT: Compile sendforward with dynamic dispatch (#14501)Takashi Kokubun
* ZJIT: Compile sendforward with dynamic dispatch * Reload locals only if it has blockiseq * Add a test case of ... with other args
2025-09-18ZJIT: Support variadic C calls (#14575)Stan Lo
* ZJIT: Support variadic C calls This reduces the `dynamic_send_count` in `liquid-render` by ~21% * ZJIT: Reuse gen_push_frame * ZJIT: Avoid optimizing variadic C call when tracing is enabled
2025-09-18ZJIT: Annotate BasicObject#initialize (#14590)Max Bernstein
It's a no-op and always returns `nil`. Fixes https://github.com/Shopify/ruby/issues/755
2025-09-17ZJIT: Call instance allocation function directlyMax Bernstein
2025-09-17ZJIT: Rename optimize_direct_sends to type_specializeMax Bernstein
2025-09-17ZJIT: Prevent custom allocator in ObjectAllocClassMax Bernstein
2025-09-17ZJIT: Const-fold IsMethodCfuncMax Bernstein
2025-09-17ZJIT: Specialize ObjectAlloc with known class pointerMax Bernstein
This has fewer effects (can be elided!) and will eventually get better codegen, too. Fix https://github.com/Shopify/ruby/issues/752
2025-09-17ZJIT: Split Insn::Const from Insn::GetBlockParamProxy (#14583)Takashi Kokubun
* ZJIT: Split Insn::Const from Insn::GetBlockParamProxy * Print [BlockParamProxy] * Link a TODO comment to a Shopify/ruby issue
2025-09-17ZJIT: Add stat for `def_type` of send fallbacks (#14533)Stan Lo
I thought about creating a new HIR like `SendWithoutBlockFailedToOptimize` that can carry very specific reasons later. But it'll mean adding it to every branch matching `SendWithoutBlock` and may make code unnecessarily complicated. So I take the easier path for now: ``` Top-4 send fallback def_types (100.0% of total 21,375,357): cfunc: 20,164,487 (94.3%) optimized: 1,197,897 ( 5.6%) attrset: 12,953 ( 0.1%) alias: 20 ( 0.0%) ```
2025-09-17ZJIT: Revert documentation indent (#14580)Aiden Fox Ivey
2025-09-16ZJIT: Remove unused countersTakashi Kokubun
Follow-up on https://github.com/ruby/ruby/pull/14565 I meant to push this this as well but it was left un-committed locally.
2025-09-16ZJIT: Debug mechanism to verify leafness for `gen_prepare_call_with_gc` (#14553)André Luiz Tiago Soares
* functional debug mechanism; small refactor * make all tests pass * clean up implementation of debug mechanism for gen_prepare_call_with_gc * revert unnecessary change to gen_object_alloc * make ObjectAlloc non-leaf * fix merge error; reintroduce accidentally deleted counter * remove outdated comment * changes as per review comments * make set_stack_canary more stable * add todo comment to specialize object_alloc * revert whitespace changes * create gen_prepare_leaf_call_with_gc helper * fix spacing
2025-09-16ZJIT: Print local names in FrameState (#14571)Max Bernstein
2025-09-15ZJIT: Revert VM_CALL_ARGS_SPLAT and VM_CALL_KWARG support (#14565)Takashi Kokubun
2025-09-15ZJIT: Support compiling block args (#14537)Takashi Kokubun
2025-09-12ZJIT: Share more code with YJIT in jit.c (#14520)Takashi Kokubun
* ZJIT: Share more code with YJIT in jit.c * Fix ZJIT references to JIT
2025-09-12ZJIT: Let fallbacks handle unknown call types (#14518)Takashi Kokubun
2025-09-12ZJIT: Add specific dynamic send type counters (#14528)Stan Lo
2025-09-11ZJIT: Add support for stats_allocatorAiden Fox Ivey
* Using the shared jit crate, support for a single global_allocator can function * Solves --zjit-mem-size
2025-09-11ZJIT: Check for VM stack overflowAlan Wu
Previously, the included test crashed or turned into an infinite loop due to the missing check.
2025-09-10ZJIT: Revert `self_val` removal and rename it to `recv` (#14504)Stan Lo
* Revert "ZJIT: Removed unused self_val from Send" This reverts commit 13c2f8d5c2b41ec78344ae60f9b5ec1564029418. * Revert "ZJIT: Removed unused self_val from InvokeSuper" This reverts commit 877b625922e0f8de4e7ad801dd0306e69b34d263. * ZJIT: Rename self_val in dispatching HIRs to recv * ZJIT: Remove unnecessary constructor param names
2025-09-10ZJIT: Removed unused self_val from SendStan Lo
2025-09-10ZJIT: Removed unused self_val from InvokeSuperStan Lo
2025-09-10ZJIT: Support `invokeblock` insn (#14496)Stan Lo
ZJIT: Support invokeblock insn Basically like other send-ish insns, except that it doesn't pop the receiver.
2025-09-10ZJIT: Compile ISEQs with forwardable parameters (#14491)Takashi Kokubun
2025-09-09Update JIT bindingsPeter Zhu
2025-09-09ZJIT: Implement getblockparamproxy (#14483)Takashi Kokubun
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2025-09-09ZJIT: Optimize `ObjToString` with type guards (#14469)André Luiz Tiago Soares
* failing test for ObjToString optimization with GuardType * profile ObjToString receiver and rewrite with guard * adjust integration tests for objtostring type guard optimization * Implement new GuardTypeNot HIR; objtostring sends to_s directly on profiled nonstrings * codegen for GuardTypeNot * typo fixes * better name for tests; fix side exit reason for GuardTypeNot * revert accidental change * make bindgen * Fix is_string to identify subclasses of String; fix codegen for identifying if val is String
2025-09-08ZJIT: Add RubyVM::ZJIT.reset_stats! method (GH-14479)Randy Stauner
This allows for more precise tracking of stats programmatically which is particularly useful for our nightly benchmarking suite. - Define rust function - Expose to C - Wrap with Ruby API - Add a test
2025-09-08ZJIT: Fix 30k if stmt test (#14446)Aiden Fox Ivey
* ZJIT: Allow label generation above 19 bits * Refactor emit_conditional_jump to use generate_branch * Make branching functionality generic across Label and CodePtr * ZJIT: Add > 19 bit jump test and helper function * Remove an empty line --------- Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2025-09-08ZJIT: Fix backtraces on opt_new (#14461)Takashi Kokubun
2025-09-08ZJIT: Add --zjit-stats=quiet option to collect stats without printing (#14467)Randy Stauner
Similar to YJIT's --yjit-stats=quiet, this option allows ZJIT to collect statistics and make them available via the Ruby API without printing them at exit. This is useful for programmatic access to stats without the output noise. - Added print_stats field to Options struct - Modified option parsing to support --zjit-stats=quiet - Added rb_zjit_print_stats_p primitive to check if stats should be printed - Updated zjit.rb to only register at_exit handler when print_stats is true - Update the help text shown by `ruby --help` to indicate that --zjit-stats now accepts an optional =quiet parameter. - Added test for --zjit-stats=quiet option
2025-09-08Move `IS_TYPED_DATA` in RBasic.flagsJean Boussier
Ref: https://github.com/ruby/ruby/pull/14134#issuecomment-3207733725 We can't safely use low-bit pointer tagging anymore because `RTypedData.type` lines up with `RData.dfree` and there is no aligment guarantee on function pointers, as evidenced by `memcached` and `gpgme` gems. We also can't use FL_USER* for this, because extensions may use these for other purposes. Using a general flag for this is a bit unfortunate, as general flags are hard to come by, however I recently freed several of them, and we still have two or three free ones left.
2025-09-05ZJIT: Stop optimizing toplevel locals (#14458)Takashi Kokubun
2025-09-05ZJIT: Invalidate local variables on EP escape (#14448)Takashi Kokubun
2025-09-04ZJIT: Compile invokesuper with dynamic dispatch (#14444)Takashi Kokubun
Co-authored-by: Max Bernstein <ruby@bernsteinbear.com>
2025-09-04ZJIT: Fix Rust compilation warning (#14443)Stan Lo
This fixes: ``` warning: unused import: `ParseError` --> zjit/src/codegen.rs:20:61 | 20 | use crate::hir::{Const, FrameState, Function, Insn, InsnId, ParseError}; | ^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default ```
2025-09-04ZJIT: Add patchpoint for TracePoint (#14420)Stan Lo
ZJIT: Add patchpoint for TracePoint activation Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2025-09-04ZJIT: Support compiling ISEQs for opt_pc = 0 (#14441)Takashi Kokubun
* ZJIT: Support compiling ISEQs for opt_pc = 0 * Test send with optional arguments
2025-09-03ZJIT: Ensure `clippy` passes and silence unnecessary warnings (#14439)Aiden Fox Ivey
2025-09-03ZJIT: Add missing module doc commentsAiden Fox Ivey
2025-09-03ZJIT: Fix documentation build warningsAiden Fox Ivey
2025-09-03ZJIT: Count exits coming from jit_exception (#14428)Takashi Kokubun
2025-09-03ZJIT: Handle `opt_case_dispatch` insn (#14433)Stan Lo
ZJIT: Handle opt_case_dispatch insn
2025-09-02ZJIT: Use Copy instead of CloneAiden Fox Ivey
2025-09-02ZJIT: Remove unnecessary return statementsAiden Fox Ivey
2025-09-02ZJIT: Remove unnecessary .into callsAiden Fox Ivey
2025-09-02ZJIT: Use copied over map(|x| *x)Aiden Fox Ivey
2025-09-02ZJIT: Use .is_some_andAiden Fox Ivey