Poison dead objects only in debug build
In the ReclaimPhase, The PoisonDeadObjectsInUnevacuatedRegion function consumes nearly 2/3 of cpu time. In the release build, this function is not nessary.
Bug: 257875965
Change-Id: I252e040adb9fd4c41e2106a12797560ffc78c526
Signed-off-by: xieliujie <xieliujie@oppo.com>
diff --git a/runtime/gc/space/region_space.cc b/runtime/gc/space/region_space.cc
index 171c5cd..76816dd 100644
--- a/runtime/gc/space/region_space.cc
+++ b/runtime/gc/space/region_space.cc
@@ -36,7 +36,7 @@
static constexpr bool kProtectClearedRegions = kIsDebugBuild;
// Wether we poison memory areas occupied by dead objects in unevacuated regions.
-static constexpr bool kPoisonDeadObjectsInUnevacuatedRegions = true;
+static constexpr bool kPoisonDeadObjectsInUnevacuatedRegions = kIsDebugBuild;
// Special 32-bit value used to poison memory areas occupied by dead
// objects in unevacuated regions. Dereferencing this value is expected