1. 29 Aug, 2019 1 commit
    • Darius Mercadier's avatar
      [heap] Make FreeListCategory lighter (size-wise) · 604ef7bb
      Darius Mercadier authored
      A recent CL (1762292 and 1765533) changed the FreeList strategy,
      switching to one that uses 46 categories rather than the previous 6 we
      had. This caused a reduction of V8's heap size by about 1-2% on
      average. However, because FreeListCategory is 56 bytes, rather than 4
      bytes as one might expect (2 bytes offset, 1 byte for the category
      type, and 1 byte padding), the overall memory improvement is actually
      lower than that.
      
      For instance, when 256M memory is allocated,
          1000 pages * 46 freelists * 56 bytes = 2.5M overhead
      (ie, 1% overhead)
      
      Ideally, FreeListCategory should only by 4 bytes: 2 bytes for the
      offset of the top() on the page, 1 byte for the category type, and
      1 byte padding.
      
      
      This CL reduces the size of FreeListCategory by 24 bytes by removing
      some fields.
      
      More work should be done to reduce the size even further:
      
        - Remove the available_ counter (this require maintaining byte count
          at the page level rather than in each FreeListCategory; and
          maintaining that counter is not trivial, but doable).
      
        - Use a 16 bits offset to store the top() rather than a pointer.
      
        - Get rid of prev_ and next_: this change is the most
          complicated. It requires storing the space's pages in order, such
          that when one page's freelist is empty, we move on to the next
          page in the space.
      
        - the type_ field might even be removable, since this information can
          be deduced from the FreeListCategory's position in the page's array
          or FreeListCategory.
      
      Bug: v8:9329
      Change-Id: I8fd72cfa31ca12ba0dbf10be3948a72caee15b57
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1773270
      Commit-Queue: Darius Mercadier <dmercadier@google.com>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63448}
      604ef7bb
  2. 22 Aug, 2019 1 commit
    • Darius Mercadier's avatar
      [heap] Add new freelist: FreeListManyCachedOrigin · 18a2268f
      Darius Mercadier authored
      This new FreeList should be a reasonable replacement for our old
      FreeListLegacy: it is slightly less efficient (~1%), but uses much
      less memory (often 5% less old_space size).
      
      It is based on FreeListMany, with the following additions:
      
        - A cache to waste less time iterating empty categories
      
        - A fast path for allocations done in the runtime and generated code
      
        - A slow path (the same as FreeListMany actually) for allocations
          done in the GC.
      
      Bug: v8:9329
      Change-Id: Ifc10b88df7861266a721afd2c6e6d8357255ec4e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1762292
      Commit-Queue: Darius Mercadier <dmercadier@google.com>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63345}
      18a2268f
  3. 13 Aug, 2019 1 commit
    • 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
  4. 05 Aug, 2019 1 commit
  5. 29 Jul, 2019 1 commit
  6. 11 Jul, 2019 2 commits
  7. 17 Jun, 2019 1 commit
  8. 04 Jun, 2019 1 commit
  9. 23 May, 2019 1 commit
  10. 21 May, 2019 1 commit
  11. 08 May, 2019 1 commit
  12. 11 Apr, 2019 1 commit
  13. 04 Mar, 2019 1 commit
  14. 15 Feb, 2019 1 commit
  15. 14 Feb, 2019 1 commit
  16. 29 Jan, 2019 1 commit
  17. 22 Jan, 2019 1 commit
  18. 17 Jan, 2019 1 commit
    • Ulan Degenbaev's avatar
      Reland "[heap] Optimize MemoryChunk::FromAnyPointerAddress" · c0994d3f
      Ulan Degenbaev authored
      This is a reland of fd49c8bb
      
      Original change's description:
      > [heap] Optimize MemoryChunk::FromAnyPointerAddress
      > 
      > Currently this function requires the caller to hold a mutex for the
      > large page chunk hashtable and performs a hashtable lookup.
      > 
      > This patch adds a header sentinel field in each MemoryChunk. The field
      > is then used to distinguish large object slots from ordinary slots.
      > 
      > Bug: chromium:915233
      > Change-Id: I9fbeeb4f07f49573d0a21f9a2cc934370e417d68
      > Reviewed-on: https://chromium-review.googlesource.com/c/1391752
      > Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#58732}
      
      Bug: chromium:915233
      Change-Id: I10d23a928328169a2dc6bab78d2b7d2c5d00ebb6
      Reviewed-on: https://chromium-review.googlesource.com/c/1406672
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58876}
      c0994d3f
  19. 15 Jan, 2019 1 commit
  20. 11 Jan, 2019 2 commits
  21. 08 Jan, 2019 1 commit
  22. 26 Dec, 2018 1 commit
  23. 20 Dec, 2018 1 commit
  24. 08 Dec, 2018 1 commit
  25. 29 Nov, 2018 1 commit
  26. 27 Nov, 2018 1 commit
  27. 22 Nov, 2018 1 commit
  28. 15 Nov, 2018 1 commit
  29. 12 Oct, 2018 1 commit
  30. 17 Sep, 2018 1 commit
  31. 15 Sep, 2018 1 commit
  32. 12 Sep, 2018 4 commits
  33. 11 Sep, 2018 2 commits
  34. 10 Sep, 2018 1 commit