Refactor mark-bit set logic in PreZygoteFork()

Test: art/test/testrunner/testrunner.py --target
Bug: 37254935
Change-Id: I3cb592e793fee47509590c66697c06a8e3bd6fab
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index d68c171..51b0237 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -2354,12 +2354,7 @@
   if (set_mark_bit) {
     // Treat all of the objects in the zygote as marked to avoid unnecessary dirty pages. This is
     // safe since we mark all of the objects that may reference non immune objects as gray.
-    zygote_space_->GetLiveBitmap()->VisitMarkedRange(
-        reinterpret_cast<uintptr_t>(zygote_space_->Begin()),
-        reinterpret_cast<uintptr_t>(zygote_space_->Limit()),
-        [](mirror::Object* obj) REQUIRES_SHARED(Locks::mutator_lock_) {
-      CHECK(obj->AtomicSetMarkBit(0, 1));
-    });
+    zygote_space_->SetMarkBitInLiveObjects();
   }
 
   // Create the zygote space mod union table.