summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2020-04-02 10:50:35 +0100
committer Vladimir Marko <vmarko@google.com> 2020-04-03 13:40:14 +0100
commitd1f73515701bc64b3a23727b3973da6906f1b167 (patch)
tree59d789c42edd402ae799caa748939b61aeb00be7 /runtime/class_linker.cc
parentbda163d9c8313f0b92046abda5ffb1216af1e808 (diff)
dex2oat: add --updatable-bcp-packages-file argument.
Add a command line argument specifying a file that contains the list of updatable boot class path packages. Test: Updated module_exclusion_test Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_taimen-userdebug boots. Bug: 151314205 Change-Id: Ic6a66ad7e565a9b9b344cc467cb1ed550ab41b3f
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc35
1 files changed, 7 insertions, 28 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 284f19ff3b..daabf01cb7 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -3147,33 +3147,6 @@ ObjPtr<mirror::Class> ClassLinker::FindClass(Thread* self,
return result_ptr;
}
-static bool IsReservedBootClassPathDescriptor(const char* descriptor) {
- std::string_view descriptor_sv(descriptor);
- return
- // Reserved conscrypt packages (includes sub-packages under these paths).
- // StartsWith(descriptor_sv, "Landroid/net/ssl/") || // Covered by android.net below.
- StartsWith(descriptor_sv, "Lcom/android/org/conscrypt/") ||
- // Reserved updatable-media package (includes sub-packages under this path).
- StartsWith(descriptor_sv, "Landroid/media/") ||
- // Reserved framework-mediaprovider package (includes sub-packages under this path).
- StartsWith(descriptor_sv, "Landroid/provider/") ||
- // Reserved framework-statsd packages (includes sub-packages under these paths).
- StartsWith(descriptor_sv, "Landroid/app/") ||
- StartsWith(descriptor_sv, "Landroid/os/") ||
- StartsWith(descriptor_sv, "Landroid/util/") ||
- // Reserved framework-permission packages (includes sub-packages under this path).
- StartsWith(descriptor_sv, "Landroid/permission/") ||
- // StartsWith(descriptor_sv, "Landroid/app/role/") || // Covered by android.app above.
- // Reserved framework-sdkextensions package (includes sub-packages under this path).
- // StartsWith(descriptor_sv, "Landroid/os/ext/") || // Covered by android.os above.
- // Reserved framework-wifi packages (includes sub-packages under these paths).
- StartsWith(descriptor_sv, "Landroid/hardware/wifi/") ||
- // StartsWith(descriptor_sv, "Landroid/net/wifi/") || // Covered by android.net below.
- StartsWith(descriptor_sv, "Landroid/x/net/wifi/") ||
- // Reserved framework-tethering package (includes sub-packages under this path).
- StartsWith(descriptor_sv, "Landroid/net/");
-}
-
// Helper for maintaining DefineClass counting. We need to notify callbacks when we start/end a
// define-class and how many recursive DefineClasses we are at in order to allow for doing things
// like pausing class definition.
@@ -3251,7 +3224,7 @@ ObjPtr<mirror::Class> ClassLinker::DefineClass(Thread* self,
// with these modules as these classes could be resolved differently during execution.
if (class_loader != nullptr &&
Runtime::Current()->IsAotCompiler() &&
- IsReservedBootClassPathDescriptor(descriptor)) {
+ IsUpdatableBootClassPathDescriptor(descriptor)) {
ObjPtr<mirror::Throwable> pre_allocated =
Runtime::Current()->GetPreAllocatedNoClassDefFoundError();
self->SetException(pre_allocated);
@@ -9861,6 +9834,12 @@ ObjPtr<mirror::IfTable> ClassLinker::AllocIfTable(Thread* self, size_t ifcount)
ifcount * mirror::IfTable::kMax)));
}
+bool ClassLinker::IsUpdatableBootClassPathDescriptor(const char* descriptor ATTRIBUTE_UNUSED) {
+ // Should not be called on ClassLinker, only on AotClassLinker that overrides this.
+ LOG(FATAL) << "UNREACHABLE";
+ UNREACHABLE();
+}
+
// Instantiate ClassLinker::ResolveMethod.
template ArtMethod* ClassLinker::ResolveMethod<ClassLinker::ResolveMode::kCheckICCEAndIAE>(
uint32_t method_idx,