Polymorphic Inline Caches

A performance-optimizing implementation of polymorphic message dispatch in object-oriented languages. Presumably first implemented in the SelfLanguage, now also used in VisualWorksSmalltalk.

Optimizing Dynamically-Typed Object-Oriented Programming Languages with Polymorphic Inline Caches: http://research.sun.com/self/papers/pics.html

"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."


PolymorphicInlineCaches extend InlineCaching 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 InlineCaches for the most common type of polymorphic calls, those that send a message to objects of a few distinct classes.


The .NET VM uses PolymorphicInlineCaches (see http://blogs.msdn.com/vancem/archive/2006/03/13/550529.aspx).

CategoryOptimization CategorySmalltalk CategoryPolymorphism CategoryDotNet

EditText of this page (last edited December 18, 2011) or FindPage with title or text search