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/compiler/driver/compiled_method_storage_test.cc b/compiler/driver/compiled_method_storage_test.cc
index 0769561..42fbba5 100644
--- a/compiler/driver/compiled_method_storage_test.cc
+++ b/compiler/driver/compiled_method_storage_test.cc
@@ -34,8 +34,6 @@
/* instruction_set_ */ InstructionSet::kNone,
/* instruction_set_features */ nullptr,
/* image_classes */ nullptr,
- /* compiled_classes */ nullptr,
- /* compiled_methods */ nullptr,
/* thread_count */ 1u,
/* swap_fd */ -1,
/* profile_compilation_info */ nullptr);
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 4093833..41b7e7b 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -264,8 +264,6 @@
InstructionSet instruction_set,
const InstructionSetFeatures* instruction_set_features,
std::unordered_set<std::string>* image_classes,
- std::unordered_set<std::string>* compiled_classes,
- std::unordered_set<std::string>* compiled_methods,
size_t thread_count,
int swap_fd,
const ProfileCompilationInfo* profile_compilation_info)
@@ -279,8 +277,6 @@
requires_constructor_barrier_lock_("constructor barrier lock"),
non_relative_linker_patch_count_(0u),
image_classes_(image_classes),
- classes_to_compile_(compiled_classes),
- methods_to_compile_(compiled_methods),
number_of_soft_verifier_failures_(0),
had_hard_verifier_failure_(false),
parallel_thread_count_(thread_count),
@@ -638,7 +634,6 @@
(verified_method->GetEncounteredVerificationFailures() &
(verifier::VERIFY_ERROR_FORCE_INTERPRETER | verifier::VERIFY_ERROR_LOCKING)) == 0 &&
// Is eligable for compilation by methods-to-compile filter.
- driver->IsMethodToCompile(method_ref) &&
driver->ShouldCompileBasedOnProfile(method_ref);
if (compile) {
@@ -1065,15 +1060,6 @@
return classes_to_compile_->find(descriptor) != classes_to_compile_->end();
}
-bool CompilerDriver::IsMethodToCompile(const MethodReference& method_ref) const {
- if (methods_to_compile_ == nullptr) {
- return true;
- }
-
- std::string tmp = method_ref.PrettyMethod();
- return methods_to_compile_->find(tmp.c_str()) != methods_to_compile_->end();
-}
-
bool CompilerDriver::ShouldCompileBasedOnProfile(const MethodReference& method_ref) const {
// Profile compilation info may be null if no profile is passed.
if (!CompilerFilter::DependsOnProfile(compiler_options_->GetCompilerFilter())) {
diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h
index a5462ee..55f3561 100644
--- a/compiler/driver/compiler_driver.h
+++ b/compiler/driver/compiler_driver.h
@@ -100,8 +100,6 @@
InstructionSet instruction_set,
const InstructionSetFeatures* instruction_set_features,
std::unordered_set<std::string>* image_classes,
- std::unordered_set<std::string>* compiled_classes,
- std::unordered_set<std::string>* compiled_methods,
size_t thread_count,
int swap_fd,
const ProfileCompilationInfo* profile_compilation_info);
@@ -316,9 +314,6 @@
// Checks whether the provided class should be compiled, i.e., is in classes_to_compile_.
bool IsClassToCompile(const char* descriptor) const;
- // Checks whether the provided method should be compiled, i.e., is in method_to_compile_.
- bool IsMethodToCompile(const MethodReference& method_ref) const;
-
// Checks whether profile guided compilation is enabled and if the method should be compiled
// according to the profile file.
bool ShouldCompileBasedOnProfile(const MethodReference& method_ref) const;
@@ -505,12 +500,8 @@
// This option may be restricted to the boot image, depending on a flag in the implementation.
std::unique_ptr<std::unordered_set<std::string>> classes_to_compile_;
- // Specifies the methods that will be compiled. Note that if methods_to_compile_ is null,
- // all methods are eligible for compilation (compilation filters etc. will still apply).
- // This option may be restricted to the boot image, depending on a flag in the implementation.
- std::unique_ptr<std::unordered_set<std::string>> methods_to_compile_;
-
std::atomic<uint32_t> number_of_soft_verifier_failures_;
+
bool had_hard_verifier_failure_;
// A thread pool that can (potentially) run tasks in parallel.
diff --git a/compiler/driver/compiler_driver_test.cc b/compiler/driver/compiler_driver_test.cc
index 162904c..1332280 100644
--- a/compiler/driver/compiler_driver_test.cc
+++ b/compiler/driver/compiler_driver_test.cc
@@ -184,59 +184,6 @@
}
}
-class CompilerDriverMethodsTest : public CompilerDriverTest {
- protected:
- std::unordered_set<std::string>* GetCompiledMethods() OVERRIDE {
- return new std::unordered_set<std::string>({
- "byte StaticLeafMethods.identity(byte)",
- "int StaticLeafMethods.sum(int, int, int)",
- "double StaticLeafMethods.sum(double, double, double, double)"
- });
- }
-};
-
-TEST_F(CompilerDriverMethodsTest, Selection) {
- Thread* self = Thread::Current();
- jobject class_loader;
- {
- ScopedObjectAccess soa(self);
- class_loader = LoadDex("StaticLeafMethods");
- }
- ASSERT_NE(class_loader, nullptr);
-
- // Need to enable dex-file writability. Methods rejected to be compiled will run through the
- // dex-to-dex compiler.
- for (const DexFile* dex_file : GetDexFiles(class_loader)) {
- ASSERT_TRUE(dex_file->EnableWrite());
- }
-
- CompileAll(class_loader);
-
- ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
- ScopedObjectAccess soa(self);
- StackHandleScope<1> hs(self);
- Handle<mirror::ClassLoader> h_loader(
- hs.NewHandle(soa.Decode<mirror::ClassLoader>(class_loader)));
- mirror::Class* klass = class_linker->FindClass(self, "LStaticLeafMethods;", h_loader);
- ASSERT_NE(klass, nullptr);
-
- std::unique_ptr<std::unordered_set<std::string>> expected(GetCompiledMethods());
-
- const auto pointer_size = class_linker->GetImagePointerSize();
- for (auto& m : klass->GetDirectMethods(pointer_size)) {
- std::string name = m.PrettyMethod(true);
- const void* code = m.GetEntryPointFromQuickCompiledCodePtrSize(pointer_size);
- ASSERT_NE(code, nullptr);
- if (expected->find(name) != expected->end()) {
- expected->erase(name);
- EXPECT_FALSE(class_linker->IsQuickToInterpreterBridge(code));
- } else {
- EXPECT_TRUE(class_linker->IsQuickToInterpreterBridge(code));
- }
- }
- EXPECT_TRUE(expected->empty());
-}
-
class CompilerDriverProfileTest : public CompilerDriverTest {
protected:
ProfileCompilationInfo* GetProfileCompilationInfo() OVERRIDE {