The JVM optimizes this by using (P)ICs, which are faster than regular vtables.
http://en.wikipedia.org/wiki/Inline_caching
The JVM optimizes this by using (P)ICs, which are faster than regular vtables.
http://en.wikipedia.org/wiki/Inline_caching