Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top