semantic: Correctly assign vtable indices to methods.

Consider

class A { a() {} } class B { b() {} a() {} }

The previous code assigned B.b an index of 0, and
B.a an index of 1. Whereas the vtable (correctly)
arranged them {a, b}.