Frage

Caching is the usual strategy that VMs use to make dynamic method dispatch rival that of static "v-table" based method lookup. Can we take advantage of this to intelligently "pre-call" methods on various objects we expect an application to create, in hopes that we will avoid a cache miss when the method is actually used by the program in its 'normal' execution flow? Are there any languages with VMs where this practice is encouraged or somehow made easier? Can VMs themselves automate this process in times when a program is not doing much work?

War es hilfreich?

Lösung

I think MethodHandle of JDK 1.7 is the answer. Take a look on this topic MethodHandle - What is it all about?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top