Skip to content

[pull] master from ruby:master - #1289

Merged
pull[bot] merged 8 commits into
turkdevops:masterfrom
ruby:master
Aug 7, 2026
Merged

[pull] master from ruby:master#1289
pull[bot] merged 8 commits into
turkdevops:masterfrom
ruby:master

Conversation

@pull

@pull pull Bot commented Aug 7, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

ko1 and others added 8 commits August 7, 2026 22:29
rgengc_check_relation asks rgengc_remember to remember the parent for every
child that is young or write-barrier unprotected.  Remembering is idempotent
-- it sets a bit and a page flag -- so an old array of freshly allocated
elements pays a page lookup, a bitmap test and a store per element to reach a
state the first element already reached.

Clear parent_object_old_p once the parent is remembered.  The flag is read
only here and written only when a walk of one object's children starts and
ends, so dropping it mid-walk skips the two bitmap reads for the remaining
children and nothing else.

Twenty minor collections over a 200k-element old array refilled with young
arrays: 4.14G -> 4.02G instructions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gcc used to inline four vm_sendish calls into vm_exec_core; it now inlines
three.  The fourth was a constprop clone -- the one specialised for the call
site whose block handler is a constant -- and at +70 size units it cost two
to three times what the others did, which made it the first thing to go once
the inliner ran out of budget.

Nothing about the call sites changed.  vm.c pulls in vm.inc and
vm_insnhelper.c, so it is one enormous translation unit, and gcc's growth
budget is spent per unit: any line added anywhere in it can push out a
marginal decision elsewhere.  That is what happened, and it costs about
twenty instructions on every ordinary method call.

Pin it with ALWAYS_INLINE, as vm_getivar and friends already are.
vm_exec_core grows from 5373 to 5668 instructions and .text by 0.7%.

    fib(32)             2.169G -> 2.000G instructions
    binary trees (D16)  34.42G -> 33.00G
    so_binary_trees     51.00G -> 49.00G

Allocation and GC-bound benchmarks are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Previously the embedded path allocated a full-size embedded string via str_alloc_heap plus STR_SET_EMBED, which capped the copy at the default struct RString slot whatever the substring length. Size the allocation to the substring with str_alloc_embed instead, and copy while it fits in a slot of 256 bytes, since larger slots are allocated less densely and increase garbage collection.

Keep the default struct RString slot as the cap when the source is frozen or already shared, where sharing allocates the substring alone rather than a frozen root as well.

[Feature #22186]
A char is more than large enough for counting rebuilds, and it's
fine if it rolls over.
The table being rebuilt exactly 255 times between two check seems
impossible.

On the other hand, if `Hash#shift` is abused, `entries_start` is
more likely to reach MAX_UCHAR.

So swapping the two members is preferable.
Follow-up on dd93d13 (#18071).

Baking revision.h into dump_ast couples every builtin *.rbinc to the
current commit: whenever HEAD changes, e.g. when switching between two
branches that only differ under yjit/, revision.h is regenerated,
dump_ast is relinked, all $(BUILTIN_RB_INCS) are regenerated with
identical content but fresh timestamps, and every C file that includes
one of them is recompiled, followed by relinking miniruby and ruby.

The --version banner was the only use of revision.h in dump_ast, so
print only the Prism version. Since dump_ast no longer includes revision.h,
it is not relinked when HEAD changes, so $(BUILTIN_RB_INCS) and their
dependents are no longer invalidated by commit-only changes.
Re-enable rb_gc_impl_zjit_new_obj_fastpath, was stubbed to "return
false" by the recent rlgc merge.  The bump-pointer state moved out of
the deleted rb_ractor_newobj_cache_t into the per-objspace
rb_heap_t.newobj, so the fastpath and the JIT codegen now index that
struct and reach it through ractor->objspace instead of
ractor->newobj_cache.
@pull pull Bot locked and limited conversation to collaborators Aug 7, 2026
@pull pull Bot added the ⤵️ pull label Aug 7, 2026
@pull
pull Bot merged commit 3156d5a into turkdevops:master Aug 7, 2026
0 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants