[4.8] Backport vtable verification feature

Squashed backport of r20138 and r201555