From db70ce5e788404f36cb5dbb137c6a8f79f34a2a0 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Mon, 12 Dec 2016 11:06:59 -0800 Subject: Address some review comments Addressed comments in dex cache and class table. Added class table test. Test: mm test-art-host-gtest-class_table_test -j20 Change-Id: I3ec0282247187acb1ec7af25b309501f001a1c3e --- runtime/class_table-inl.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'runtime/class_table-inl.h') diff --git a/runtime/class_table-inl.h b/runtime/class_table-inl.h index 229cd477dd..dfe8949134 100644 --- a/runtime/class_table-inl.h +++ b/runtime/class_table-inl.h @@ -71,6 +71,19 @@ bool ClassTable::Visit(Visitor& visitor) { return true; } +template +bool ClassTable::Visit(const Visitor& visitor) { + ReaderMutexLock mu(Thread::Current(), lock_); + for (ClassSet& class_set : classes_) { + for (TableSlot& table_slot : class_set) { + if (!visitor(table_slot.Read())) { + return false; + } + } + } + return true; +} + template inline mirror::Class* ClassTable::TableSlot::Read() const { const uint32_t before = data_.LoadRelaxed(); -- cgit v1.2.3-59-g8ed1b