From 45724f9a0cc38dbb3071beb3eeab96499868b49c Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 17 Feb 2016 17:46:10 +0000 Subject: Revert "Allow method references across oat files for multi-image." Breaks Quick tests. This reverts commit 6065402316da2b51eed5fc34cffbd991766bd408. Change-Id: I8a5469ba7cea5f46b85cb489b3e0ef06ed548f03 --- compiler/driver/compiler_driver.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'compiler/driver/compiler_driver.h') diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index ca340ee92c..5e35cbb309 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -94,11 +94,9 @@ class CompilerDriver { bool boot_image, std::unordered_set* image_classes, std::unordered_set* compiled_classes, std::unordered_set* compiled_methods, - size_t thread_count, - bool dump_stats, - bool dump_passes, - CumulativeLogger* timer, - int swap_fd, + size_t thread_count, bool dump_stats, bool dump_passes, + CumulativeLogger* timer, int swap_fd, + const std::unordered_map* dex_to_oat_map, const ProfileCompilationInfo* profile_compilation_info); ~CompilerDriver(); @@ -115,6 +113,20 @@ class CompilerDriver { : ArrayRef(); } + // Are the given dex files compiled into the same oat file? Should only be called after + // GetDexFilesForOatFile, as the conservative answer (when we don't have a map) is true. + bool AreInSameOatFile(const DexFile* d1, const DexFile* d2) { + if (dex_file_oat_filename_map_ == nullptr) { + // TODO: Check for this wrt/ apps and boot image calls. + return true; + } + auto it1 = dex_file_oat_filename_map_->find(d1); + DCHECK(it1 != dex_file_oat_filename_map_->end()); + auto it2 = dex_file_oat_filename_map_->find(d2); + DCHECK(it2 != dex_file_oat_filename_map_->end()); + return it1->second == it2->second; + } + void CompileAll(jobject class_loader, const std::vector& dex_files, TimingLogger* timings) @@ -688,6 +700,9 @@ class CompilerDriver { // List of dex files that will be stored in the oat file. const std::vector* dex_files_for_oat_file_; + // Map from dex files to the oat file (name) they will be compiled into. + const std::unordered_map* dex_file_oat_filename_map_; + CompiledMethodStorage compiled_method_storage_; // Info for profile guided compilation. -- cgit v1.2.3-59-g8ed1b