summaryrefslogtreecommitdiff
path: root/zjit/src
AgeCommit message (Collapse)Author
2025-10-31ZJIT: Standardize variable name for callable method entry (#15021)Stan Lo
2025-10-31ZJIT: Optimize VM_METHOD_TYPE_ALIAS (#15018)Max Bernstein
Just loop until you find a non-alias.
2025-10-31ZJIT: Let AssemblerPanicHook write into stderr (#15019)Takashi Kokubun
2025-10-31ZJIT: Simplify some profiling APIs (#15017)Max Bernstein
2025-10-30ZJIT: Use LoadField for specialized GetIvarMax Bernstein
2025-10-30ZJIT: Inline struct arefMax Bernstein
2025-10-30ZJIT: Count unsupported fancy caller side featuresAlan Wu
These count caller-side features we don't support. But because we side exit when we see them through unhandled_call_type(), these new counters currently don't trigger.
2025-10-30ZJIT: Unsupported call feature accounting, and new ↵Alan Wu
`send_fallback_fancy_call_feature` In cases we fall back when the callee has an unsupported signature, it was a little inaccurate to use `send_fallback_send_not_optimized_method_type`. We do support the method type in other situations. Add a new `send_fallback_fancy_call_feature` for these situations. Also, `send_fallback_bmethod_non_iseq_proc` so we can stop using `not_optimized_method_type` completely for bmethods. Add accompanying `fancy_arg_pass_*` counters. These don't sum to the number of unoptimized calls that run, but establishes the level of support the optimizer provides for a given workload.
2025-10-30ZJIT: Prevent specialization of splats instead of side-exiting (#15005)Aiden Fox Ivey
2025-10-30ZJIT: Split out optimized method types in stats (#15002)Max Bernstein
We can see send/block call/struct aref/... e.g. on lobsters: ``` Top-9 not optimized method types for send_without_block (100.0% of total 3,133,812): iseq: 2,004,557 (64.0%) optimized_struct_aref: 496,232 (15.8%) alias: 268,579 ( 8.6%) optimized_call: 224,883 ( 7.2%) optimized_send: 120,531 ( 3.8%) bmethod: 12,011 ( 0.4%) null: 4,636 ( 0.1%) optimized_block_call: 1,930 ( 0.1%) cfunc: 453 ( 0.0%) ``` railsbench: ``` Top-8 not optimized method types for send_without_block (100.0% of total 5,735,608): iseq: 2,854,551 (49.8%) optimized_struct_aref: 871,459 (15.2%) optimized_call: 862,185 (15.0%) alias: 588,486 (10.3%) optimized_send: 482,171 ( 8.4%) null: 39,942 ( 0.7%) bmethod: 36,784 ( 0.6%) cfunc: 30 ( 0.0%) ``` shipit: ``` Top-10 not optimized method types for send_without_block (100.0% of total 4,844,304): iseq: 2,881,206 (59.5%) optimized_struct_aref: 1,158,935 (23.9%) optimized_call: 472,898 ( 9.8%) alias: 208,010 ( 4.3%) optimized_send: 55,479 ( 1.1%) null: 47,273 ( 1.0%) bmethod: 12,608 ( 0.3%) optimized_block_call: 7,860 ( 0.2%) cfunc: 31 ( 0.0%) optimized_struct_aset: 4 ( 0.0%) ```
2025-10-30ZJIT: Fix incorrect self.class.respond_to? folding (#15001)Max Bernstein
Right now we have a subtle type system bug around `types::Class`. Until that is resolved, stop marking `Kernel#class` as returning `types::Class`, which fixes Rubocop. Re: https://github.com/Shopify/ruby/issues/850
2025-10-29ZJIT: Limit the default size of LIR dumpTakashi Kokubun
For test_zjit.rb output, it was too long for a single test to print thousands of lines.
2025-10-29ZJIT: Enable comments for --zjit-debug on dev buildsTakashi Kokubun
I wanted to see comments on test_zjit.rb failures.
2025-10-29ZJIT: Rename compile_side_exits to compile_exitsTakashi Kokubun
so that it can be easily specified with `--zjit-dump-lir=`.
2025-10-29ZJIT: Dump Assembler on panic by default for dev buildsTakashi Kokubun
2025-10-29ZJIT: Avoid cloning Assembler repeatedlyTakashi Kokubun
2025-10-29ZJIT: Suffix a label index to duplicated label namesTakashi Kokubun
2025-10-29ZJIT: Print operands with Display on side exitTakashi Kokubun
2025-10-29ZJIT: Refactor operand printerTakashi Kokubun
2025-10-29ZJIT: Fix LoadIvarExtended test (#14989)Max Bernstein
2025-10-29ZJIT: Introduce a better LIR printer (#14986)Takashi Kokubun
2025-10-29ZJIT: Add type checker to HIR (#14978)Max Bernstein
Allow instructions to constrain their operands' input types to avoid accidentally creating invalid HIR.
2025-10-28ZJIT: Fill `cfp->pc` with trap value for C methods in debug buildsAndré Luiz Tiago Soares
2025-10-28ZJIT: Migrate an arm64 register from emit to splitTakashi Kokubun
2025-10-28ZJIT: Rename SCRATCH_OPND to SCRATCH0_OPND for x86_64Takashi Kokubun
2025-10-28ZJIT: Support ParallelMov into memory (#14975)Takashi Kokubun
2025-10-28YJIT, ZJIT: Fix unnecessary `use` of macrosTakashi Kokubun
https://github.com/ruby/ruby/actions/runs/18887695798/job/53907237061?pr=14975
2025-10-28ZJIT: Split HIR tests (#14967)Aiden Fox Ivey
`hir.rs` was getting rather large, so I've opted to move the inline tests into their own files. This should also help when looking for where to put your tests, as the optimization tests have a dedicated file. Future follow up work could make the layout of test modules more idiomatic to Rust.
2025-10-28ZJIT: Count GuardType instructionsMax Bernstein
We can measure how many we can remove by adding type information to C functions, etc.
2025-10-28ZJIT: Split frame_setup_teardown testsTakashi Kokubun
2025-10-28ZJIT: Move c_stack_slots to AssemblerTakashi Kokubun
2025-10-28ZJIT: Simplify Assembler constructorsTakashi Kokubun
2025-10-28ZJIT: Stop computing offset on gen_push_opndsTakashi Kokubun
Once we add register spill, the C stack will have not only spilled basic block params but also spilled VRegs. We won't know how many stack slots are used for spilled VRegs until alloc_regs, so you can't compute an offset as of writing LIR.
2025-10-28ZJIT: Allow ALLOC_REGS to have an odd number of regsTakashi Kokubun
2025-10-28ZJIT: Print unexpected operands on x86_64Takashi Kokubun
2025-10-28ZJIT: Specialize Array#pop for no argument case (#14933)Aiden Fox Ivey
Fixes https://github.com/Shopify/ruby/issues/814 This change specializes the case of calling `Array#pop` on a non frozen array with no arguments. `Array#pop` exists in the non-inlined C function list in the ZJIT SFR performance burndown list. If in the future it is helpful, this patch could be extended to support the case where an argument is provided, but this initial work seeks to elide the ruby frame normally pushed in the case of `Array#pop` without an argument.
2025-10-28ZJIT: Add IsBitNotEqual and inline BasicObject#!=Max Bernstein
2025-10-28ZJIT: Optimize Kernel#===Max Bernstein
2025-10-28ZJIT: Add BoxBool and remove CCall from BasicObject#==Max Bernstein
2025-10-28ZJIT: Use FnProperties::default()Max Bernstein
2025-10-28ZJIT: Allow both inlining and annotating propertiesMax Bernstein
2025-10-28ZJIT: Remove redundant annotationMax Bernstein
2025-10-28ZJIT: Inline Kernel#nil? and NilClass#nil?Max Bernstein
We can fully remove the CCall now.
2025-10-27ZJIT: Annotate Kernel#frozen? as returning BoolExactMax Bernstein
2025-10-27ZJIT: Annotate Symbol#to_s and Symbol#name as returning StringExactMax Bernstein
2025-10-27ZJIT: Add return_type to inlined InvokeBuiltinMax Bernstein
2025-10-27ZJIT: Inline method calls to ISEQs that just do leaf Primitive callsMax Bernstein
2025-10-27ZJIT: Fix internal compiler error looking up profiles for ↵Max Bernstein
trace_getinstancevariable (#14969) We treat getinstancevariable differently from other opcodes: it does not look at the stack for its self operand, but instead looks at `cfp->self`. In some cases, we might see the `trace_` variant in the front-end, so make sure we treat that the same. Example repro: ``` def test @foo end 28.times do test end trace = TracePoint.trace(:call) do |tp| puts tp.method_id end trace.enable do 30.times do test end end ```
2025-10-27ZJIT: Remove unnecessary 'static annotation from gen_hir_type.rbAiden Fox Ivey
2025-10-27ZJIT: Since Param is unit struct, elide destructuringAiden Fox Ivey