Commit d6794def authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[heap] Rename CreateFillerObjectFromSweeper

Rename CreateFillerObjectFromSweeper to CreateFillerObjectAtBackground.
Also use CreateFillerObjectAtBackground in PagedSpace::Free since this
is used from both main and background threads.

Bug: v8:10315
Change-Id: I1dc8ca2b1c81bdfd192c0ae8d8547eb577f3f8c3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2235534
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68255}
parent a99ca6e6
......@@ -26,12 +26,13 @@ void StressConcurrentAllocatorTask::RunInternal() {
Address address = allocator->AllocateOrFail(
kObjectSize, AllocationAlignment::kWordAligned,
AllocationOrigin::kRuntime);
heap->CreateFillerObjectAt(address, kObjectSize, ClearRecordedSlots::kNo);
heap->CreateFillerObjectAtBackground(
address, kObjectSize, ClearFreedMemoryMode::kDontClearFreedMemory);
address = allocator->AllocateOrFail(kLargeObjectSize,
AllocationAlignment::kWordAligned,
AllocationOrigin::kRuntime);
heap->CreateFillerObjectAt(address, kLargeObjectSize,
ClearRecordedSlots::kNo);
heap->CreateFillerObjectAtBackground(
address, kLargeObjectSize, ClearFreedMemoryMode::kDontClearFreedMemory);
if (i % 10 == 0) {
local_heap.Safepoint();
}
......
......@@ -3044,7 +3044,7 @@ HeapObject Heap::CreateFillerObjectAt(ReadOnlyRoots roots, Address addr,
return filler;
}
void Heap::CreateFillerObjectFromSweeper(
void Heap::CreateFillerObjectAtBackground(
Address addr, int size, ClearFreedMemoryMode clear_memory_mode) {
CreateFillerObjectAtImpl(ReadOnlyRoots(this), addr, size, clear_memory_mode);
// Do not verify whether slots are cleared here: the concurrent sweeper is not
......
......@@ -475,8 +475,8 @@ class Heap {
V8_EXPORT_PRIVATE HeapObject CreateFillerObjectAt(
Address addr, int size, ClearRecordedSlots clear_slots_mode);
void CreateFillerObjectFromSweeper(Address addr, int size,
ClearFreedMemoryMode clear_memory_mode);
void CreateFillerObjectAtBackground(Address addr, int size,
ClearFreedMemoryMode clear_memory_mode);
template <typename T>
void CreateFillerForArray(T object, int elements_to_trim, int bytes_to_trim);
......
......@@ -156,8 +156,9 @@ class V8_EXPORT_PRIVATE PagedSpace
size_t Free(Address start, size_t size_in_bytes, SpaceAccountingMode mode) {
if (size_in_bytes == 0) return 0;
heap()->CreateFillerObjectAt(start, static_cast<int>(size_in_bytes),
ClearRecordedSlots::kNo);
heap()->CreateFillerObjectAtBackground(
start, static_cast<int>(size_in_bytes),
ClearFreedMemoryMode::kDontClearFreedMemory);
if (mode == SpaceAccountingMode::kSpaceAccounted) {
return AccountedFree(start, size_in_bytes);
} else {
......
......@@ -269,7 +269,7 @@ V8_INLINE size_t Sweeper::FreeAndProcessFreedMemory(
(free_list_mode == REBUILD_FREE_LIST)
? ClearFreedMemoryMode::kDontClearFreedMemory
: ClearFreedMemoryMode::kClearFreedMemory;
page->heap()->CreateFillerObjectFromSweeper(
page->heap()->CreateFillerObjectAtBackground(
free_start, static_cast<int>(size), clear_memory_mode);
if (free_list_mode == REBUILD_FREE_LIST) {
freed_bytes =
......
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