• Omer Katz's avatar
    [heap] Fix PagedNewSpace initialization · 262d5fc3
    Omer Katz authored
    Whenever PagedNewSpace allocates a page, the page is added to the free
    list. Preallocating pages on space initialization means the pages are
    added to the free list before the map for free space is initialized.
    Then, when allocating from the free list, a DCHECK fails
    (free-list.cc:508).
    
    This CL delays page preallocation until `EnsureCurrentCapacity` is
    called. When using PagedNewSpace, we will call this method from
    `Heap::CreateHeapObjects` after the maps are allocated and before any
    allocations in new space are attempted.
    
    Bug: v8:12612
    Change-Id: I33f825ddd831640b12e4c0f7b849262a335df51e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3780541Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
    Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
    Commit-Queue: Omer Katz <omerkatz@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#81919}
    262d5fc3
test-spaces.cc 36.5 KB