Commit 200a594a authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][gc] Reenable discarding system pages

On windows, the range to be discarded needs to be split by the
reservations, analogous to committing. This CL reuses the same logic,
and reenables discarding pages on all platforms.

R=mstarzinger@chromium.org

Bug: v8:8217
Change-Id: I11716d6381f765bdfe4cf48502b5cdc1f42cf8ab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1611682
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61526}
parent c6fdaedb
......@@ -599,9 +599,12 @@ void WasmCodeAllocator::FreeCode(Vector<WasmCode* const> codes) {
std::min(RoundDown(merged_region.end(), commit_page_size),
RoundUp(region.end(), commit_page_size));
if (discard_start >= discard_end) continue;
// TODO(clemensh): Reenable after fixing https://crbug.com/960707.
// allocator->DiscardSystemPages(reinterpret_cast<void*>(discard_start),
// discard_end - discard_start);
// TODO(clemensh): Update committed_code_space_ counter.
for (base::AddressRegion split_range : SplitRangeByReservationsIfNeeded(
{discard_start, discard_end - discard_start}, owned_code_space_)) {
allocator->DiscardSystemPages(
reinterpret_cast<void*>(split_range.begin()), split_range.size());
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment