diff options
| author | Jeff Zhang <jeff.j.zhang@shopify.com> | 2026-01-29 13:00:13 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-29 18:00:13 +0000 |
| commit | fbff0c936cc8b1a1c5f6fe51ea6e892721c200f1 (patch) | |
| tree | bbaffe08e6313248081c0cabe19a0379fb0a5cff /spec/ruby/core | |
| parent | 5299276e421c3f11c944069fe5c655628634b9e1 (diff) | |
ZJIT: Handle `nil` case for `getblockparamproxy` (#15986)
Resolves https://github.com/Shopify/ruby/issues/772
Adds profiling for the `getblockparamproxy` YARV instruction and handles the `nil` block case by pushing `nil` instead of the block proxy object, improves `ratio_in_zjit` a tiny bit (0.1%)
Profiling data for `getblockparamproxy` on Lobsters
```
Top-6 getblockparamproxy handler (100.0% of total 3,353,291):
polymorphic: 2,337,372 (69.7%)
nil: 552,629 (16.5%)
iseq: 259,636 ( 7.7%)
no_profiles: 156,734 ( 4.7%)
proc: 40,223 ( 1.2%)
megamorphic: 6,697 ( 0.2%)
```
Lobsters benchmark stats:
<details>
<summary>Stats before (master):</summary>
<p>
```
❯ ./run_benchmarks.rb --chruby 'ruby-zjit --zjit-stats' lobsters
***ZJIT: Printing ZJIT statistics on exit***
...
Top-20 side exit reasons (100.0% of total 15,338,024):
guard_type_failure: 6,889,050 (44.9%)
guard_shape_failure: 6,848,898 (44.7%)
block_param_proxy_not_iseq_or_ifunc: 1,008,525 ( 6.6%)
unhandled_hir_insn: 236,977 ( 1.5%)
compile_error: 191,763 ( 1.3%)
fixnum_mult_overflow: 50,739 ( 0.3%)
block_param_proxy_modified: 28,119 ( 0.2%)
patchpoint_stable_constant_names: 18,229 ( 0.1%)
unhandled_newarray_send_pack: 14,481 ( 0.1%)
unhandled_block_arg: 13,782 ( 0.1%)
fixnum_lshift_overflow: 10,085 ( 0.1%)
patchpoint_no_ep_escape: 7,815 ( 0.1%)
unhandled_yarv_insn: 7,540 ( 0.0%)
expandarray_failure: 4,533 ( 0.0%)
guard_super_method_entry: 4,475 ( 0.0%)
patchpoint_method_redefined: 1,207 ( 0.0%)
patchpoint_no_singleton_class: 1,130 ( 0.0%)
obj_to_string_fallback: 412 ( 0.0%)
guard_less_failure: 163 ( 0.0%)
interrupt: 82 ( 0.0%)
...
ratio_in_zjit: 82.1%
```
</p>
</details>
<details>
<summary>Stats after:</summary>
<p>
```
❯ ./run_benchmarks.rb --chruby 'ruby-zjit --zjit-stats' lobsters
***ZJIT: Printing ZJIT statistics on exit***
...
Top-20 side exit reasons (100.0% of total 15,061,422):
guard_type_failure: 6,892,934 (45.8%)
guard_shape_failure: 6,850,512 (45.5%)
block_param_proxy_not_iseq_or_ifunc: 549,823 ( 3.7%)
unhandled_hir_insn: 236,979 ( 1.6%)
compile_error: 191,782 ( 1.3%)
unhandled_yarv_insn: 128,695 ( 0.9%)
block_param_proxy_not_nil: 68,623 ( 0.5%)
fixnum_mult_overflow: 50,739 ( 0.3%)
patchpoint_stable_constant_names: 18,568 ( 0.1%)
unhandled_newarray_send_pack: 14,481 ( 0.1%)
block_param_proxy_modified: 13,819 ( 0.1%)
unhandled_block_arg: 13,798 ( 0.1%)
fixnum_lshift_overflow: 10,085 ( 0.1%)
patchpoint_no_ep_escape: 7,815 ( 0.1%)
expandarray_failure: 4,533 ( 0.0%)
guard_super_method_entry: 4,475 ( 0.0%)
patchpoint_method_redefined: 1,207 ( 0.0%)
obj_to_string_fallback: 1,140 ( 0.0%)
patchpoint_no_singleton_class: 1,130 ( 0.0%)
guard_less_failure: 163 ( 0.0%)
...
ratio_in_zjit: 82.2%
```
</p>
</details>
Diffstat (limited to 'spec/ruby/core')
0 files changed, 0 insertions, 0 deletions
