Fix FindDeclaredVirtualMethod(DexCache...) for miranda methods

If a class in classes.dex implements an interface from classes2.dex,
the miranda method will be in the dex cache for classes2.dex, but
pointed to by the virtual methods of the class in the dex caches for
classes.dex.

Therefore the fast path for DexCache::ResolveMethod that searches via
class and superclass virtual methods should ensure that any method
matching on dex method_idx should be from the same dex cache as the
class itself, which is not the case for miranda methods.

Bug: 18193682

(cherry picked from commit 9a783d6a0cb437fc0d9ffcc84502912f3d1cb73b)

Change-Id: Ia44f72c2ed2701e48153d14d2c5ca4ccc4959b30
1 file changed