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 similar but need the
conditional throw).
But I remember a discussion on the cxxabi list that vtables are not
deduplicated if they are contained in multiple libraries, so a simple
pointer comparison won't do. Is there anything else that could be
used as a reliable marker? If not, do you think it would be feasible
to add a fast-path for final target classes to the __dynamic_cast
implementation?
Just wanted to say that if you are going to work in this are you could
consider also adding the warning per c++/12277 (/38557), which seems
nice to have.
Paolo.