Re: [C++] Optimizing dynamic_cast to a final C++ class

2013-11-05 Thread Paolo Carlini
On 11/05/2013 01:36 PM, Florian Weimer wrote: I've looked at optimizing dynamic_cast to final C++ class. In theory, it should be possible to load the vtable pointer, compare it to the expected value, and use the original pointer if it matches, or NULL otherwise (for pointers, references are si

[C++] Optimizing dynamic_cast to a final C++ class

2013-11-05 Thread Florian Weimer
I've looked at optimizing dynamic_cast to final C++ class. In theory, it should be possible to load the vtable pointer, compare it to the expected value, and use the original pointer if it matches, or NULL otherwise (for pointers, references are similar but need the conditional throw). But I