summaryrefslogtreecommitdiff
path: root/yjit.c
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2024-02-15 11:59:37 -0500
committerGitHub <[email protected]>2024-02-15 11:59:37 -0500
commitda7b9478d33d212145f2b79e378cb617451f3a5b (patch)
tree07f2af41bc52301a3f9d70a294c55060775461d9 /yjit.c
parente779c194b3520973e42e277ed4759a90b97795d0 (diff)
YJIT: Pass nil to anonymous kwrest when empty (#9972)
This is the same optimization as e4272fd29 ("Avoid allocation when passing no keywords to anonymous kwrest methods") but for YJIT. For anonymous kwrest parameters, nil is just as good as an empty hash. On the usage side, update `splatkw` to handle `nil` with a leaner path.
Diffstat (limited to 'yjit.c')
-rw-r--r--yjit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/yjit.c b/yjit.c
index 4e9fed35ae..207974073b 100644
--- a/yjit.c
+++ b/yjit.c
@@ -660,6 +660,12 @@ rb_get_iseq_flags_has_kwrest(const rb_iseq_t *iseq)
}
bool
+rb_get_iseq_flags_anon_kwrest(const rb_iseq_t *iseq)
+{
+ return iseq->body->param.flags.anon_kwrest;
+}
+
+bool
rb_get_iseq_flags_has_rest(const rb_iseq_t *iseq)
{
return iseq->body->param.flags.has_rest;