summaryrefslogtreecommitdiffstats
path: root/runtime/class_linker.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2014-09-05 14:01:17 +0100
committerVladimir Marko <vmarko@google.com>2014-09-10 16:02:14 +0100
commitaa4497db59f1eeec954f2ba5da6d458fcdf9b3a4 (patch)
tree1efe5c6c5fe93ae73b6ad02db1a4ac368c71c00e /runtime/class_linker.h
parent6724a9531c92368491dd17937d0087f73a7c0642 (diff)
downloadart-aa4497db59f1eeec954f2ba5da6d458fcdf9b3a4.zip
art-aa4497db59f1eeec954f2ba5da6d458fcdf9b3a4.tar.gz
art-aa4497db59f1eeec954f2ba5da6d458fcdf9b3a4.tar.bz2
Improve dex location canonicalization-related performance.
Eagerly add canonical dex file locations to the OatFile's primary lookup map in Setup(). This moves the boot.oat work from every app startup to the zygote initialization. Since we always ended up initializing the canonical location map anyway due to the way that we're loading dex files, the lazy initialization didn't save anything. Clean up dex file name canonicalization to make sure we free() the memory returned by realpath() rather than using std::unique_ptr<> with the default deleter. Avoid some unnecessary duplicate OatDexFile lookups. Bug: 16828525 Bug: 17346103 Change-Id: Id8fbc8992f62996138eb2006a0046c6529747c09
Diffstat (limited to 'runtime/class_linker.h')
-rw-r--r--runtime/class_linker.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/runtime/class_linker.h b/runtime/class_linker.h
index d1f5aa0..0248a21 100644
--- a/runtime/class_linker.h
+++ b/runtime/class_linker.h
@@ -549,14 +549,15 @@ class ClassLinker {
}
mirror::DexCache* GetDexCache(size_t idx) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_, dex_lock_);
- const OatFile* FindOpenedOatFileForDexFile(const DexFile& dex_file)
+ const OatFile::OatDexFile* FindOpenedOatDexFileForDexFile(const DexFile& dex_file)
LOCKS_EXCLUDED(dex_lock_)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- // Find an opened oat file that contains dex_location. If oat_location is not nullptr, the file
- // must have that location, else any oat location is accepted.
- const OatFile* FindOpenedOatFile(const char* oat_location, const char* dex_location,
- const uint32_t* const dex_location_checksum)
+ // Find an opened oat dex file that contains dex_location. If oat_location is not nullptr,
+ // the file must have that location, else any oat location is accepted.
+ const OatFile::OatDexFile* FindOpenedOatDexFile(const char* oat_location,
+ const char* dex_location,
+ const uint32_t* dex_location_checksum)
LOCKS_EXCLUDED(dex_lock_);
// Will open the oat file directly without relocating, even if we could/should do relocation.
@@ -606,8 +607,8 @@ class ClassLinker {
// Note 1: this will not check open oat files, which are assumed to be stale when this is run.
// Note 2: Does not register the oat file. It is the caller's job to register if the file is to
// be kept.
- const OatFile* FindOatFileContainingDexFileFromDexLocation(const char* location,
- const uint32_t* const location_checksum,
+ const OatFile* FindOatFileContainingDexFileFromDexLocation(const char* dex_location,
+ const uint32_t* dex_location_checksum,
InstructionSet isa,
std::vector<std::string>* error_msgs,
bool* obsolete_file_cleanup_failed)