Revert "[wasm][gc] Use SetPermissions to discard pages"

This reverts commit cc71d5ca52159ff1a7f5c736df380f91d4605a88.

Reason for revert: gc-stress failures, e.g. https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20gc%20stress/22357

Original change's description:
> [wasm][gc] Use SetPermissions to discard pages
> 
> On 32bit windows, DiscardSystemPages fails sometimes (see bug). We don't
> have a reproducer, so this is a purely speculative fix.
> {SetPermissions} has some platform-specific logic to also discard the
> pages. Specifially, on windows it uses {VirtualFree} instead of
> {DiscardVirtualMemory}.
> {SetPermissions} is also semantically stronger, since it forbids any
> further access to the pages.
> 
> R=​mstarzinger@chromium.org
> 
> Bug: v8:8217, chromium:960707
> Change-Id: I8b3325264c86aff8d6e7c6b01c22ae410e87faf4
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1601134
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61321}

TBR=mstarzinger@chromium.org,clemensh@chromium.org

Change-Id: Ib2d534a6906ea5d390d08943ea71e1f8799278e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8217, chromium:960707
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1601147
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61324}
diff --git a/src/wasm/wasm-code-manager.cc b/src/wasm/wasm-code-manager.cc
index ce58fb0..bbd74c0 100644
--- a/src/wasm/wasm-code-manager.cc
+++ b/src/wasm/wasm-code-manager.cc
@@ -1369,18 +1369,8 @@
     Address discard_end = std::min(RoundDown(merged_region.end(), page_size),
                                    RoundUp(region.end(), page_size));
     if (discard_start >= discard_end) continue;
-#ifdef ENABLE_SLOW_DCHECKS
-    auto vmem_contains = [discard_start, discard_end](VirtualMemory& vmem) {
-      return vmem.InVM(discard_start, discard_end - discard_start);
-    };
-    DCHECK_EQ(1, std::count_if(owned_code_space_.begin(),
-                               owned_code_space_.end(), vmem_contains));
-#endif
-    // {SetPermissions} with {kNoAccess} also discards the pages in a platform
-    // specific way.
-    CHECK(allocator->SetPermissions(reinterpret_cast<void*>(discard_start),
-                                    discard_end - discard_start,
-                                    PageAllocator::kNoAccess));
+    allocator->DiscardSystemPages(reinterpret_cast<void*>(discard_start),
+                                  discard_end - discard_start);
   }
 }