Use ArtMethod::GetDex{File,Cache}() more.

Do not go through the declaring class when it can cause
a DexFile or DexCache mismatch for obsolete methods.

Also fix similar potential mismatch in hiddenapi.

This is a follow-up to
    https://android-review.googlesource.com/834082 ,
    https://android-review.googlesource.com/836008 .

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 119830111
Change-Id: I3fdf1aa1bc7bab816d5d8034b107506a32438b77
4 files changed