Skip to content

ZJIT: Specialize Hash#fetch(key, default) case #1086

Open
ruby/ruby
#19949

Description

@tekknolagi

We don't need to do a bunch of variadic setup here.

Activity

  1. tekknolagi commented on Oct 20, 2026

    @tekknolagi
    Author

    We'll need to figure out how to integrate this neatly with rb_hash_fetch_m though

  2. nithya4005 commented on Oct 27, 2026

    @nithya4005

    Hi, I’d like to take this one. I read rb_hash_fetch_m in hash.c, and plan to add an inline_hash_fetch in cruby_methods.rs for the two-argument case, modeled on inline_hash_aref.

    Is a new HIR instruction the expected approach, or should it reuse an existing one?

  3. tekknolagi commented on Oct 27, 2026

    @tekknolagi
    Author

    Probably a new HIR instruction for now until we have a better idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions