Loading cmds/installd/dexopt.cpp +5 −7 Original line number Original line Diff line number Diff line Loading @@ -1156,8 +1156,8 @@ Dex2oatFileWrapper maybe_open_reference_profile(const std::string& pkgname, // Opens the vdex files and assigns the input fd to in_vdex_wrapper_fd and the output fd to // Opens the vdex files and assigns the input fd to in_vdex_wrapper_fd and the output fd to // out_vdex_wrapper_fd. Returns true for success or false in case of errors. // out_vdex_wrapper_fd. Returns true for success or false in case of errors. bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_needed, bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_needed, const char* instruction_set, bool is_public, bool profile_guided, const char* instruction_set, bool is_public, int uid, bool is_secondary_dex, int uid, bool is_secondary_dex, Dex2oatFileWrapper* in_vdex_wrapper_fd, Dex2oatFileWrapper* in_vdex_wrapper_fd, Dex2oatFileWrapper* out_vdex_wrapper_fd) { Dex2oatFileWrapper* out_vdex_wrapper_fd) { CHECK(in_vdex_wrapper_fd != nullptr); CHECK(in_vdex_wrapper_fd != nullptr); CHECK(out_vdex_wrapper_fd != nullptr); CHECK(out_vdex_wrapper_fd != nullptr); Loading @@ -1167,9 +1167,7 @@ bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_ int dexopt_action = abs(dexopt_needed); int dexopt_action = abs(dexopt_needed); bool is_odex_location = dexopt_needed < 0; bool is_odex_location = dexopt_needed < 0; std::string in_vdex_path_str; std::string in_vdex_path_str; // Disable passing an input vdex when the compilation is profile-guided. The dexlayout if (dexopt_action != DEX2OAT_FROM_SCRATCH) { // optimization in dex2oat is incompatible with it. b/35872504. if (dexopt_action != DEX2OAT_FROM_SCRATCH && !profile_guided) { // Open the possibly existing vdex. If none exist, we pass -1 to dex2oat for input-vdex-fd. // Open the possibly existing vdex. If none exist, we pass -1 to dex2oat for input-vdex-fd. const char* path = nullptr; const char* path = nullptr; if (is_odex_location) { if (is_odex_location) { Loading Loading @@ -1528,8 +1526,8 @@ int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* ins // Open vdex files. // Open vdex files. Dex2oatFileWrapper in_vdex_fd; Dex2oatFileWrapper in_vdex_fd; Dex2oatFileWrapper out_vdex_fd; Dex2oatFileWrapper out_vdex_fd; if (!open_vdex_files(dex_path, out_oat_path, dexopt_needed, instruction_set, is_public, if (!open_vdex_files(dex_path, out_oat_path, dexopt_needed, instruction_set, is_public, uid, profile_guided, uid, is_secondary_dex, &in_vdex_fd, &out_vdex_fd)) { is_secondary_dex, &in_vdex_fd, &out_vdex_fd)) { return -1; return -1; } } Loading Loading
cmds/installd/dexopt.cpp +5 −7 Original line number Original line Diff line number Diff line Loading @@ -1156,8 +1156,8 @@ Dex2oatFileWrapper maybe_open_reference_profile(const std::string& pkgname, // Opens the vdex files and assigns the input fd to in_vdex_wrapper_fd and the output fd to // Opens the vdex files and assigns the input fd to in_vdex_wrapper_fd and the output fd to // out_vdex_wrapper_fd. Returns true for success or false in case of errors. // out_vdex_wrapper_fd. Returns true for success or false in case of errors. bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_needed, bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_needed, const char* instruction_set, bool is_public, bool profile_guided, const char* instruction_set, bool is_public, int uid, bool is_secondary_dex, int uid, bool is_secondary_dex, Dex2oatFileWrapper* in_vdex_wrapper_fd, Dex2oatFileWrapper* in_vdex_wrapper_fd, Dex2oatFileWrapper* out_vdex_wrapper_fd) { Dex2oatFileWrapper* out_vdex_wrapper_fd) { CHECK(in_vdex_wrapper_fd != nullptr); CHECK(in_vdex_wrapper_fd != nullptr); CHECK(out_vdex_wrapper_fd != nullptr); CHECK(out_vdex_wrapper_fd != nullptr); Loading @@ -1167,9 +1167,7 @@ bool open_vdex_files(const char* apk_path, const char* out_oat_path, int dexopt_ int dexopt_action = abs(dexopt_needed); int dexopt_action = abs(dexopt_needed); bool is_odex_location = dexopt_needed < 0; bool is_odex_location = dexopt_needed < 0; std::string in_vdex_path_str; std::string in_vdex_path_str; // Disable passing an input vdex when the compilation is profile-guided. The dexlayout if (dexopt_action != DEX2OAT_FROM_SCRATCH) { // optimization in dex2oat is incompatible with it. b/35872504. if (dexopt_action != DEX2OAT_FROM_SCRATCH && !profile_guided) { // Open the possibly existing vdex. If none exist, we pass -1 to dex2oat for input-vdex-fd. // Open the possibly existing vdex. If none exist, we pass -1 to dex2oat for input-vdex-fd. const char* path = nullptr; const char* path = nullptr; if (is_odex_location) { if (is_odex_location) { Loading Loading @@ -1528,8 +1526,8 @@ int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* ins // Open vdex files. // Open vdex files. Dex2oatFileWrapper in_vdex_fd; Dex2oatFileWrapper in_vdex_fd; Dex2oatFileWrapper out_vdex_fd; Dex2oatFileWrapper out_vdex_fd; if (!open_vdex_files(dex_path, out_oat_path, dexopt_needed, instruction_set, is_public, if (!open_vdex_files(dex_path, out_oat_path, dexopt_needed, instruction_set, is_public, uid, profile_guided, uid, is_secondary_dex, &in_vdex_fd, &out_vdex_fd)) { is_secondary_dex, &in_vdex_fd, &out_vdex_fd)) { return -1; return -1; } } Loading