Avoiding retpolines with static calls
Avoiding retpolines with static calls
Posted Mar 29, 2020 15:11 UTC (Sun) by nivedita76 (subscriber, #121790)In reply to: Avoiding retpolines with static calls by ncm
Parent article: Avoiding retpolines with static calls
I'm not sure what you mean by that. The "static" mechanism discussed in the article is self-modifying code that patches the text to make a direct call. The vtable array is just a const array of function pointers, but is still accessed via an indirect call, which would have all the overhead of retpoline blocking branch prediction. The "closely akin" method would be if the compiler optimizes the virtual function call to a couple of test-and-direct-branch based on knowledge of what types could be involved.