diff options
author | 2021-07-08 10:20:26 +0800 | |
---|---|---|
committer | 2021-07-14 23:37:32 +0000 | |
commit | d61b021fffc641906d1c531a233b62a8f66c184a (patch) | |
tree | 2e81f49ce6986fbc069286d28b48f41b19dce0c6 /libartbase/base/file_utils.cc | |
parent | 9e050ab1a061d9660eb0c1daa01a823ad75b0f05 (diff) |
Trigger on-device AOT compilation for system_server on mainline update.
Before this change, AOT compilation for system_server are triggered only
on ART mainline update, and only the system_server components in /system are compiled.
After this change, AOT compilation for system_server are triggered on
any mainline update that touches $BOOTCLASSPATH or
$SYSTEMSERVERCLASSPATH, and the system_server components in mainline
modules are also compiled.
Test: manual - 1. Modify a mainline module (such as com.android.wifi).
2. Install the modified module on a device and reboot the device.
3. See if system_server components are recompiled (while boot
classpath components are not).
Test: atest odsign_e2e_tests
Test: art/tools/run-gtests.sh -j8 apex/com.android.art/bin/art/x86_64/art_libartbase_tests
Test: atest art_odrefresh_tests
Bug: 189467174
Change-Id: Icaba5471e9f62fd035f0a24d662ecfaf2e064cab
Diffstat (limited to 'libartbase/base/file_utils.cc')
-rw-r--r-- | libartbase/base/file_utils.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libartbase/base/file_utils.cc b/libartbase/base/file_utils.cc index cb0023e635..5650457268 100644 --- a/libartbase/base/file_utils.cc +++ b/libartbase/base/file_utils.cc @@ -430,13 +430,14 @@ static std::string GetApexDataDalvikCacheDirectory(InstructionSet isa) { static std::string GetApexDataDalvikCacheFilename(std::string_view dex_location, InstructionSet isa, - bool encode_location, + bool is_boot_classpath_location, std::string_view file_extension) { - if (LocationIsOnApex(dex_location)) { + if (LocationIsOnApex(dex_location) && is_boot_classpath_location) { + // We don't compile boot images for updatable APEXes. return {}; } std::string apex_data_dalvik_cache = GetApexDataDalvikCacheDirectory(isa); - if (encode_location) { + if (!is_boot_classpath_location) { // Arguments: "/system/framework/xyz.jar", "arm", true, "odex" // Result: // "/data/misc/apexdata/com.android.art/dalvik-cache/arm/system@framework@xyz.jar@classes.odex" @@ -455,24 +456,25 @@ static std::string GetApexDataDalvikCacheFilename(std::string_view dex_location, } std::string GetApexDataOatFilename(std::string_view location, InstructionSet isa) { - return GetApexDataDalvikCacheFilename(location, isa, /*encode_location=*/false, "oat"); + return GetApexDataDalvikCacheFilename(location, isa, /*is_boot_classpath_location=*/true, "oat"); } std::string GetApexDataOdexFilename(std::string_view location, InstructionSet isa) { - return GetApexDataDalvikCacheFilename(location, isa, /*encode_location=*/true, "odex"); + return GetApexDataDalvikCacheFilename( + location, isa, /*is_boot_classpath_location=*/false, "odex"); } std::string GetApexDataBootImage(std::string_view dex_location) { return GetApexDataDalvikCacheFilename(dex_location, InstructionSet::kNone, - /*encode_location=*/false, + /*is_boot_classpath_location=*/true, kArtImageExtension); } std::string GetApexDataImage(std::string_view dex_location) { return GetApexDataDalvikCacheFilename(dex_location, InstructionSet::kNone, - /*encode_location=*/true, + /*is_boot_classpath_location=*/false, kArtImageExtension); } @@ -480,7 +482,7 @@ std::string GetApexDataDalvikCacheFilename(std::string_view dex_location, InstructionSet isa, std::string_view file_extension) { return GetApexDataDalvikCacheFilename( - dex_location, isa, /*encode_location=*/true, file_extension); + dex_location, isa, /*is_boot_classpath_location=*/false, file_extension); } std::string GetVdexFilename(const std::string& oat_location) { |