See ruby#16121, where we start to refuse specializing super from within blocks.
Finding the active method from within a block requires dynamically looping over all EP levels terminating at the VM_ENV_LOCAL_P level. The loop can be in HIR, LIR, or in a helper function we call at runtime. It seems HIR can do the best job optimizing the loop because some EP levels may happen to be available already, in context. (The loop has a statically known upper bound on the number of iterations)
Also ref: ruby#17347
See ruby#16121, where we start to refuse specializing
superfrom within blocks.Finding the active method from within a block requires dynamically looping over all EP levels terminating at the
VM_ENV_LOCAL_Plevel. The loop can be in HIR, LIR, or in a helper function we call at runtime. It seems HIR can do the best job optimizing the loop because some EP levels may happen to be available already, in context. (The loop has a statically known upper bound on the number of iterations)Also ref: ruby#17347