Only visit app image classes in class loader
Only update dex cache arrays of added classes since the declaring
class is in image DCHECK fails for other classes in the class loader.
Also some cleanup to prevent app images leaving invalid state if
they get rejected.
Bug: 22858531
Bug: 27431418
Change-Id: Ib2a5692a1ad78b014a1bfc6b27fb1c12bc8565e6
diff --git a/runtime/class_linker.h b/runtime/class_linker.h
index 0a75b27..492a228 100644
--- a/runtime/class_linker.h
+++ b/runtime/class_linker.h
@@ -1029,11 +1029,13 @@
SHARED_REQUIRES(Locks::mutator_lock_)
REQUIRES(!Locks::classlinker_classes_lock_);
+ // new_class_set is the set of classes that were read from the class table section in the image.
+ // If there was no class table section, it is null.
bool UpdateAppImageClassLoadersAndDexCaches(
gc::space::ImageSpace* space,
Handle<mirror::ClassLoader> class_loader,
Handle<mirror::ObjectArray<mirror::DexCache>> dex_caches,
- bool added_class_table,
+ ClassTable::ClassSet* new_class_set,
bool* out_forward_dex_cache_array,
std::string* out_error_msg)
REQUIRES(!dex_lock_)