search for: derived_vtable

Displaying 2 results from an estimated 2 matches for "derived_vtable".

2016 Jan 28
8
Proposal: virtual constant propagation
...compiler, calls to either of these functions can be implemented more efficiently by loading directly from the vtable (we refer to this as virtual constant propagation): struct Base_VTable { bool isDerived : 1, isOfTypeBase : 1, isOfTypeDerived : 1; }; Base_VTable base_vtable{false, true, false}; Derived_VTable derived_vtable{true, false, true}; bool f(Base *b) { return b->vtable->isDerived; } bool g(Base *b) { return b->vtable->isOfTypeDerived; } Another advantage of implementing the calls this way is that because there is no indirect call taking place, no control flow integrity check is...
2016 Jan 28
2
Proposal: virtual constant propagation
...gt;> efficiently by loading directly from the vtable (we refer to this as virtual >> constant propagation): >> >> struct Base_VTable { >> bool isDerived : 1, isOfTypeBase : 1, isOfTypeDerived : 1; >> }; >> Base_VTable base_vtable{false, true, false}; >> Derived_VTable derived_vtable{true, false, true}; >> bool f(Base *b) { >> return b->vtable->isDerived; >> } >> bool g(Base *b) { >> return b->vtable->isOfTypeDerived; >> } >> >> Another advantage of implementing the calls this way is that because there...