Polymorphic Inline Caches
A performance-optimizing implementation of polymorphic message dispatch in object-oriented languages. Presumably first implemented in the
, now also used in
Optimizing Dynamically-Typed Object-Oriented Programming Languages with Polymorphic Inline Caches:
"Polymorphic inline caches (PICs) provide a new way to reduce the overhead of polymorphic message sends by extending inline caches to include more than one cached lookup result per call site."
with a lookup table of methods indexed by the class of the receiver. Whenever a message is sent to an object, the calling code looks up the method to call in the inline table, indexed by the receiver's class. If the method is not in the cache, it finds the method using a slower lookup mechanism, and then caches the address of the method in the inline table before calling it. This improves the performance of
for the most common type of polymorphic calls, those that send a message to objects of a few distinct classes.
The .NET VM uses
View edit of
December 18, 2011
with title or text search