Skip to content

[pull] master from ruby:master#807

Merged
pull[bot] merged 8 commits intoturkdevops:masterfrom
ruby:master
Feb 26, 2026
Merged

[pull] master from ruby:master#807
pull[bot] merged 8 commits intoturkdevops:masterfrom
ruby:master

Conversation

@pull
Copy link

@pull pull bot commented Feb 26, 2026

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 : )

kddnewton and others added 8 commits February 25, 2026 13:38
Before:

    Optimized HIR:
    fn block in <main>@benchmarks/setivar.rb:40:
    bb1():
      EntryPoint interpreter
      v1:BasicObject = LoadSelf
      Jump bb3(v1)
    bb2():
      EntryPoint JIT(0)
      v4:BasicObject = LoadArg :self@0
      Jump bb3(v4)
    bb3(v6:BasicObject):
      v10:CPtr = GetEP 1
      v11:BasicObject = LoadField v10, :obj@0xffffffffffffffe8    <=
      PatchPoint NoSingletonClass(TheClass@0x1037633c0)
      PatchPoint MethodRedefined(TheClass@0x1037633c0, set_value_loop@0xf5f1, cme:0x103a14650)
      v21:HeapObject[class_exact:TheClass] = GuardType v11, HeapObject[class_exact:TheClass]
      v22:BasicObject = SendDirect v21, 0x16cf41630, :set_value_loop (0x16cf41670)
      CheckInterrupts
      Return v22

After:

    Optimized HIR:
    fn block in <main>@benchmarks/setivar.rb:40:
    bb1():
      EntryPoint interpreter
      v1:BasicObject = LoadSelf
      Jump bb3(v1)
    bb2():
      EntryPoint JIT(0)
      v4:BasicObject = LoadArg :self@0
      Jump bb3(v4)
    bb3(v6:BasicObject):
      v10:CPtr = GetEP 1
      v11:BasicObject = LoadField v10, :obj@-0x18    <=
      PatchPoint NoSingletonClass(TheClass@0x102bc3420)
      PatchPoint MethodRedefined(TheClass@0x102bc3420, set_value_loop@0xf5f1, cme:0x102e945f0)
      v21:HeapObject[class_exact:TheClass] = GuardType v11, HeapObject[class_exact:TheClass]
      v22:BasicObject = SendDirect v21, 0x16dadd630, :set_value_loop (0x16dadd670)
      CheckInterrupts
      Return v22
Previously classes and modules were pre-aged. Ie. as soon as they're
allocated they are aged to old_age - 1. This was done with the
assumption that classes are generally always long lived, so we should
assume that any that survive a single GC can be considered old.

This commit keeps the same semantics, but moves the logic out of the
allocation path, in order to simplify allocation. Classes and modules
are now set to old-age the first time they are marked.
Previously we printed the struct name of T_DATA both in
rb_raw_obj_info_buitin_type and in rb_raw_obj_info_common via type_name.
…#16249)

Before this change, gen_function_stub and
gen_function_stub_hit_trampoline communicated via a scratch register.
We would like gen_function_stub_hit_trampoline to have more freedom with
regard to the registers it uses, especially for the CCall in to
function_stub_hit.  Instead of communicating via scratch register, we'll
communicate via stack.

Practically speaking, this means:

* Stop using x15 (scratch reg) to communicate iseq call addr from call
  stub to function sub hit trampoline; use stack instead
* Don't try to CCall with x15 as first argument; can't use scratch reg
  in parallel move of arguments

Here is pseudo assembly of before this commit:

```
some_send_direct_in_a_ruby_method(JIT code):
  mov x15, gen_function_stub
  mov x0, self
  mov x1, 1
  blr x15

gen_function_stub:
  mov x15, 0xISEQADDR (the address of the ISEQ we _want_ to compile)
  jmp function_stub_hit_trampoline

function_stub_hit_trampoline:
  function prologue
  cpush ALL_JIT_REGS
  mov x0, x15 # currently x15 is 0xISEQADDR
  mov x1, CFP
  mov x2, SP
  blr function_stub_hit
  mov x15, x0 # write jump address to x15 (code pointer for compiled iseq)
  cpop ALL_JIT_REGS
  function epilogue
  jmp x15
```

Here is pseudo assembly of after this commit:

```
some_send_direct_in_a_ruby_method(JIT code):
  mov x15, gen_function_stub
  mov x0, self
  mov x1, 1
  blr x15

gen_function_stub:
  mov x15, 0xISEQADDR (the address of the ISEQ we _want_ to compile)
  push x15
  jmp function_stub_hit_trampoline

function_stub_hit_trampoline:
  pop x15 # get the ISEQ addr from gen_function_stub
  function prologue
  cpush ALL_JIT_REGS
  mov x0, x15 # currently x15 is 0xISEQADDR
  mov x1, CFP
  mov x2, SP
  blr function_stub_hit
  mov x15, x0 # write jump address to x15 (code pointer for compiled iseq)
  cpop ALL_JIT_REGS
  function epilogue
  jmp x15
```
@pull pull bot locked and limited conversation to collaborators Feb 26, 2026
@pull pull bot added the ⤵️ pull label Feb 26, 2026
@pull pull bot merged commit 9ab1dfa into turkdevops:master Feb 26, 2026
1 check failed
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.

6 participants