Cache dynamic_cast result in MethodMetadata::isWildcard
Cache dynamic_cast result in MethodMetadata::isWildcard

Summary:
`dynamic_cast` is expensive even if the class is final because it's possible to have multiple copies of vtables for the same class (e.g. shared libraries).

This means that if a simple vtable pointer check fails in the implementation of `dynamic_cast`, then it must fall back to an (expensive) string check for the type's name.

Note that `isWildcard` is `false` in most cases, which means `dynamic_cast` will take the unhappy/expensive path most of the time. This diff addresses the issue by caching the result of `dynamic_cast`.

Reviewed By: maalbash

Differential Revision: D39358268

fbshipit-source-id: f1efd2e53785db054649402409d7b70574a489de

facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift