Created
December 29, 2013 21:22
-
-
Save xushijie/8174975 to your computer and use it in GitHub Desktop.
Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches (Stanford)
Published in ECOOP ‘91 proceedings, Springer Verlag Lecture Notes in Computer Science 512, July, 1991
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is basic background literature for dynamic language and polymorphic inline cache. | |
The basic idea: | |
1, collect type information by recording all of the receiver types actually used at a given call site. | |
2, The compiler can exploit this type information to generate better code when recompiling a method. |
Type prediction, analysis and split may work in some scenarios.
Nevertheless, there are classes of variables and expressions that type analysis cannot analyze well. One such class is the types of arguments to the method (our SELFsystem customizes on the type of the receiver, but not on the type of arguments).
Another important class is the types of instance variables and array elements (actually, any assignable heap cell).
These weaknesses of type analysis can be quite damaging to the overall performance of the system, espe-
cially for typical object-oriented programs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inline cache would result bad performance if cached type does not match given object type. False Cache Locality
Inline Cache(monomorphic) VS polymorphic VS megamorphic ( http://en.wikipedia.org/wiki/Inline_caching for simple explanation )