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.
ruby#14717 added
ArrayArefFixnumfor 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_arefinstruction, we should be able to just read the profiled type, add aGuardTypethat the receiver is an Array, and use almost the same HIR as ruby#14717 for such cases.