From 1aa8ec2ccdd7bedb6d30d91c89f1e94ab23c4439 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Mon, 1 Feb 2016 10:34:47 -0800 Subject: Fix up dex cache strings stored in classes Previously we left the image pointer instead of fixing up the pointer to the one in the BSS. This only showed up because JIT does the same as boot image, bypassing null check. Fixed a bug where oat files without embedded dex cache arrays would get their dex cache arrays corrupted. Added a non virtual class visitor for performance. Bug: 26846419 Bug: 22858531 Change-Id: I8cd0d61e440f753b4628ddb8c932eb23a0a81027 --- runtime/class_linker.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'runtime/class_linker.h') diff --git a/runtime/class_linker.h b/runtime/class_linker.h index 5176cbd3ea..9217c32fe7 100644 --- a/runtime/class_linker.h +++ b/runtime/class_linker.h @@ -60,6 +60,13 @@ template class PACKED(4) StackHandleScope; enum VisitRootFlags : uint8_t; +class ClassVisitor { + public: + virtual ~ClassVisitor() {} + // Return true to continue visiting. + virtual bool operator()(mirror::Class* klass) = 0; +}; + class ClassLoaderVisitor { public: virtual ~ClassLoaderVisitor() {} @@ -1007,11 +1014,13 @@ class ClassLinker { SHARED_REQUIRES(Locks::mutator_lock_) REQUIRES(!Locks::classlinker_classes_lock_); - void UpdateAppImageClassLoadersAndDexCaches( + bool UpdateAppImageClassLoadersAndDexCaches( gc::space::ImageSpace* space, Handle class_loader, Handle> dex_caches, - bool added_class_table) + bool added_class_table, + bool* out_forward_dex_cache_array, + std::string* out_error_msg) REQUIRES(!dex_lock_) SHARED_REQUIRES(Locks::mutator_lock_); -- cgit v1.2.3-59-g8ed1b