History log of /art/runtime/oat_file_assistant.h
Revision Date Author Comments
6619cdd9f133c90f5d3a28d7723887b888a9f45a 17-May-2016 Richard Uhler <ruhler@google.com> Only compile dex files if they are not up to date.

Instead of trying to compile them all the time, and relying on file
permissions to keep us from overwriting up-to-date dex files with
different compiler filters.

Bug: 27641809
Bug: 28639246
Bug: 28826195
Change-Id: Ie717089d58517427b6f9a522b48146761c57a1a9
cd7e7f78b8e97c1f6419f3f44e0d5fdc6eddfdc6 02-May-2016 Narayan Kamath <narayan@google.com> DexFile: Add an API to query oat file status.

Adds DexFile.getDexFileStatus(path), which returns an opaque,
human-readable string representation of the oat file status. This
representation isn't guaranteed to be stable and can change from
release to release.

bug: 27494108

Change-Id: I5fc42225ae65eb19dcd0c619a40cf674b34fc49c
fd336c344058274fada3c48fbd356befca285b9a 08-Apr-2016 Jeff Hao <jeffhao@google.com> Fix combined checksum calculation to use isa.

Bug: 28054110

(cherry-picked from commit 8bbda8e683a1933755d0b8a68fed620cd63148ee)

Change-Id: I228db6ea1003e4e70d6a5fa7345d56409e70bd87
b11ffb7f33d70da0eb2caf891bbfdab9129fe5b4 08-Apr-2016 Jeff Hao <jeffhao@google.com> Combine checksum of all boot images.

Allows a change to be detected in more than just the first image.
Combines checksums of all boot images using xor. A better hash is left
as TODO.

Bug: 28054110

(cherry-picked from commit 4f351aae00f43dd4e3290976f249d3664cc47091)

Change-Id: Ia557e2460ca582082368ef93508c04ce32c3036a
539d38c67c521aa17741a41fc4c4462b576adfd9 08-Apr-2016 Jeff Hao <jeffhao@google.com> Fix combined checksum calculation to use isa.

Bug: 28054110
Change-Id: Ifcd1b0c4549a22bf4181f8acad222da05ac9f1ce
4f351aae00f43dd4e3290976f249d3664cc47091 08-Apr-2016 Jeff Hao <jeffhao@google.com> Combine checksum of all boot images.

Allows a change to be detected in more than just the first image.
Combines checksums of all boot images using xor. A better hash is left
as TODO.

Bug: 28054110
Change-Id: Ifbdd6cbb0104c95e8926ba4f8a207cc72dbb7f79
ff0274bd8a67e3512ff85cc05b77fd01df368638 30-Mar-2016 Richard Uhler <ruhler@google.com> Refine OatFileAssistant.MakeUpToDate failure result.

Avoid misleading log messages if MakeUpToDate fails because we decided
not to compile dex code.

Bug: 27641809
(cherry picked from commit 1e860619cdcc9c0b6a202a247c50cf7633ac7b74)

Change-Id: Iab6f8ff2756393bfe3a7be4643e908be648bd10d
1e860619cdcc9c0b6a202a247c50cf7633ac7b74 30-Mar-2016 Richard Uhler <ruhler@google.com> Refine OatFileAssistant.MakeUpToDate failure result.

Avoid misleading log messages if MakeUpToDate fails because we decided
not to compile dex code.

Bug: 27641809
Change-Id: I184f8e89648183cba4ebe7a1dc5e0e6c8774c15b
1c4eb04b6cb1427f96e9587bd425ee269b8c8479 29-Mar-2016 Richard Uhler <ruhler@google.com> Don't return kPatchOatNeeded if there is no patch info.

Bug: 27693977
(cherry picked from commit d1537b569b6cd18297c5e02d13cdd588c4366c51)

Change-Id: Icd25da796fc2c2b7542a47d1d8d3bcbcace145fb
d1537b569b6cd18297c5e02d13cdd588c4366c51 29-Mar-2016 Richard Uhler <ruhler@google.com> Don't return kPatchOatNeeded if there is no patch info.

Bug: 27693977
Change-Id: Ie1f27cc45f3cb434108a375136480cb92fd95e26
7bcfcb80a31f57a84d754e00bca8698829365208 23-Mar-2016 Andreas Gampe <agampe@google.com> Revert "Revert "Use compiler filter to determine oat file status.""

This reverts commit 845e5064580bd37ad5014f7aa0d078be7265464d.

Add an option to change what OatFileManager considers up-to-date.
In our tests we're allowed to write to the dalvik-cache, so it
cannot be kSpeed.

(cherry picked from commit 29d38e77c553c6cf71fc4dafe2d22b4e3f814872)

Bug: 27689078
Change-Id: I6274188610f31dcd9d086fc080b2be93afae5a6b
29d38e77c553c6cf71fc4dafe2d22b4e3f814872 23-Mar-2016 Andreas Gampe <agampe@google.com> Revert "Revert "Use compiler filter to determine oat file status.""

This reverts commit 845e5064580bd37ad5014f7aa0d078be7265464d.

Add an option to change what OatFileManager considers up-to-date.
In our tests we're allowed to write to the dalvik-cache, so it
cannot be kSpeed.

Bug: 27689078
Change-Id: I0c578705a9921114ed1fb00d360cc7448addc93a
845e5064580bd37ad5014f7aa0d078be7265464d 23-Mar-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Use compiler filter to determine oat file status."

Bots are red. Tentative reverting as this is likely the offender.

Bug: 27689078

This reverts commit a62d2f04a6ecf804f8a78e722a6ca8ccb2dfa931.

Change-Id: I3ec6947a5a4be878ff81f26f17dc36a209734e2a
a62d2f04a6ecf804f8a78e722a6ca8ccb2dfa931 18-Mar-2016 Richard Uhler <ruhler@google.com> Use compiler filter to determine oat file status.

Record the compiler filter in the oat header. Use that to determine
when the oat file is up-to-date with respect to a target compiler
filter level.

New xxx-profile filter levels are added to specify if a profile should
be used instead of testing for the presence of a profile file.

This change should allow for different compiler-filters to be set for
different package manager use cases.

Bug: 27689078
Change-Id: Id6706d0ed91b45f307142692ea4316aa9713b023
b077e15d2d11b7c81aacbcd4a46c2b1e9c9ba20d 18-Feb-2016 Calin Juravle <calin@google.com> Update GetDexOptNeeded to handle different levels of compilation

extract-only or profile-guide oat files are considered up to date from
runtime perspective as they don't necessary need (re)compilation or
relocation. However, it is useful to return a more refined code to the
caller so that they can decide whether or not that's good enough.

For example, the package manager might decide to still compile a
previous extract-only and during profile guide compilation we should
always recompile even if we have an oat file.

Note that dex files compiled via ClassLoaders will still be fully
compiled.

This change introduces:
- a new key in the oat header kCompilationType to capture what type of
compilation has been made. Note tha the key might be missing. The
distinction is needed in order to avoid recompilation of a previous
fully compiled file during profile guide compilation analysis.
- a new argument to GetDexOptNeeded which tells the runtime to cast its
opinion whether or not the oat file is up to date relative to the
desired target type of compilation.

Bug: 27189430

(cherry picked from commit d91b8a2464b99625efe03caf7d30c8372bc378ed)

Change-Id: I6ce450350f388451f7bab7d285c1846d539a4b13
d91b8a2464b99625efe03caf7d30c8372bc378ed 18-Feb-2016 Calin Juravle <calin@google.com> Update GetDexOptNeeded to handle the different levels of compilation

extract-only or profile-guide oat files are considered up to date from
runtime perspective as they don't necessary need (re)compilation or
relocation. However, it is useful to return a more refined code to the
caller so that they can decide whether or not that's good enough.

For example, the package manager might decide to still compile a
previous extract-only and during profile guide compilation we should
always recompile even if we have an oat file.

Note that dex files compiled via ClassLoaders will still be fully
compiled.

This change introduces:
- a new key in the oat header kCompilationType to capture what type of
compilation has been made. Note tha the key might be missing. The
distinction is needed in order to avoid recompilation of a previous
fully compiled file during profile guide compilation analysis.
- a new argument to GetDexOptNeeded which tells the runtime to cast its
opinion whether or not the oat file is up to date relative to the
desired target type of compilation.

Bug: 27189430
Change-Id: Icd9794b1df6f6e21242e1dd1d5b5d064963dbbb7
fbc31087932a65e036a153afab3049dc5298656a 24-Jan-2016 Mathieu Chartier <mathieuc@google.com> Revert "Revert "Load app images""

This reverts commit 1bc977cf2f8199311a97f2ba9431a184540e3e9c.

Bug: 22858531

Change-Id: Ide00bf3a73a02cba3bb364177204ad1b13f70295
1bc977cf2f8199311a97f2ba9431a184540e3e9c 23-Jan-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Load app images"

Fails when a method is duplicated (see test 097-duplicate-method)

Bug: 22858531

This reverts commit f7fd970244f143b1abb956e29794c446e4d57f46.

Change-Id: Ib30ae5be00cc568e799290be6b3c8f29cbbe4c20
f7fd970244f143b1abb956e29794c446e4d57f46 09-Nov-2015 Mathieu Chartier <mathieuc@google.com> Load app images

Support in-place patching of the app image based on boot image
location and app oat location. Only loads for art run test so far
since we do not automatically generate app images for app installs.

N5 maps launch time (~200 runs):
Before: 930ms
After: 878.18ms
After + image class table: 864.57ms

TODO:
Oatdump support.
Store class loaders as class roots in image.

Bug: 22858531

Change-Id: I9cbc645645e62ea2ed1ad8e139e91af7d88514c1
740eec92a7f63e8ddff1e007ae624d548a4e5a16 16-Oct-2015 Richard Uhler <ruhler@google.com> Change dex_location_ from const char* to std::string.

Because we tend to use the dex_location_ as an std::string fairly
often.

Change-Id: Ida9624c9cb12c8ad30577146f1e6e97e25edc155
5f946da9c362216e9144b142ec0e5b90073b836d 17-Jul-2015 Richard Uhler <ruhler@google.com> Fix bug in OatFileAssistant::GetBestOatFile.

Previously, GetBestOatFile would fail to return an oat file in the
case where a non-executable oat file was requested and the only
problem with the oat file was that it wasn't relocated.

Bug: 22561444
Change-Id: I6446bf474afaf6c97861e7a89bd74a07c5a52a21
9b994ea841eaaefbdda652251894a74db9cefcc8 24-Jun-2015 Richard Uhler <ruhler@google.com> Do not try to compile resource-only dex files.

This changes behavior in the case where we are asked to load a dex
file that does not exist or has no classes.dex entry.

Previously we would run dex2oat, which would log an error message and
fail. Now we skip running dex2oat, we report the DexOptStatus as
kNoDexOptNeeded, and we do not try to fall back to the missing
original dex files.

Bug: 21722039
(cherry picked from commit cb44b11a926696e34b3dc44288e762b4303cc128)

Change-Id: I84a85dc9ece54bcc0a5283f871e09bf68471c6e7
cb44b11a926696e34b3dc44288e762b4303cc128 24-Jun-2015 Richard Uhler <ruhler@google.com> Do not try to compile resource-only dex files.

This changes behavior in the case where we are asked to load a dex
file that does not exist or has no classes.dex entry.

Previously we would run dex2oat, which would log an error message and
fail. Now we skip running dex2oat, we report the DexOptStatus as
kNoDexOptNeeded, and we do not try to fall back to the missing
original dex files.

Bug: 21722039
Change-Id: I90b1f4165138daac57bb9d7a354319005652c593
325ec9bd8574b4bdff1dd6584b1b4ca6d6ddf9f9 07-May-2015 Richard Uhler <ruhler@google.com> Fix bug in removal of *.flock files.

Bug: 20816098
(cherry picked from commit 581f4e9065b9b7f788315d3ea1a45e51ae168589)

Change-Id: Ib7bd394a9dd0299f09d386ae010972b461217550
581f4e9065b9b7f788315d3ea1a45e51ae168589 07-May-2015 Richard Uhler <ruhler@google.com> Fix bug in removal of *.flock files.

Bug: 20816098
Change-Id: I72ee32884f32af43a54518c9b9772f63957ab5de
b361d948dcefcfa9bb78ccff2c18c750ed202828 07-May-2015 Richard Uhler <ruhler@google.com> Fix typo in comments.

Change-Id: I6569c0fdc878f797b37509432b59b0d5c9bc5533
2cebb24bfc3247d3e9be138a3350106737455918 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Replace NULL with nullptr

Also fixed some lines that were too long, and a few other minor
details.

Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
95abd04d211470ea4b9b9191b96dd0f32e7ce3a4 24-Mar-2015 Richard Uhler <ruhler@google.com> Rename isDexOptNeededInternal and add kSelfPatchOatNeeded

This change renames isDexOptNeededInternal to getDexOptNeeded and adds
another possible result: kSelfPatchOatNeeded. kSelfPatchOatNeeded is
returned when there is no odex file to relocate from but there is an
oat file that can be relocated in place.

Change-Id: Ib9a6373f98474f1242367b5285086251a9d580e5
6343411e52d2a59cd716cb47a85ebd0d68e61a3c 16-Mar-2015 Richard Uhler <ruhler@google.com> Store odex files in oat/<isa>/ directory.

Previously odex files were stored alongside the dex location as:
dex location: /foo/bar/base.apk
odex location: /foo/bar/<isa>/base.odex

This changes where odex files are stored, adding an "oat" directory:
dex location: /foo/bar/base.apk
odex location: /foo/bar/oat/<isa>/base.odex

See also the corresponding change in platform/build and
platform/frameworks/native.

Bug: 19550105
Change-Id: I4c6be4f0c41ff175904846db8e360c4af815b265
66d874d96d5699bb090c59f47a5a528956ca053e 15-Jan-2015 Richard Uhler <ruhler@google.com> Create OatFileAssistant class for assisting with oat files.

The oat file assistant is used for determining whether dex2oat or
patchoat is needed, for running dex2oat or patchoat as needed to make
an oat file up to date, and to load dex files associated with a given
dex location.

The introduction of the OatFileAssistant class is meant to clean up and
consolidate code related to the management of oat files that was
duplicated and spread across dalvik_system_DexFile.cc and
class_linker.cc.

Bug: 11301553
Change-Id: I0c16027b9bae4570c2c50faa9c14f581c0cbafb8