diff options
Diffstat (limited to 'odrefresh/odr_config.h')
| -rw-r--r-- | odrefresh/odr_config.h | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/odrefresh/odr_config.h b/odrefresh/odr_config.h index 04754663a3..d86172175e 100644 --- a/odrefresh/odr_config.h +++ b/odrefresh/odr_config.h @@ -21,6 +21,7 @@ #include <optional> #include <string> #include <unordered_map> +#include <unordered_set> #include <vector> #include "android-base/file.h" @@ -40,6 +41,22 @@ namespace odrefresh { // everything if any property matching a prefix changes. constexpr const char* kCheckedSystemPropertyPrefixes[]{"dalvik.vm.", "ro.dalvik.vm."}; +// System property for the phenotype flag to override the device or default-configured +// system server compiler filter setting. +static constexpr char kSystemPropertySystemServerCompilerFilterOverride[] = + "persist.device_config.runtime_native_boot.systemservercompilerfilter_override"; + +// The list of system properties that odrefresh ignores. They don't affect compilation results. +const std::unordered_set<std::string> kIgnoredSystemProperties{ + "dalvik.vm.dex2oat-cpu-set", + "dalvik.vm.dex2oat-threads", + "dalvik.vm.boot-dex2oat-cpu-set", + "dalvik.vm.boot-dex2oat-threads", + "dalvik.vm.restore-dex2oat-cpu-set", + "dalvik.vm.restore-dex2oat-threads", + "dalvik.vm.background-dex2oat-cpu-set", + "dalvik.vm.background-dex2oat-threads"}; + struct SystemPropertyConfig { const char* name; const char* default_value; @@ -55,7 +72,10 @@ struct SystemPropertyConfig { // requirement (go/platform-experiments-flags#pre-requisites). const android::base::NoDestructor<std::vector<SystemPropertyConfig>> kSystemProperties{ {SystemPropertyConfig{.name = "persist.device_config.runtime_native_boot.enable_uffd_gc", - .default_value = "false"}}}; + .default_value = ""}, + SystemPropertyConfig{.name = kPhDisableCompactDex, .default_value = "false"}, + SystemPropertyConfig{.name = kSystemPropertySystemServerCompilerFilterOverride, + .default_value = ""}}}; // An enumeration of the possible zygote configurations on Android. enum class ZygoteKind : uint8_t { @@ -83,6 +103,7 @@ class OdrConfig final { InstructionSet isa_; std::string program_name_; std::string system_server_classpath_; + std::string boot_image_compiler_filter_; std::string system_server_compiler_filter_; ZygoteKind zygote_kind_; std::string boot_classpath_; @@ -112,11 +133,18 @@ class OdrConfig final { const auto [isa32, isa64] = GetPotentialInstructionSets(); switch (zygote_kind_) { case ZygoteKind::kZygote32: + CHECK_NE(isa32, art::InstructionSet::kNone); return {isa32}; case ZygoteKind::kZygote32_64: - case ZygoteKind::kZygote64_32: + CHECK_NE(isa32, art::InstructionSet::kNone); + CHECK_NE(isa64, art::InstructionSet::kNone); return {isa32, isa64}; + case ZygoteKind::kZygote64_32: + CHECK_NE(isa32, art::InstructionSet::kNone); + CHECK_NE(isa64, art::InstructionSet::kNone); + return {isa64, isa32}; case ZygoteKind::kZygote64: + CHECK_NE(isa64, art::InstructionSet::kNone); return {isa64}; } } @@ -126,9 +154,11 @@ class OdrConfig final { switch (zygote_kind_) { case ZygoteKind::kZygote32: case ZygoteKind::kZygote32_64: + CHECK_NE(isa32, art::InstructionSet::kNone); return isa32; case ZygoteKind::kZygote64_32: case ZygoteKind::kZygote64: + CHECK_NE(isa64, art::InstructionSet::kNone); return isa64; } } @@ -168,6 +198,9 @@ class OdrConfig final { const std::string& GetSystemServerClasspath() const { return system_server_classpath_; } + const std::string& GetBootImageCompilerFilter() const { + return boot_image_compiler_filter_; + } const std::string& GetSystemServerCompilerFilter() const { return system_server_compiler_filter_; } @@ -204,6 +237,9 @@ class OdrConfig final { system_server_classpath_ = classpath; } + void SetBootImageCompilerFilter(const std::string& filter) { + boot_image_compiler_filter_ = filter; + } void SetSystemServerCompilerFilter(const std::string& filter) { system_server_compiler_filter_ = filter; } @@ -248,6 +284,8 @@ class OdrConfig final { case art::InstructionSet::kX86: case art::InstructionSet::kX86_64: return std::make_pair(art::InstructionSet::kX86, art::InstructionSet::kX86_64); + case art::InstructionSet::kRiscv64: + return std::make_pair(art::InstructionSet::kNone, art::InstructionSet::kRiscv64); case art::InstructionSet::kThumb2: case art::InstructionSet::kNone: LOG(FATAL) << "Invalid instruction set " << isa_; |