ART: Remove support for compiled-methods and compiled-classes
This has been superseded by profile support.
This reverts commit 70bef0d8f6aa30b0da5c6ca56e1bc5729f74654b.
This reverts commit 4bf3ae9930a155f238dfd471413c866912b2579e.
Bug: 76145463
Test: mmma art
Test: m test-art-host
Change-Id: I5a368cd01812e16869352ec219eae095df4919c4
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 2b4604e..741bc64 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -629,10 +629,6 @@
image_classes_zip_filename_(nullptr),
image_classes_filename_(nullptr),
image_storage_mode_(ImageHeader::kStorageModeUncompressed),
- compiled_classes_zip_filename_(nullptr),
- compiled_classes_filename_(nullptr),
- compiled_methods_zip_filename_(nullptr),
- compiled_methods_filename_(nullptr),
passes_to_run_filename_(nullptr),
dirty_image_objects_filename_(nullptr),
multi_image_(false),
@@ -818,18 +814,6 @@
Usage("--image-classes-zip should be used with --image-classes");
}
- if (compiled_classes_filename_ != nullptr && !IsBootImage()) {
- Usage("--compiled-classes should only be used with --image");
- }
-
- if (compiled_classes_filename_ != nullptr && !boot_image_filename_.empty()) {
- Usage("--compiled-classes should not be used with --boot-image");
- }
-
- if (compiled_classes_zip_filename_ != nullptr && compiled_classes_filename_ == nullptr) {
- Usage("--compiled-classes-zip should be used with --compiled-classes");
- }
-
if (dex_filenames_.empty() && zip_fd_ == -1) {
Usage("Input must be supplied with either --dex-file or --zip-fd");
}
@@ -873,9 +857,7 @@
}
if (have_profile_file || have_profile_fd) {
- if (compiled_classes_filename_ != nullptr ||
- compiled_classes_zip_filename_ != nullptr ||
- image_classes_filename_ != nullptr ||
+ if (image_classes_filename_ != nullptr ||
image_classes_zip_filename_ != nullptr) {
Usage("Profile based image creation is not supported with image or compiled classes");
}
@@ -1210,10 +1192,6 @@
AssignIfExists(args, M::Threads, &thread_count_);
AssignIfExists(args, M::ImageClasses, &image_classes_filename_);
AssignIfExists(args, M::ImageClassesZip, &image_classes_zip_filename_);
- AssignIfExists(args, M::CompiledClasses, &compiled_classes_filename_);
- AssignIfExists(args, M::CompiledClassesZip, &compiled_classes_zip_filename_);
- AssignIfExists(args, M::CompiledMethods, &compiled_methods_filename_);
- AssignIfExists(args, M::CompiledMethodsZip, &compiled_methods_zip_filename_);
AssignIfExists(args, M::Passes, &passes_to_run_filename_);
AssignIfExists(args, M::BootImage, &parser_options->boot_image_filename);
AssignIfExists(args, M::AndroidRoot, &android_root_);
@@ -1535,8 +1513,7 @@
dex2oat::ReturnCode Setup() {
TimingLogger::ScopedTiming t("dex2oat Setup", timings_);
- if (!PrepareImageClasses() || !PrepareCompiledClasses() || !PrepareCompiledMethods() ||
- !PrepareDirtyObjects()) {
+ if (!PrepareImageClasses() || !PrepareDirtyObjects()) {
return dex2oat::ReturnCode::kOther;
}
@@ -1875,8 +1852,6 @@
instruction_set_,
instruction_set_features_.get(),
image_classes_.release(),
- compiled_classes_.release(),
- compiled_methods_.release(),
thread_count_,
swap_fd_,
profile_compilation_info_.get()));
@@ -2421,21 +2396,6 @@
return true;
}
- bool PrepareCompiledClasses() {
- // If --compiled-classes was specified, calculate the full list of classes to compile in the
- // image.
- if (compiled_classes_filename_ != nullptr) {
- compiled_classes_ =
- ReadClasses(compiled_classes_zip_filename_, compiled_classes_filename_, "compiled");
- if (compiled_classes_ == nullptr) {
- return false;
- }
- } else {
- compiled_classes_.reset(nullptr); // By default compile everything.
- }
- return true;
- }
-
static std::unique_ptr<std::unordered_set<std::string>> ReadClasses(const char* zip_filename,
const char* classes_filename,
const char* tag) {
@@ -2453,32 +2413,6 @@
return classes;
}
- bool PrepareCompiledMethods() {
- // If --compiled-methods was specified, read the methods to compile from the given file(s).
- if (compiled_methods_filename_ != nullptr) {
- std::string error_msg;
- if (compiled_methods_zip_filename_ != nullptr) {
- compiled_methods_.reset(ReadCommentedInputFromZip<std::unordered_set<std::string>>(
- compiled_methods_zip_filename_,
- compiled_methods_filename_,
- nullptr, // No post-processing.
- &error_msg));
- } else {
- compiled_methods_.reset(ReadCommentedInputFromFile<std::unordered_set<std::string>>(
- compiled_methods_filename_,
- nullptr)); // No post-processing.
- }
- if (compiled_methods_.get() == nullptr) {
- LOG(ERROR) << "Failed to create list of compiled methods from '"
- << compiled_methods_filename_ << "': " << error_msg;
- return false;
- }
- } else {
- compiled_methods_.reset(nullptr); // By default compile everything.
- }
- return true;
- }
-
bool PrepareDirtyObjects() {
if (dirty_image_objects_filename_ != nullptr) {
dirty_image_objects_.reset(ReadCommentedInputFromFile<std::unordered_set<std::string>>(
@@ -2919,10 +2853,6 @@
const char* image_classes_zip_filename_;
const char* image_classes_filename_;
ImageHeader::StorageMode image_storage_mode_;
- const char* compiled_classes_zip_filename_;
- const char* compiled_classes_filename_;
- const char* compiled_methods_zip_filename_;
- const char* compiled_methods_filename_;
const char* passes_to_run_filename_;
const char* dirty_image_objects_filename_;
std::unique_ptr<std::unordered_set<std::string>> image_classes_;