diff options
author | 2018-11-07 11:41:01 -0800 | |
---|---|---|
committer | 2018-11-08 08:59:24 -0800 | |
commit | a297b55dd8be424c7cdd4328356431d62e833d8f (patch) | |
tree | 4e1ff9218394e44fc8c99d13d4d6fe92851c6b5f | |
parent | a5de05da46e8a93436e68e7e0d242dce46269527 (diff) |
Delete IsClassToCompile
Compiled classes filtering is no longer a thing.
Bug: 26687569
Bug: 76145463
Test: test-art-host
Change-Id: Iaf4b9dcea5d9fe1eae564fbd6d373af2fdc87b14
-rw-r--r-- | compiler/driver/compiler_driver.cc | 37 | ||||
-rw-r--r-- | compiler/driver/compiler_driver.h | 8 | ||||
-rw-r--r-- | compiler/optimizing/sharpening.cc | 2 |
3 files changed, 4 insertions, 43 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index f7bff4d336..0d0a7f2b6a 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -428,7 +428,6 @@ static void CompileMethodHarness( Handle<mirror::ClassLoader> class_loader, const DexFile& dex_file, optimizer::DexToDexCompiler::CompilationLevel dex_to_dex_compilation_level, - bool compilation_enabled, Handle<mirror::DexCache> dex_cache, CompileFn compile_fn) { DCHECK(driver != nullptr); @@ -446,7 +445,6 @@ static void CompileMethodHarness( class_loader, dex_file, dex_to_dex_compilation_level, - compilation_enabled, dex_cache); if (kTimeCompileMethod) { @@ -479,7 +477,6 @@ static void CompileMethodDex2Dex( Handle<mirror::ClassLoader> class_loader, const DexFile& dex_file, optimizer::DexToDexCompiler::CompilationLevel dex_to_dex_compilation_level, - bool compilation_enabled, Handle<mirror::DexCache> dex_cache) { auto dex_2_dex_fn = [](Thread* self ATTRIBUTE_UNUSED, CompilerDriver* driver, @@ -491,7 +488,6 @@ static void CompileMethodDex2Dex( Handle<mirror::ClassLoader> class_loader, const DexFile& dex_file, optimizer::DexToDexCompiler::CompilationLevel dex_to_dex_compilation_level, - bool compilation_enabled ATTRIBUTE_UNUSED, Handle<mirror::DexCache> dex_cache ATTRIBUTE_UNUSED) -> CompiledMethod* { DCHECK(driver != nullptr); MethodReference method_ref(&dex_file, method_idx); @@ -528,7 +524,6 @@ static void CompileMethodDex2Dex( class_loader, dex_file, dex_to_dex_compilation_level, - compilation_enabled, dex_cache, dex_2_dex_fn); } @@ -544,7 +539,6 @@ static void CompileMethodQuick( Handle<mirror::ClassLoader> class_loader, const DexFile& dex_file, optimizer::DexToDexCompiler::CompilationLevel dex_to_dex_compilation_level, - bool compilation_enabled, Handle<mirror::DexCache> dex_cache) { auto quick_fn = []( Thread* self, @@ -557,7 +551,6 @@ static void CompileMethodQuick( Handle<mirror::ClassLoader> class_loader, const DexFile& dex_file, optimizer::DexToDexCompiler::CompilationLevel dex_to_dex_compilation_level, - bool compilation_enabled, Handle<mirror::DexCache> dex_cache) { DCHECK(driver != nullptr); CompiledMethod* compiled_method = nullptr; @@ -583,7 +576,7 @@ static void CompileMethodQuick( VerificationResults* results = driver->GetVerificationResults(); DCHECK(results != nullptr); const VerifiedMethod* verified_method = results->GetVerifiedMethod(method_ref); - bool compile = compilation_enabled && + bool compile = // Basic checks, e.g., not <clinit>. results->IsCandidateForCompilation(method_ref, access_flags) && // Did not fail to create VerifiedMethod metadata. @@ -626,7 +619,6 @@ static void CompileMethodQuick( class_loader, dex_file, dex_to_dex_compilation_level, - compilation_enabled, dex_cache, quick_fn); } @@ -660,7 +652,6 @@ void CompilerDriver::CompileOne(Thread* self, h_class_loader, dex_file, dex_to_dex_compilation_level, - true, dex_cache); const size_t num_methods = dex_to_dex_compiler_.NumCodeItemsToQuicken(self); @@ -676,7 +667,6 @@ void CompilerDriver::CompileOne(Thread* self, h_class_loader, dex_file, dex_to_dex_compilation_level, - true, dex_cache); dex_to_dex_compiler_.ClearState(); } @@ -721,15 +711,11 @@ void CompilerDriver::ResolveConstStrings(const std::vector<const DexFile*>& dex_ } TimingLogger::ScopedTiming t("Resolve const-string Strings", timings); + // TODO: Implement a profile-based filter for the boot image. See b/76145463. for (ClassAccessor accessor : dex_file->GetClasses()) { - if (!IsClassToCompile(accessor.GetDescriptor())) { - // Compilation is skipped, do not resolve const-string in code of this class. - // FIXME: Make sure that inlining honors this. b/26687569 - continue; - } - const ProfileCompilationInfo* profile_compilation_info = GetCompilerOptions().GetProfileCompilationInfo(); + const bool is_startup_class = profile_compilation_info != nullptr && profile_compilation_info->ContainsClass(*dex_file, accessor.GetClassIdx()); @@ -833,12 +819,6 @@ static void InitializeTypeCheckBitstrings(CompilerDriver* driver, TimingLogger::ScopedTiming t("Initialize type check bitstrings", timings); for (ClassAccessor accessor : dex_file->GetClasses()) { - if (!driver->IsClassToCompile(accessor.GetDescriptor())) { - // Compilation is skipped, do not look for type checks in code of this class. - // FIXME: Make sure that inlining honors this. b/26687569 - continue; - } - // Direct and virtual methods. for (const ClassAccessor::Method& method : accessor.GetMethods()) { InitializeTypeCheckBitstrings(driver, class_linker, dex_cache, *dex_file, method); @@ -965,13 +945,6 @@ void CompilerDriver::PreCompile(jobject class_loader, } } -bool CompilerDriver::IsClassToCompile(const char* descriptor) const { - if (classes_to_compile_ == nullptr) { - return true; - } - return classes_to_compile_->find(StringPiece(descriptor)) != classes_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())) { @@ -2611,9 +2584,6 @@ static void CompileDexFile(CompilerDriver* driver, optimizer::DexToDexCompiler::CompilationLevel dex_to_dex_compilation_level = GetDexToDexCompilationLevel(soa.Self(), *driver, jclass_loader, dex_file, class_def); - - const bool compilation_enabled = driver->IsClassToCompile(accessor.GetDescriptor()); - // Compile direct and virtual methods. int64_t previous_method_idx = -1; for (const ClassAccessor::Method& method : accessor.GetMethods()) { @@ -2634,7 +2604,6 @@ static void CompileDexFile(CompilerDriver* driver, class_loader, dex_file, dex_to_dex_compilation_level, - compilation_enabled, dex_cache); } }; diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 94efdd8304..714b2d1fc8 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -209,9 +209,6 @@ class CompilerDriver { return compiled_method_storage_.DedupeEnabled(); } - // Checks whether the provided class should be compiled, i.e., is in classes_to_compile_. - bool IsClassToCompile(const char* descriptor) 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; @@ -368,11 +365,6 @@ class CompilerDriver { // Dex2Oat rather than implicitly by CompileAll(). HashSet<std::string>* image_classes_; - // Specifies the classes that will be compiled. Note that if classes_to_compile_ is null, - // all classes are eligible for compilation (duplication filters etc. will still apply). - // This option may be restricted to the boot image, depending on a flag in the implementation. - std::unique_ptr<HashSet<std::string>> classes_to_compile_; - std::atomic<uint32_t> number_of_soft_verifier_failures_; bool had_hard_verifier_failure_; diff --git a/compiler/optimizing/sharpening.cc b/compiler/optimizing/sharpening.cc index c864951a47..885a08d459 100644 --- a/compiler/optimizing/sharpening.cc +++ b/compiler/optimizing/sharpening.cc @@ -233,7 +233,7 @@ static inline bool CanUseTypeCheckBitstring(ObjPtr<mirror::Class> klass, CodeGen // Try to assign a type check bitstring. MutexLock subtype_check_lock(Thread::Current(), *Locks::subtype_check_lock_); - if ((false) && // FIXME: Inliner does not respect CompilerDriver::IsClassToCompile() + if ((false) && // FIXME: Inliner does not respect CompilerDriver::ShouldCompileMethod() // and we're hitting an unassigned bitstring in dex2oat_image_test. b/26687569 kIsDebugBuild && codegen->GetCompilerOptions().IsBootImage() && |