2 ms·
> like see that there's only one implementation of an interface and thereby devirtualize calls to that interface Oh, the JIT devirtualizes and inlines even if
by pron 8y ago
> like see that there's only one implementation of an interface and thereby devirtualize calls to that interface
Oh, the JIT devirtualizes and inlines even if there are many implementations, but only one or two at a particular callsite. This has been generalized in Graal/Truffle so you almost automatically get stuff like this (https://twitter.com/ChrisGSeaton/status/619885182104043520 https://twitter.com/ChrisGSeaton/status/619885182104043520, https://gist.github.com/chrisseaton/4464807d93b972813e49 https://gist.github.com/chrisseaton/4464807d93b972813e49) by doing little more than writing an interpreter.