// The prefixes of system properties that odrefresh keeps track of. Odrefresh will recompile // everything if any property matching a prefix changes.
constexpr constchar* 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"};
// The system properties that odrefresh keeps track of, in addition to the ones matching the // prefixes in `kCheckedSystemPropertyPrefixes`. Odrefresh will recompile everything if any property // changes. // All phenotype flags under the `runtime_native_boot` namespace that affects the compiler's // behavior must be explicitly listed below. We cannot use a prefix to match all phenotype flags // because a default value is required for each flag. Changing the flag value from empty to the // default value should not trigger re-compilation. This is to comply with the phenotype flag // 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_2",
.default_value = "false"},
SystemPropertyConfig{.name = "persist.device_config.runtime_native_boot.force_disable_uffd_gc",
.default_value = "false"},
SystemPropertyConfig{.name = kSystemPropertySystemServerCompilerFilterOverride,
.default_value = ""}, // For testing only (cf. odsign_e2e_tests_full).
SystemPropertyConfig{.name = "persist.device_config.runtime_native_boot.odrefresh_test_toggle",
.default_value = "false"}}};
// An enumeration of the possible zygote configurations on Android. enumclass ZygoteKind : uint8_t { // 32-bit primary zygote, no secondary zygote.
kZygote32 = 0, // 32-bit primary zygote, 64-bit secondary zygote.
kZygote32_64 = 1, // 64-bit primary zygote, 32-bit secondary zygote.
kZygote64_32 = 2, // 64-bit primary zygote, no secondary zygote.
kZygote64 = 3
};
class OdrSystemProperties : public tools::SystemProperties { public: explicit OdrSystemProperties( const std::unordered_map<std::string, std::string>* system_properties)
: system_properties_(system_properties) {}
// For supporting foreach loops. auto begin() const { return system_properties_->begin(); } auto end() const { return system_properties_->end(); }
// Return a given property's value if it exists in the map.
std::optional<std::string> GetOrNull(const std::string& key) const { auto it = system_properties_->find(key); return it != system_properties_->end() ? std::make_optional(it->second) : std::nullopt;
}
protected:
std::string GetProperty(const std::string& key) const override { auto it = system_properties_->find(key); return it != system_properties_->end() ? it->second : "";
}
private: // Returns a pair for the possible instruction sets for the configured instruction set // architecture. The first item is the 32-bit architecture and the second item is the 64-bit // architecture. The current `isa` is based on `kRuntimeISA` on target, odrefresh is compiled // 32-bit by default so this method returns all options which are finessed based on the // `ro.zygote` property.
std::pair<InstructionSet, InstructionSet> GetPotentialInstructionSets() const { switch (isa_) { case art::InstructionSet::kArm: case art::InstructionSet::kArm64: return std::make_pair(art::InstructionSet::kArm, art::InstructionSet::kArm64); 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_; return std::make_pair(art::InstructionSet::kNone, art::InstructionSet::kNone);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.