diff options
Diffstat (limited to 'runtime/class_table-inl.h')
-rw-r--r-- | runtime/class_table-inl.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/class_table-inl.h b/runtime/class_table-inl.h index aef02b6d5d..e512906507 100644 --- a/runtime/class_table-inl.h +++ b/runtime/class_table-inl.h @@ -28,6 +28,9 @@ void ClassTable::VisitRoots(Visitor& visitor) { visitor.VisitRoot(root.AddressWithoutBarrier()); } } + for (GcRoot<mirror::Object>& root : dex_files_) { + visitor.VisitRoot(root.AddressWithoutBarrier()); + } } template<class Visitor> @@ -42,6 +45,19 @@ void ClassTable::VisitRoots(const Visitor& visitor) { } } +template <typename Visitor> +bool ClassTable::Visit(Visitor& visitor) { + for (ClassSet& class_set : classes_) { + for (GcRoot<mirror::Class>& root : class_set) { + if (!visitor(root.Read())) { + return false; + } + } + } + return true; +} + + } // namespace art #endif // ART_RUNTIME_CLASS_TABLE_INL_H_ |