3 ms·
With generalized polymorphic inline caches (dispatch chains) you get that cost down to the dynamic check and the JIT compiler can remove all reflective overhead
by smarr 11y ago
With generalized polymorphic inline caches (dispatch chains) you get that cost down to the dynamic check and the JIT compiler can remove all reflective overhead.
So, in the end, you get a powerful MOP without reflective overhead.
- cbsmith 11y ago> With generalized polymorphic inline caches (dispatch chains) you get that cost down to the dynamic check and the JIT compiler can remove all reflective overhead. ...which results in a scenario no different in terms of overhead or expressiveness, than you'd have with a static MOP with runtime dispatch.
- smarr 11y agoI don't follow that logic. First, I don't know what you mean with static. That you can't change the metaobject associated with a baselevel object? That's a loss of expressiveness. And, what do you mean with runtime dispatch? Static and runtime dispatch combined? I am not sure I really know what you got in mind. With dispatch chains, the runtime dispatch is resolved at runtime and the JIT compiler can inline through it. But, you need that runtime information. A static compiler, like for OpenC++ can't usually do that.
- cbsmith 11y agoA simple example would be using templated classes and functions, all of which are navigated to from a virtual base class.