diff options
author | Alan Wu <[email protected]> | 2024-02-15 11:59:37 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-02-15 11:59:37 -0500 |
commit | da7b9478d33d212145f2b79e378cb617451f3a5b (patch) | |
tree | 07f2af41bc52301a3f9d70a294c55060775461d9 /yjit.c | |
parent | e779c194b3520973e42e277ed4759a90b97795d0 (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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |