o.m
, where o
is of static class C
.
Suppose this method invocation appears in the body of class B
. The statically
determined ctable of class B
designates an offset for the method
m
of class C
. In our scheme, o.m
is compiled to
access the entry of class B
's offset table for a new
offset . This new offset is copied from the global allocation table
during class loading. It is the actual offset of the method m
in the vtable of class C
. Although the
dynamic class of object o
could be a subclass of C
,
it is safe to use the offset to access the vtable of object o
for invoking the method, because we have arranged the vtables
of a superclass and its subclasses to be consistent.