Revert^4 "Add bss support for inlining BCP DexFiles for single image"
This reverts commit 1849c3a875aab44d9bff45623ec076b0331302f8.
Reason for revert: Relading after fix. It can be seen in PS 1..2
Bug: 154012332
Test: art/test/testrunner/testrunner.py --target --32 --optimizing
Test: art/test/testrunner/testrunner.py --host --64 --optimizing
Change-Id: I168572957363dd5ae1598279f2ecc8fb947a1fd5
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 39f684b..741e6df 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -1745,11 +1745,12 @@
// Inline across dexfiles if the callee's DexFile is:
// 1) in the bootclasspath, or
if (callee->GetDeclaringClass()->GetClassLoader() == nullptr) {
- // 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;
+ // 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;
return true;
}