From b7607c2fd67e12e998aebd71db38414ffc65621b Mon Sep 17 00:00:00 2001 From: Lokesh Gidra Date: Fri, 28 Jan 2022 12:30:31 -0800 Subject: Update native gc-roots separately in compaction pause The concurrent compaction algorithm requires all GC roots to be updated to post-compact addresses before resuming mutators for concurrent compaction. Therefore, unlike CC, we cannot update native roots in classes/dex-caches/class-loaders while visiting references (VisitReferences) on heap objects. This CL separates the two and updates all the gc-roots in the compaction pause. Bug: 160737021 Test: art/test/testrunner/testrunner.py Change-Id: I8a57472ba49b9dc30bc0f41a7db3f5efa7eafd9a --- runtime/class_linker-inl.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'runtime/class_linker-inl.h') diff --git a/runtime/class_linker-inl.h b/runtime/class_linker-inl.h index 02b2778f4f..b79f3f5685 100644 --- a/runtime/class_linker-inl.h +++ b/runtime/class_linker-inl.h @@ -24,6 +24,7 @@ #include "art_method-inl.h" #include "base/mutex.h" #include "class_linker.h" +#include "class_table-inl.h" #include "dex/dex_file.h" #include "dex/dex_file_structs.h" #include "gc_root-inl.h" @@ -592,6 +593,11 @@ inline ArtField* ClassLinker::ResolveField(uint32_t field_idx, return resolved; } +template +inline void ClassLinker::VisitBootClasses(Visitor* visitor) { + boot_class_table_->Visit(*visitor); +} + template inline void ClassLinker::VisitClassTables(const Visitor& visitor) { Thread* const self = Thread::Current(); -- cgit v1.2.3-59-g8ed1b