If this method is always at the same position in virtual table, we can use direct access, Otherwise we must use perfect hashing
# Optimize a method dispatch,
# If this method is always at the same position in virtual table, we can use direct access,
# Otherwise we must use perfect hashing
fun optimize(recv: Instance)
do
var position = recv.mtype.as(MClassType).mclass.get_position_methods(mproperty.intro_mclassdef.mclass)
if position > 0 then
offset = position + mproperty.offset
status = 1
else
offset = mproperty.offset
status = 2
end
id = mproperty.intro_mclassdef.mclass.vtable.id
end
src/vm/vm_optimizations.nit:175,2--189,4