[heap] Skip pages marked as never-allocate in sweeper accounting

This is a more general fix than 84435fa because tests that rely on
the sweeping order mark all unwanted pages as never-allocate using
SealCurrentObjects.

Bug: v8:9205
Change-Id: I261de3183ee38189ed72de28883a4fdf7b6f253d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1605728
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61407}
diff --git a/src/heap/sweeper.cc b/src/heap/sweeper.cc
index 46585ea..1c5683e 100644
--- a/src/heap/sweeper.cc
+++ b/src/heap/sweeper.cc
@@ -393,10 +393,9 @@
   Page* page = nullptr;
   while ((page = GetSweepingPageSafe(identity)) != nullptr) {
     int freed = ParallelSweepPage(page, identity);
-    if (!page->NeverEvacuate()) {
-      // Pages are marked as never-evacuate after deserialization. They have
-      // no free space. Do not account them towards the |max_pages| limit.
-      pages_freed += 1;
+    if (page->IsFlagSet(Page::NEVER_ALLOCATE_ON_PAGE)) {
+      // Free list of a never-allocate page will be dropped later on.
+      continue;
     }
     DCHECK_GE(freed, 0);
     max_freed = Max(max_freed, freed);