ruby/yjit
Alan Wu 9acc73d7c5
YJIT: Optional parameter rework and bugfix (#8220)
* YJIT: Fix splatting empty array with rest param

* YJIT: Rework optional parameter handling to fix corner case

The old code had a few unintuitive parts. The starting PC of the callee
was set in different places; `num_param`, which one would assume to be
static for a particular callee seemingly tallied to different amounts
depending on the what the caller passed; `opts_filled_with_splat` was
greater than zero even when the opts were not filled by items in the
splat array. Functionally, the bits that lets the callee know which
keyword parameters are unspecified were not passed properly when there
are optional parameters and a rest parameter, and then optional
parameters are all filled.

Make `num_param` non-mut and use parameter information in the callee
iseq as-is. Move local variable nil fill and placing of the rest array
out of `gen_push_frame()` as they are only ever relevant for iseq calls.
Always place the rest array at `lead_num + opt_num` to fix the
previously buggy situation.

* YJIT: Compile splat calls to iseqs with rest params

Test interactions with optional parameters.
2023-08-15 10:08:48 -04:00
..
bindgen YJIT: Implement checkmatch instruction (#8203) 2023-08-10 23:08:29 -04:00
src YJIT: Optional parameter rework and bugfix (#8220) 2023-08-15 10:08:48 -04:00
.gitignore
Cargo.lock YJIT: Instrument global allocations on stats build (#6712) 2022-11-13 12:54:41 -05:00
Cargo.toml YJIT: Enable debug symbols in dev_nodebug (#7822) 2023-05-19 09:05:39 +09:00
not_gmake.mk YJIT: Fix shared/static library symbol leaks 2023-01-27 12:28:09 -05:00
yjit.mk YJIT: Let local yjit-bindgen exit successfully (#8156) 2023-08-01 14:46:14 -07:00