From 97a6f7cd191cde0abaaf6323ae2f67d8e42a1236 Mon Sep 17 00:00:00 2001 From: Lokesh Gidra Date: Wed, 13 Sep 2023 22:11:52 +0000 Subject: Update class-table and intern-table concurrently with uffd GC Bug: 160737021 Test: art/testrunner/testrunner.py Change-Id: I4413ead05947f3f865116ae8dc7d67d860106b37 --- runtime/class_table.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'runtime/class_table.h') diff --git a/runtime/class_table.h b/runtime/class_table.h index 7e263737c3..54e066a18c 100644 --- a/runtime/class_table.h +++ b/runtime/class_table.h @@ -21,7 +21,7 @@ #include #include -#include "base/allocator.h" +#include "base/gc_visited_arena_pool.h" #include "base/hash_set.h" #include "base/macros.h" #include "base/mutex.h" @@ -151,7 +151,7 @@ class ClassTable { TableSlotEmptyFn, ClassDescriptorHash, ClassDescriptorEquals, - TrackingAllocator>; + GcRootArenaAllocator>; ClassTable(); @@ -181,7 +181,7 @@ class ClassTable { REQUIRES(!lock_) REQUIRES_SHARED(Locks::mutator_lock_); - // Returns the number of classes in the class table. + // Returns the number of class-sets in the class table. size_t Size() const REQUIRES(!lock_) REQUIRES_SHARED(Locks::mutator_lock_); @@ -194,17 +194,13 @@ class ClassTable { REQUIRES_SHARED(Locks::mutator_lock_); // NO_THREAD_SAFETY_ANALYSIS for object marking requiring heap bitmap lock. - template - void VisitRoots(Visitor& visitor) - NO_THREAD_SAFETY_ANALYSIS - REQUIRES(!lock_) - REQUIRES_SHARED(Locks::mutator_lock_); + template + void VisitRoots(Visitor& visitor, bool skip_classes = false) NO_THREAD_SAFETY_ANALYSIS + REQUIRES(!lock_) REQUIRES_SHARED(Locks::mutator_lock_); - template - void VisitRoots(const Visitor& visitor) - NO_THREAD_SAFETY_ANALYSIS - REQUIRES(!lock_) - REQUIRES_SHARED(Locks::mutator_lock_); + template + void VisitRoots(const Visitor& visitor, bool skip_classes = false) NO_THREAD_SAFETY_ANALYSIS + REQUIRES(!lock_) REQUIRES_SHARED(Locks::mutator_lock_); template void VisitClassesAndRoots(Visitor& visitor) @@ -212,6 +208,10 @@ class ClassTable { REQUIRES(!lock_) REQUIRES_SHARED(Locks::mutator_lock_); + // Visit classes in those class-sets which satisfy 'cond'. + template + void VisitClassesIfConditionMet(Condition& cond, Visitor& visitor) REQUIRES(!lock_) + REQUIRES_SHARED(Locks::mutator_lock_); // Stops visit if the visitor returns false. template bool Visit(Visitor& visitor) -- cgit v1.2.3-59-g8ed1b