• Darius Mercadier's avatar
    [heap] Fix perf bug on PagedSpace::Available() · f4583702
    Darius Mercadier authored
    PagedSpace::Available() is mostly used for counters. One may expect
    that it'd be constant time or bearly noticeable performance-wise, but
    its cost is linear in the number of freelists and number of pages in
    the freelists. Overall, d8 --prof showed that it has a important
    runtime cost, and prevents freelists from scaling.
    
    This CL makes this counter constant-time, and should improve
    performances, even using with our current FreeList strategy
    (FreeListLegacy).
    
    Bug: v8:9329
    Bug: v8:9093
    Change-Id: I7682c5debc78498fe46e8dbce70b2fbd540b0fd0
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1746473
    Commit-Queue: Darius Mercadier <dmercadier@google.com>
    Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#63197}
    f4583702
spaces-inl.h 19.5 KB