• Samuel Groß's avatar
    [sandbox] Fix DCHECK failure in EPT entry allocation · 541d4080
    Samuel Groß authored
    When an entry is allocated from the freelist, is is not correct to
    `DCHECK(entry.IsFreelistEntry())` before the compare-and-swap succeeds:
    another thread may have allocated the same entry in the meantime,
    thereby turning it into a regular entry. However, in that case the CAS
    will fail and then entry allocation will be retried.
    
    Drive-by: factor out the common logic from AllocateAndInitializeEntry
    and AllocateEvacuationEntry into a new TryAllocateEntryFromFreelist.
    
    Bug: v8:13246
    Change-Id: Idf16b67a2ca5ddeef16620a4d6f4a8a6c07d917b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3865864Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
    Commit-Queue: Igor Sheludko <ishell@chromium.org>
    Auto-Submit: Samuel Groß <saelo@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#82868}
    541d4080
external-pointer-table-inl.h 7.92 KB