Image space cleanup for app images
Removed Heap::GetImageSpace, added Heap::GetBootImageSpace.
Generalized some logic in the class linker for image spaces.
Bug: 22858531
Change-Id: Ib3e12bb061a247e232d3dc93b0d6b35eb3a34d25
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 556ba56..17f34c0 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -528,13 +528,13 @@
// Use !IsAotCompiler so that we get test coverage, tests are never the zygote.
if (!IsAotCompiler()) {
ScopedObjectAccess soa(self);
- gc::space::ImageSpace* image_space = heap_->GetImageSpace();
+ gc::space::ImageSpace* image_space = heap_->GetBootImageSpace();
if (image_space != nullptr) {
ATRACE_BEGIN("AddImageStringsToTable");
GetInternTable()->AddImageStringsToTable(image_space);
ATRACE_END();
ATRACE_BEGIN("MoveImageClassesToClassTable");
- GetClassLinker()->MoveImageClassesToClassTable();
+ GetClassLinker()->AddBootImageClassesToClassTable();
ATRACE_END();
}
}
@@ -930,7 +930,7 @@
runtime_options.GetOrDefault(Opt::HSpaceCompactForOOMMinIntervalsMs));
ATRACE_END();
- if (heap_->GetImageSpace() == nullptr && !allow_dex_file_fallback_) {
+ if (heap_->GetBootImageSpace() == nullptr && !allow_dex_file_fallback_) {
LOG(ERROR) << "Dex file fallback disabled, cannot continue without image.";
ATRACE_END();
return false;
@@ -1043,7 +1043,7 @@
class_linker_->InitFromImage();
ATRACE_END();
if (kIsDebugBuild) {
- GetHeap()->GetImageSpace()->VerifyImageAllocations();
+ GetHeap()->GetBootImageSpace()->VerifyImageAllocations();
}
if (boot_class_path_string_.empty()) {
// The bootclasspath is not explicitly specified: construct it from the loaded dex files.