Skip to content

ZJIT: Specialize #[] into ArrayArefFixnum if a profiled type is Array #792

Description

@k0kubun

ruby#14717 added ArrayArefFixnum for the case that the receiver is an Array literal in the ISEQ. But in many cases, an array is given as a return value of a method or a variable, and the current implementation is not applicable for such cases.

As we've added zjit_opt_aref instruction, we should be able to just read the profiled type, add a GuardType that the receiver is an Array, and use almost the same HIR as ruby#14717 for such cases.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions