Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YJIT: Optional parameter rework and bugfix #8220

Merged
merged 3 commits into from Aug 15, 2023

Conversation

XrXr
Copy link
Member

@XrXr XrXr commented Aug 14, 2023

See message in each commit.
Other than fixing the opts+rest+keywords bug and accepting to compile more situations, I like the new code because it has fewer mut variables than before.

(Would like to merge without squashing)

@matzbot matzbot requested a review from a team August 14, 2023 20:07
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.
Test interactions with optional parameters.
@maximecb maximecb merged commit 9acc73d into ruby:master Aug 15, 2023
92 checks passed
@XrXr XrXr deleted the yjit-opts-combinatorics branch August 15, 2023 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants