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

[YARP] Use constant_id lookups where possible #8374

Merged
merged 3 commits into from Sep 6, 2023

Conversation

jemmaissroff
Copy link
Contributor

No description provided.

@jemmaissroff jemmaissroff requested review from kddnewton and removed request for kddnewton September 5, 2023 17:44
@@ -359,6 +359,12 @@ yp_lookup_local_index_with_depth(rb_iseq_t *iseq, yp_compile_context_t *compile_
return yp_lookup_local_index(iseq, compile_context, constant_id);
}

static ID
yp_constant_id_lookup(yp_compile_context_t *compile_context, ID constant)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will necessarily cause an issue because I think ID is an unsigned long long and yp_constant_id_t is a uint32_t so it will always be wider, but better to be safe than sorry.

Suggested change
yp_constant_id_lookup(yp_compile_context_t *compile_context, ID constant)
yp_constant_id_lookup(yp_compile_context_t *compile_context, yp_constant_id_t constant)

Other than that, a comment on this function would be good just to explain what is being returned.

@jemmaissroff jemmaissroff merged commit ae41bda into ruby:master Sep 6, 2023
92 checks passed
@jemmaissroff jemmaissroff deleted the yp-constant-lookups branch October 13, 2023 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants