diff options
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r-- | compiler/driver/compiler_driver.cc | 37 |
1 files changed, 3 insertions, 34 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); } }; |