ART: Fix sharpening across dex files

Bug: 15196336

(cherry picked from commit e0099d4d4839cabfb26270a746580e9d4ec3a6c6)

Change-Id: Ieae2e5c9ba4d5a76120236fd1bd7bd1daacc4a59
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 999d6a5..f8c75d1 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -1135,7 +1135,7 @@
       if (dex_method_idx != DexFile::kDexNoIndex) {
         target_method->dex_method_index = dex_method_idx;
       } else {
-        if (compiling_boot) {
+        if (compiling_boot && !use_dex_cache) {
           target_method->dex_method_index = method->GetDexMethodIndex();
           target_method->dex_file = method->GetDeclaringClass()->GetDexCache()->GetDexFile();
         }