From ca5ed9f281a5758814d2495da80178de56945720 Mon Sep 17 00:00:00 2001 From: Lokesh Gidra Date: Wed, 20 Apr 2022 01:39:28 +0000 Subject: Convert kUseReadBarrier to static const from constexpr This CL would compile both CC and userfaultfd GC in the art library, enabling us to choose either of the two during boot time depending on whether the device has userfaultfd kernel feature or not. The CC GC is still chosen unless we use ART_USE_READ_BARRIER=false during build time. This behavior will later be changed to choosing CC *only* if ART_USE_READ_BARRIER=true is used. In other cases, if the device has userfaultfd support then that GC will be chosen. Bug: 160737021 Bug: 230021033 Test: art/test/testrunner/testrunner.py Change-Id: I370f1a9f6b8cdff8c2ce3cf7aa936bccd7ed675f --- openjdkjvmti/jvmti_weak_table-inl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openjdkjvmti/jvmti_weak_table-inl.h') diff --git a/openjdkjvmti/jvmti_weak_table-inl.h b/openjdkjvmti/jvmti_weak_table-inl.h index 5b28e458f8..17578d28f2 100644 --- a/openjdkjvmti/jvmti_weak_table-inl.h +++ b/openjdkjvmti/jvmti_weak_table-inl.h @@ -114,7 +114,7 @@ bool JvmtiWeakTable::RemoveLocked(art::Thread* self, art::ObjPtrGetIsGcMarking() && !update_since_last_sweep_) { + if (art::gUseReadBarrier && self->GetIsGcMarking() && !update_since_last_sweep_) { // Under concurrent GC, there is a window between moving objects and sweeping of system // weaks in which mutators are active. We may receive a to-space object pointer in obj, // but still have from-space pointers in the table. Explicitly update the table once. @@ -156,7 +156,7 @@ bool JvmtiWeakTable::SetLocked(art::Thread* self, art::ObjPtrGetIsGcMarking() && !update_since_last_sweep_) { + if (art::gUseReadBarrier && self->GetIsGcMarking() && !update_since_last_sweep_) { // Under concurrent GC, there is a window between moving objects and sweeping of system // weaks in which mutators are active. We may receive a to-space object pointer in obj, // but still have from-space pointers in the table. Explicitly update the table once. -- cgit v1.2.3-59-g8ed1b