1. 17 Dec, 2019 3 commits
    • Ulan Degenbaev's avatar
      [heap] Perform GCs on v8::BackingStore allocation · 687d865f
      Ulan Degenbaev authored
      This adds heuristics to perform young and full GCs on allocation
      of external ArrayBuffer backing stores.
      
      Young GCs are performed proactively based on the external backing
      store bytes for the young generation. Full GCs are performed only
      if the allocation fails. Subsequent CLs will add heuristics to
      start incremental full GCs based on the external backing store bytes.
      
      This will allow us to remove AdjustAmountOfExternalMemory for
      ArrayBuffers.
      
      Bug: v8:9701, chromium:1008938
      Change-Id: I0e8688f582989518926c38260b5cf14e2ca93f84
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1803614
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#65480}
      687d865f
    • Dan Elphick's avatar
      [heap] Remove PrintStack from Heap::RecordStats · be5dd772
      Dan Elphick authored
      Since RecordStats during GC, (when it fails to recover enough memory),
      it unsafe for it to allocate any memory. Thus it cannot call PrintStack
      which can call SharedFunctionInfo::EnsureSourcePositionsAvailable and
      which may allocate, so this removes the call to PrintStack which is
      apparently not useful for debugging anyway.
      
      Bug: chromium:1032087
      Change-Id: I94feeaab1445f7fd4f770a20197546fc40c77390
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1967377Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#65475}
      be5dd772
    • Peter Marshall's avatar
      [unwinder] Add a vector-based code page mechanism for arm32 · 285e4d69
      Peter Marshall authored
      Add an API on Isolate that returns a sorted vector of code pages allocated
      within V8. The implementation is designed to be signal-safe, so that the
      user (the UMA sampling profiler) can access this information from a signal
      handler, where allocation and taking locks is prohibited.
      
      This CL adds the machinery for maintaining the list of allocated code
      pages. Further CLs will modify the Unwinder API itself to accept the code
      pages provided by this API.
      
      The unwinder API currently uses the reserved virtual-memory range called
      the CodeRange to identify where all V8 code objects live, but this doesn't
      exist on arm32 or any 32-bit platform, so this approach adds a way to
      expose the location of all valid V8 code objects in a signal-safe way for
      use by the UMA sampling profiler.
      
      On 64-bit, this API always gives the code_range and embedded_code_range, and
      does not maintain a vector of code pages. This is so that we have a unified
      API on 32 and 64-bit that can be used in exactly the same way by embedders.
      
      Design doc:
      https://docs.google.com/document/d/1VGwUult5AHLRk658VetwEHMOmDDxA2eDQs9lDFMZTE0
      
      Bug: v8:8116
      Change-Id: I732509a45121fc54853182481c24d1083275afce
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1564068
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#65469}
      285e4d69
  2. 13 Dec, 2019 3 commits
  3. 11 Dec, 2019 1 commit
    • Ulan Degenbaev's avatar
      [heap] Refactor marking worklists · 6b5bc5e9
      Ulan Degenbaev authored
      This unifies marking worklists handling by the main thread marker and
      by the concurrent markers. A new class called MarkingWorklistsHolder
      owns all marking worklists: the default worklist, the on-hold worklist,
      and the embedder worklist. Each thread creates a local view of the
      marking worklists by creating an instance of MarkingWorklists.
      
      Additionally, marking visitors now work on MarkingWorklists instead of
      accessing each worklist individually.
      
      Besides cleaning the code up, this CL provides a bottleneck for
      implementing per-context worklists.
      
      Bug: chromium:973627
      Change-Id: I52ad65c94bc0695287ba7bf4d8a814a9035e2888
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1941947Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#65421}
      6b5bc5e9
  4. 10 Dec, 2019 1 commit
  5. 09 Dec, 2019 1 commit
    • Dominik Inführ's avatar
      [heap] Reland: Reduce size of possibly empty buckets · 56f56df6
      Dominik Inführ authored
      Before this CL a byte was used per bucket to store whether the bucket
      is possibly empty or not. This CL changes this such that each bucket
      only needs a single bit.
      
      PossiblyEmptyBuckets is now a word in the page header. If more bits
      are needed than fit into a single word, an external bitmap is
      allocated using AlignedAlloc. Storing this on the page header, allows
      to remove initial_buckets from the SlotSet. The SlotSet allocation is
      then again a power-of-2 in release mode.
      
      Reland of https://crrev.com/c/1906376: Incorrect DCHECK was removed.
      WordsForBuckets was simplified and a test was added for it.
      
      Bug: chromium:1023139
      Change-Id: I9a08e03a9c10e5781a146b9a28dab38824aad91f
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1954391Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#65385}
      56f56df6
  6. 06 Dec, 2019 2 commits
  7. 05 Dec, 2019 1 commit
    • Ulan Degenbaev's avatar
      [heap] Decouple the lifetime of a TracedNode from the target object · d7160560
      Ulan Degenbaev authored
      Currently a TracedNode of a TracedReference is freed only if its target
      V8 object is unreachable. This is problematic for TracedNodes created for
      long-living (or immortal) V8 objects and leads to memory leaks.
      
      This CL adds logic for collecting unreachable TracedNodes:
      1) Each TracedNode gets a markbit. Initially the markbit is set (i.e.
         we have black allocation for TracedNodes).
      2) During marking RegisterEmbedderReference sets the markbit of the
         corresonding TracedNode.
      3) In the atomic pause of Mark-Compact when TracedNodes are iterated,
         we check the markbits and free TracedNodes with cleared markbits.
         After this processing all markbits are cleared for the next GC.
      
      Note that the new logic does not apply to TracedNode that have
      callbacks and/or destructors.
      
      Bug: chromium:1029738
      Change-Id: I38e76a8b4a84170793998988b1a7962e40874428
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1948722
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
      Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#65347}
      d7160560
  8. 04 Dec, 2019 1 commit
  9. 02 Dec, 2019 2 commits
  10. 29 Nov, 2019 1 commit
  11. 28 Nov, 2019 3 commits
  12. 27 Nov, 2019 1 commit
  13. 25 Nov, 2019 1 commit
  14. 22 Nov, 2019 2 commits
  15. 21 Nov, 2019 2 commits
  16. 20 Nov, 2019 3 commits
  17. 18 Nov, 2019 2 commits
  18. 16 Nov, 2019 1 commit
    • Dominik Inführ's avatar
      [heap] Reduce size of possibly empty buckets · 80caf2cf
      Dominik Inführ authored
      Before this CL a byte was used per bucket to store whether the bucket
      is possibly empty or not. This CL changes this such that each bucket
      only needs a single bit.
      
      PossiblyEmptyBuckets is now a word in the page header. If more bits
      are needed than fit into a single word, an external bitmap is
      allocated using AlignedAlloc. Storing this on the page header, allows
      to remove initial_buckets from the SlotSet. The SlotSet allocation is
      then again a power-of-2 in release mode.
      
      Change-Id: If61fd5cfa153f98757beeb444a530f6e2803fdb6
      Bug: chromium:1023139
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1906376
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#64991}
      80caf2cf
  19. 15 Nov, 2019 2 commits
  20. 12 Nov, 2019 1 commit
  21. 08 Nov, 2019 2 commits
  22. 07 Nov, 2019 2 commits
  23. 06 Nov, 2019 2 commits