News for hackers. Stuff that matters.
Re:Interface Dispatch (2018) by chrisseaton on Thursday April 18, 2019 @08:29AM (#19690484)
> In the Java section I also show inline caching, a standard optimization approach.

Thanks. Does the CLR do inline caching for interface calls which cannot be devirtualised without speculation? Or not because of the lack of deoptimisation? Or does it have self-modifying code instead?

Re:Interface Dispatch (2018) by pjmlp on Thursday April 18, 2019 @08:44AM (#19690547)
It depends very much of which .NET runtime we talk about (NGEN, Pre-RyuJIT, RyuJIT, IL2CPP, Mono, MDIL, .NET Native, .NET Core, Burst), and which version of it.
Re:Interface Dispatch (2018) by latk on Thursday April 18, 2019 @08:46AM (#19690557)
CLR routes any interface calls through an indirect cell or pad that can be quickly rewritten to point to a different dispatch stub. Some stubs perform caching whereas the generic resolver behaves as explained by the pseudocode in my article.

The “book of the runtime” has a graph visualizing these possibilities: https://github.com/dotnet/coreclr/blob/master/Documentation/...

So this is a self-modifying code approach.