diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/debug/elf_debug_info_writer.h | 4 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 17 | ||||
| -rw-r--r-- | compiler/utils/assembler_thumb_test_expected.cc.inc | 4 |
3 files changed, 19 insertions, 6 deletions
diff --git a/compiler/debug/elf_debug_info_writer.h b/compiler/debug/elf_debug_info_writer.h index fe05992960..bb550b3060 100644 --- a/compiler/debug/elf_debug_info_writer.h +++ b/compiler/debug/elf_debug_info_writer.h @@ -372,10 +372,10 @@ class ElfCompilationUnitWriter { } // Base class. - mirror::Class* base_class = type->GetSuperClass(); + ObjPtr<mirror::Class> base_class = type->GetSuperClass(); if (base_class != nullptr) { info_.StartTag(DW_TAG_inheritance); - base_class_references.emplace(info_.size(), base_class); + base_class_references.emplace(info_.size(), base_class.Ptr()); info_.WriteRef4(DW_AT_type, 0); info_.WriteUdata(DW_AT_data_member_location, 0); info_.WriteSdata(DW_AT_accessibility, DW_ACCESS_public); diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 89ac308fed..864b215a90 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -715,6 +715,7 @@ void CompilerDriver::ResolveConstStrings(const std::vector<const DexFile*>& dex_ StackHandleScope<1> hs(soa.Self()); ClassLinker* const class_linker = Runtime::Current()->GetClassLinker(); MutableHandle<mirror::DexCache> dex_cache(hs.NewHandle<mirror::DexCache>(nullptr)); + size_t num_instructions = 0u; for (const DexFile* dex_file : dex_files) { dex_cache.Assign(class_linker->FindDexCache(soa.Self(), *dex_file)); @@ -726,10 +727,20 @@ void CompilerDriver::ResolveConstStrings(const std::vector<const DexFile*>& dex_ // FIXME: Make sure that inlining honors this. b/26687569 continue; } + + const bool is_startup_class = + profile_compilation_info_ != nullptr && + profile_compilation_info_->ContainsClass(*dex_file, accessor.GetClassIdx()); + for (const ClassAccessor::Method& method : accessor.GetMethods()) { + const bool is_clinit = (method.GetAccessFlags() & kAccConstructor) != 0 && + (method.GetAccessFlags() & kAccStatic) != 0; + const bool is_startup_clinit = is_startup_class && is_clinit; + if (only_startup_strings && profile_compilation_info_ != nullptr && - !profile_compilation_info_->GetMethodHotness(method.GetReference()).IsStartup()) { + (!profile_compilation_info_->GetMethodHotness(method.GetReference()).IsStartup() && + !is_startup_clinit)) { continue; } @@ -746,6 +757,7 @@ void CompilerDriver::ResolveConstStrings(const std::vector<const DexFile*>& dex_ : inst->VRegB_31c()); ObjPtr<mirror::String> string = class_linker->ResolveString(string_index, dex_cache); CHECK(string != nullptr) << "Could not allocate a string when forcing determinism"; + ++num_instructions; break; } @@ -756,6 +768,7 @@ void CompilerDriver::ResolveConstStrings(const std::vector<const DexFile*>& dex_ } } } + VLOG(compiler) << "Resolved " << num_instructions << " const string instructions"; } // Initialize type check bit strings for check-cast and instance-of in the code. Done to have @@ -1154,7 +1167,7 @@ static void MaybeAddToImageClasses(Thread* self, if (klass->IsArrayClass()) { MaybeAddToImageClasses(self, klass->GetComponentType(), image_classes); } - klass.Assign(klass->GetSuperClass()); + klass = klass->GetSuperClass(); } } diff --git a/compiler/utils/assembler_thumb_test_expected.cc.inc b/compiler/utils/assembler_thumb_test_expected.cc.inc index 85e4326494..0d279ede19 100644 --- a/compiler/utils/assembler_thumb_test_expected.cc.inc +++ b/compiler/utils/assembler_thumb_test_expected.cc.inc @@ -76,7 +76,7 @@ const char* const VixlJniHelpersResults[] = { " f0: f1bc 0f00 cmp.w ip, #0\n", " f4: bf18 it ne\n", " f6: f20d 4c01 addwne ip, sp, #1025 ; 0x401\n", - " fa: f8d9 c08c ldr.w ip, [r9, #140] ; 0x8c\n", + " fa: f8d9 c094 ldr.w ip, [r9, #148] ; 0x94\n", " fe: f1bc 0f00 cmp.w ip, #0\n", " 102: d171 bne.n 1e8 <VixlJniHelpers+0x1e8>\n", " 104: f8cd c7ff str.w ip, [sp, #2047] ; 0x7ff\n", @@ -153,7 +153,7 @@ const char* const VixlJniHelpersResults[] = { " 21c: f8d9 8034 ldr.w r8, [r9, #52] ; 0x34\n", " 220: 4770 bx lr\n", " 222: 4660 mov r0, ip\n", - " 224: f8d9 c2d4 ldr.w ip, [r9, #724] ; 0x2d4\n", + " 224: f8d9 c2dc ldr.w ip, [r9, #732] ; 0x2dc\n", " 228: 47e0 blx ip\n", nullptr }; |