diff options
author | 2023-09-13 22:11:52 +0000 | |
---|---|---|
committer | 2023-10-17 15:52:15 +0000 | |
commit | 97a6f7cd191cde0abaaf6323ae2f67d8e42a1236 (patch) | |
tree | 209182e3e2c56973463e7dad320520a08667cfb2 /runtime/runtime.cc | |
parent | d5c097bcda44e237ecabcdba9b3dca2348289138 (diff) |
Update class-table and intern-table concurrently with uffd GC
Bug: 160737021
Test: art/testrunner/testrunner.py
Change-Id: I4413ead05947f3f865116ae8dc7d67d860106b37
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 9c3b9de70c..97db5fb0fd 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -859,7 +859,11 @@ void Runtime::CallExitHook(jint status) { } void Runtime::SweepSystemWeaks(IsMarkedVisitor* visitor) { - GetInternTable()->SweepInternTableWeaks(visitor); + // Userfaultfd compaction updates weak intern-table page-by-page via + // LinearAlloc. + if (!GetHeap()->IsPerformingUffdCompaction()) { + GetInternTable()->SweepInternTableWeaks(visitor); + } GetMonitorList()->SweepMonitorList(visitor); GetJavaVM()->SweepJniWeakGlobals(visitor); GetHeap()->SweepAllocationRecords(visitor); @@ -2590,8 +2594,14 @@ void Runtime::VisitConstantRoots(RootVisitor* visitor) { } void Runtime::VisitConcurrentRoots(RootVisitor* visitor, VisitRootFlags flags) { - intern_table_->VisitRoots(visitor, flags); - class_linker_->VisitRoots(visitor, flags); + // Userfaultfd compaction updates intern-tables and class-tables page-by-page + // via LinearAlloc. So don't visit them here. + if (GetHeap()->IsPerformingUffdCompaction()) { + class_linker_->VisitRoots(visitor, flags, /*visit_class_roots=*/false); + } else { + intern_table_->VisitRoots(visitor, flags); + class_linker_->VisitRoots(visitor, flags, /*visit_class_roots=*/true); + } jni_id_manager_->VisitRoots(visitor); heap_->VisitAllocationRecords(visitor); if (jit_ != nullptr) { |