diff options
author | 2022-02-01 17:06:21 +0000 | |
---|---|---|
committer | 2022-02-02 00:07:57 +0000 | |
commit | 239c449f10853374a9a7a2bd1d8413354054573e (patch) | |
tree | ef99d1d7700955ddf53e64e4552f0c6c569ba5b0 /compiler/optimizing | |
parent | 8ee882bf027def128c015f03bcf5b56cc74dd9fb (diff) |
Revert "Add bss support for inlining BCP DexFiles for single image"
This reverts commit 2d62882195eb97358fb8a1fd147d52a36cd3c581.
Reason for revert: Native crashes due to out of date OatFile b/217369528
Change-Id: I7bf7d6decb24934b47d5a4b2cc2ce25906032f10
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/code_generator_arm64.cc | 4 | ||||
-rw-r--r-- | compiler/optimizing/code_generator_arm_vixl.cc | 4 | ||||
-rw-r--r-- | compiler/optimizing/code_generator_x86.cc | 8 | ||||
-rw-r--r-- | compiler/optimizing/code_generator_x86_64.cc | 8 | ||||
-rw-r--r-- | compiler/optimizing/inliner.cc | 11 | ||||
-rw-r--r-- | compiler/optimizing/sharpening.cc | 1 |
6 files changed, 11 insertions, 25 deletions
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc index 037c81a696..548b2d42bd 100644 --- a/compiler/optimizing/code_generator_arm64.cc +++ b/compiler/optimizing/code_generator_arm64.cc @@ -283,9 +283,7 @@ class LoadClassSlowPathARM64 : public SlowPathCodeARM64 { InvokeRuntimeCallingConvention calling_convention; if (must_resolve_type) { DCHECK(IsSameDexFile(cls_->GetDexFile(), arm64_codegen->GetGraph()->GetDexFile()) || - arm64_codegen->GetCompilerOptions().WithinOatFile(&cls_->GetDexFile()) || - ContainsElement(Runtime::Current()->GetClassLinker()->GetBootClassPath(), - &cls_->GetDexFile())); + arm64_codegen->GetCompilerOptions().WithinOatFile(&cls_->GetDexFile())); dex::TypeIndex type_index = cls_->GetTypeIndex(); __ Mov(calling_convention.GetRegisterAt(0).W(), type_index.index_); if (cls_->NeedsAccessCheck()) { diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc index 2104f79eaf..bafa89fd32 100644 --- a/compiler/optimizing/code_generator_arm_vixl.cc +++ b/compiler/optimizing/code_generator_arm_vixl.cc @@ -531,9 +531,7 @@ class LoadClassSlowPathARMVIXL : public SlowPathCodeARMVIXL { InvokeRuntimeCallingConventionARMVIXL calling_convention; if (must_resolve_type) { DCHECK(IsSameDexFile(cls_->GetDexFile(), arm_codegen->GetGraph()->GetDexFile()) || - arm_codegen->GetCompilerOptions().WithinOatFile(&cls_->GetDexFile()) || - ContainsElement(Runtime::Current()->GetClassLinker()->GetBootClassPath(), - &cls_->GetDexFile())); + arm_codegen->GetCompilerOptions().WithinOatFile(&cls_->GetDexFile())); dex::TypeIndex type_index = cls_->GetTypeIndex(); __ Mov(calling_convention.GetRegisterAt(0), type_index.index_); if (cls_->NeedsAccessCheck()) { diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index 4025684bda..0efd51cedf 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -290,9 +290,7 @@ class LoadClassSlowPathX86 : public SlowPathCode { InvokeRuntimeCallingConvention calling_convention; if (must_resolve_type) { DCHECK(IsSameDexFile(cls_->GetDexFile(), x86_codegen->GetGraph()->GetDexFile()) || - x86_codegen->GetCompilerOptions().WithinOatFile(&cls_->GetDexFile()) || - ContainsElement(Runtime::Current()->GetClassLinker()->GetBootClassPath(), - &cls_->GetDexFile())); + x86_codegen->GetCompilerOptions().WithinOatFile(&cls_->GetDexFile())); dex::TypeIndex type_index = cls_->GetTypeIndex(); __ movl(calling_convention.GetRegisterAt(0), Immediate(type_index.index_)); if (cls_->NeedsAccessCheck()) { @@ -5476,9 +5474,7 @@ void CodeGeneratorX86::RecordMethodBssEntryPatch(HInvoke* invoke) { ? invoke->AsInvokeInterface()->GetSpecialInputIndex() : invoke->AsInvokeStaticOrDirect()->GetSpecialInputIndex(); DCHECK(IsSameDexFile(GetGraph()->GetDexFile(), *invoke->GetMethodReference().dex_file) || - GetCompilerOptions().WithinOatFile(invoke->GetMethodReference().dex_file) || - ContainsElement(Runtime::Current()->GetClassLinker()->GetBootClassPath(), - invoke->GetMethodReference().dex_file)); + GetCompilerOptions().WithinOatFile(invoke->GetMethodReference().dex_file)); HX86ComputeBaseMethodAddress* method_address = invoke->InputAt(index)->AsX86ComputeBaseMethodAddress(); // Add the patch entry and bind its label at the end of the instruction. diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc index bbbaa82851..1016652478 100644 --- a/compiler/optimizing/code_generator_x86_64.cc +++ b/compiler/optimizing/code_generator_x86_64.cc @@ -274,9 +274,7 @@ class LoadClassSlowPathX86_64 : public SlowPathCode { // Custom calling convention: RAX serves as both input and output. if (must_resolve_type) { DCHECK(IsSameDexFile(cls_->GetDexFile(), x86_64_codegen->GetGraph()->GetDexFile()) || - x86_64_codegen->GetCompilerOptions().WithinOatFile(&cls_->GetDexFile()) || - ContainsElement(Runtime::Current()->GetClassLinker()->GetBootClassPath(), - &cls_->GetDexFile())); + x86_64_codegen->GetCompilerOptions().WithinOatFile(&cls_->GetDexFile())); dex::TypeIndex type_index = cls_->GetTypeIndex(); __ movl(CpuRegister(RAX), Immediate(type_index.index_)); if (cls_->NeedsAccessCheck()) { @@ -1243,9 +1241,7 @@ void CodeGeneratorX86_64::RecordBootImageMethodPatch(HInvoke* invoke) { void CodeGeneratorX86_64::RecordMethodBssEntryPatch(HInvoke* invoke) { DCHECK(IsSameDexFile(GetGraph()->GetDexFile(), *invoke->GetMethodReference().dex_file) || - GetCompilerOptions().WithinOatFile(invoke->GetMethodReference().dex_file) || - ContainsElement(Runtime::Current()->GetClassLinker()->GetBootClassPath(), - invoke->GetMethodReference().dex_file)); + GetCompilerOptions().WithinOatFile(invoke->GetMethodReference().dex_file)); method_bss_entry_patches_.emplace_back(invoke->GetMethodReference().dex_file, invoke->GetMethodReference().index); __ Bind(&method_bss_entry_patches_.back().label); diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 4cce9f7607..ac71ce9b8a 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -1717,12 +1717,11 @@ static bool CanEncodeInlinedMethodInStackMap(const DexFile& outer_dex_file, // Inline across dexfiles if the callee's DexFile is: // 1) in the bootclasspath, or if (callee->GetDeclaringClass()->GetClassLoader() == nullptr) { - // In multi-image, each BCP DexFile has their own OatWriter. Since they don't cooperate with - // each other, we request the BSS check for them. - // TODO(solanes): Add .bss support for BCP multi-image. - const bool is_multi_image = codegen->GetCompilerOptions().IsBootImage() || - codegen->GetCompilerOptions().IsBootImageExtension(); - *out_needs_bss_check = is_multi_image; + // There are cases in which the BCP DexFiles are within the OatFile as far as the compiler + // options are concerned, but they have their own OatWriter (and therefore not in the same + // OatFile). Then, we request the BSS check for all BCP DexFiles. + // TODO(solanes): Add .bss support for BCP. + *out_needs_bss_check = true; return true; } diff --git a/compiler/optimizing/sharpening.cc b/compiler/optimizing/sharpening.cc index eb4c20690f..1fd76f7029 100644 --- a/compiler/optimizing/sharpening.cc +++ b/compiler/optimizing/sharpening.cc @@ -283,7 +283,6 @@ HLoadClass::LoadKind HSharpening::ComputeLoadClassKind( // We actually cannot reference this class, we're forced to bail. // We cannot reference this class with Bss, as the entrypoint will lookup the class // in the caller's dex file, but that dex file does not reference the class. - // TODO(solanes, 154012332): Add the support for the cross-dex cases. return HLoadClass::LoadKind::kInvalid; } } |