search for: base_vtable

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

2016 Jan 28
8
Proposal: virtual constant propagation
...e type hierarchy is known to be closed and the definition of each virtual function and each virtual call is visible to the 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...
2016 Jan 28
2
Proposal: virtual constant propagation
...e definition of each virtual function and each virtual call is visible >> to the 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 *...