diff options
author | 2016-02-01 10:34:47 -0800 | |
---|---|---|
committer | 2016-02-01 19:58:25 -0800 | |
commit | 1aa8ec2ccdd7bedb6d30d91c89f1e94ab23c4439 (patch) | |
tree | 7b2079631ed5d8350c63c7ed3f6d0393e951ce8c /runtime/class_table.h | |
parent | c3cf1d2e35a45bd2e2c60fbc9c2a1a6a56dfc529 (diff) |
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
Diffstat (limited to 'runtime/class_table.h')
-rw-r--r-- | runtime/class_table.h | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/runtime/class_table.h b/runtime/class_table.h index 0b420352c3..5f2eb48d55 100644 --- a/runtime/class_table.h +++ b/runtime/class_table.h @@ -36,13 +36,6 @@ namespace mirror { class ClassLoader; } // namespace mirror -class ClassVisitor { - public: - virtual ~ClassVisitor() {} - // Return true to continue visiting. - virtual bool Visit(mirror::Class* klass) = 0; -}; - // Each loader has a ClassTable class ClassTable { public: @@ -80,8 +73,9 @@ class ClassTable { NO_THREAD_SAFETY_ANALYSIS SHARED_REQUIRES(Locks::classlinker_classes_lock_, Locks::mutator_lock_); - // Return false if the callback told us to exit. - bool Visit(ClassVisitor* visitor) + // Stops visit if the visitor returns false. + template <typename Visitor> + bool Visit(Visitor& visitor) SHARED_REQUIRES(Locks::classlinker_classes_lock_, Locks::mutator_lock_); // Return the first class that matches the descriptor. Returns null if there are none. @@ -118,11 +112,6 @@ class ClassTable { REQUIRES(Locks::classlinker_classes_lock_) SHARED_REQUIRES(Locks::mutator_lock_); - // Change the class loader of all the contained classes. - void SetClassLoader(mirror::ClassLoader* class_loader) - REQUIRES(Locks::classlinker_classes_lock_) - SHARED_REQUIRES(Locks::mutator_lock_); - private: class ClassDescriptorHashEquals { public: |