summaryrefslogtreecommitdiffstats
path: root/runtime/oat_file.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2017-11-20 15:10:28 +0000
committerNicolas Geoffray <ngeoffray@google.com>2017-12-13 22:23:12 +0000
commitae7e83817e546848ef6b2949dd9065b153e14316 (patch)
treee46ea86e925c4b2a4237f5ebba0c7ba3d61b0359 /runtime/oat_file.h
parentdc93cac66f1db225474cec5bf0350fd7a148085e (diff)
downloadart-ae7e83817e546848ef6b2949dd9065b153e14316.tar.gz
art-ae7e83817e546848ef6b2949dd9065b153e14316.tar.bz2
art-ae7e83817e546848ef6b2949dd9065b153e14316.zip
Don't embed the dex code in the oat file if dex is uncompressed.
Take uncompressed dex code as a signal that the app wants to opt into b/63920015. bug: 63920015 Test: dex2oat_test, 071-dexfile-clean-map Change-Id: I878e7bb80fc895a2d9aafe81aa7666b86af1f808
Diffstat (limited to 'runtime/oat_file.h')
-rw-r--r--runtime/oat_file.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/oat_file.h b/runtime/oat_file.h
index 36a4d7b8fc..61daa9579e 100644
--- a/runtime/oat_file.h
+++ b/runtime/oat_file.h
@@ -324,6 +324,11 @@ class OatFile {
return vdex_.get();
}
+ // Whether the OatFile embeds the Dex code.
+ bool ContainsDexCode() const {
+ return uncompressed_dex_files_ == nullptr;
+ }
+
protected:
OatFile(const std::string& filename, bool executable);
@@ -389,6 +394,10 @@ class OatFile {
// elements. std::list<> and std::deque<> satisfy this requirement, std::vector<> doesn't.
mutable std::list<std::string> string_cache_ GUARDED_BY(secondary_lookup_lock_);
+ // Cache of dex files mapped directly from a location, in case the OatFile does
+ // not embed the dex code.
+ std::unique_ptr<std::vector<std::unique_ptr<const DexFile>>> uncompressed_dex_files_;
+
friend class gc::collector::DummyOatFile; // For modifying begin_ and end_.
friend class OatClass;
friend class art::OatDexFile;