// Constants used by VMRuntime.java to interface with the runtime. // We could get them from the well known class but it's simpler to // redefine them here.
// Encapsulates the information the runtime has about the application. // // The app's info comes from 2 channels: // 1) during class loading, when we load oat files. // 2) during app startup, when the framework calls VMRuntime#registerAppInfo. // In general the class loading event happens before VMRuntime#registerAppInfo. class AppInfo { public: enumclass CodeType {
kUnknown,
kPrimaryApk,
kSplitApk,
kSecondaryDex,
};
// Converts VMRuntime.java constansts to a CodeType. static CodeType FromVMRuntimeConstants(uint32_t code_type);
// Registers the optimization status for single code path. Returns the code // type for that code path.
AppInfo::CodeType RegisterOdexStatus(const std::string& code_path, const std::string& compiler_filter, const std::string& compilation_reason, const std::string& odex_status);
// Extracts the optimization status of the primary APK into the given arguments. // If there are multiple primary APKs registed via RegisterAppInfo, the method // will assign the status of the first APK, sorted by the location name. // // Assigns "unknown" if there is no primary APK or the optimization status was // not set via RegisterOdexStatus, void GetPrimaryApkOptimizationStatus(std::string* out_compiler_filter,
std::string* out_compilation_reason);
// Returns the reference profile path of the primary APK. // If there are multiple primary APKs registed via RegisterAppInfo, the method // will return the profile of the first APK, sorted by the location name. // // Returns an empty string if there is no primary APK.
std::string GetPrimaryApkReferenceProfile();
// Returns the path of the primary APK. // If there are multiple primary APKs registed via RegisterAppInfo, the method // will return the path of the first APK, sorted by the location name. // // Returns an empty string if there is no primary APK.
std::string GetPrimaryApkPath();
// Whether we've received a call to RegisterAppInfo. bool HasRegisteredAppInfo();
// The registered code type for a given code path. Note that this will // be kUnknown until an explicit registration for that path has been made.
CodeType GetRegisteredCodeType(const std::string& code_path);
std::string GetCompilerFilter(const std::string& code_path);
private: // Encapsulates optimization information about a particular code location. struct CodeLocationInfo { // The type of the code location (primary, split, secondary, unknown).
CodeType code_type{CodeType::kUnknown};
// The compiler filter of the oat file. Note that this contains // the output of OatFileAssistant#GetOptimizationStatus() which may // contain values outside the scope of the CompilerFilter enum.
std::optional<std::string> compiler_filter;
// The compiler reason of the oat file. Note that this contains // the output of OatFileAssistant#GetOptimizationStatus().
std::optional<std::string> compilation_reason;
// The odes status as produced by OatFileAssistant#GetOptimizationStatus().
std::optional<std::string> odex_status;
// The path to the primary profile if given.
std::optional<std::string> cur_profile_path;
// The path to the reference profile if given.
std::optional<std::string> ref_profile_path;
};
// The name of the package if set.
std::optional<std::string> package_name_ GUARDED_BY(update_mutex_);
// The registered code locations.
SafeMap<std::string, CodeLocationInfo> registered_code_locations_ GUARDED_BY(update_mutex_);
// Lock to touch the state ot the AppInfo object.
art::Mutex update_mutex_ BOTTOM_MUTEX_ACQUIRED_AFTER;
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.