1. 26 Oct, 2021 1 commit
  2. 19 Oct, 2021 1 commit
  3. 18 Oct, 2021 3 commits
  4. 11 Oct, 2021 1 commit
  5. 06 Oct, 2021 1 commit
  6. 24 Sep, 2021 1 commit
  7. 23 Sep, 2021 1 commit
  8. 16 Sep, 2021 1 commit
    • Dominik Inführ's avatar
      [heap] Add and remove allocation observers without using safepoints · d79e0c4f
      Dominik Inführ authored
      Safepoints were used in Heap::AddAllocationObserversToAllSpaces and
      Heap::RemoveAllocationObserversFromAllSpaces as a poor man's approach
      to synchronization. This CL removes the safepoint and protects the
      potential race on the free list with a mutex in
      PagedSpace::DecreaseLimit.
      
      The motivation for this CL is that SafepointScope might possibly park
      the main thread in the future. However parking is only allowed if GCs
      are also allowed. GCs are not allowed when running allocation observers,
      so an allocation observer would not be able to add or remove additional
      observers as is currently done in StressConcurrentAllocationObserver.
      
      Also adding additional checks to the safepoint to ensure that we are
      on the main thread.
      
      Bug: v8:11708
      Change-Id: I4e65a83ac4015d30b15d8c4eeaed4ea759b7c982
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160523
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#76867}
      d79e0c4f
  9. 15 Jul, 2021 1 commit
  10. 11 Jun, 2021 1 commit
  11. 09 Jun, 2021 2 commits
  12. 06 Jun, 2021 1 commit
    • Dominik Inführ's avatar
      Reland "[heap] Remove unused LocalSpace class" · c91c7270
      Dominik Inführ authored
      This is a reland of b0c70710
      
      The first CL got reverted because of build errors. This CL replaces the
      remaining usage of is_local_space() with is_compaction_space().
      Supposedly this was a leftover because https://crrev.com/c/2928189
      landed at roughly the same time.
      
      Original change's description:
      > [heap] Remove unused LocalSpace class
      >
      > LocalSpace was introduced for off-heap spaces with concurrent bytecode
      > compilation finalization. However, finalization ended up using
      > LocalHeap for concurrent allocations. LocalSpace is therefore unused
      > and can be removed.
      >
      > This CL removes LocalSpace and renames all mentions of local space to
      > compaction space. Compaction space was the only local space left.
      >
      > Change-Id: I12a8a2724f777a77ddb9957fe2d8e89febfebbaf
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2930169
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#74914}
      
      Change-Id: I993c47fe85f4140f5d6137afde2653a48047cafb
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2939983Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74957}
      c91c7270
  13. 02 Jun, 2021 2 commits
    • Clemens Backes's avatar
      Revert "[heap] Remove unused LocalSpace class" · c538b9b4
      Clemens Backes authored
      This reverts commit b0c70710.
      
      Reason for revert: Lots of compile errors.
      
      Original change's description:
      > [heap] Remove unused LocalSpace class
      >
      > LocalSpace was introduced for off-heap spaces with concurrent bytecode
      > compilation finalization. However, finalization ended up using
      > LocalHeap for concurrent allocations. LocalSpace is therefore unused
      > and can be removed.
      >
      > This CL removes LocalSpace and renames all mentions of local space to
      > compaction space. Compaction space was the only local space left.
      >
      > Change-Id: I12a8a2724f777a77ddb9957fe2d8e89febfebbaf
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2930169
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#74914}
      
      Change-Id: I3a654da0ddb556c1fb8767f8401ecd3b46786bea
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2933140
      Auto-Submit: Clemens Backes <clemensb@chromium.org>
      Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Cr-Commit-Position: refs/heads/master@{#74915}
      c538b9b4
    • Dominik Inführ's avatar
      [heap] Remove unused LocalSpace class · b0c70710
      Dominik Inführ authored
      LocalSpace was introduced for off-heap spaces with concurrent bytecode
      compilation finalization. However, finalization ended up using
      LocalHeap for concurrent allocations. LocalSpace is therefore unused
      and can be removed.
      
      This CL removes LocalSpace and renames all mentions of local space to
      compaction space. Compaction space was the only local space left.
      
      Change-Id: I12a8a2724f777a77ddb9957fe2d8e89febfebbaf
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2930169Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74914}
      b0c70710
  14. 01 Jun, 2021 1 commit
  15. 27 May, 2021 1 commit
    • Dominik Inführ's avatar
      [heap] Use base::SharedMutex in Heap::IsPendingAllocation · f2fd431a
      Dominik Inführ authored
      Use a read-write lock for protecting original_top, original_limit and
      pending_object for all spaces. This way Heap::IsPendingAllocation is
      always guaranteed to read a consistent top/limit-pair and also the
      last values for those fields.
      
      The main thread will acquire an exclusive lock to update those fields.
      Concurrent Turbofan threads will use shared locks to read them.
      
      This may be quite expensive on the Turbofan-side, so landing this CL
      should help us figure out how big of a regression this simple fix would
      be. For main thread execution performance is supposed to be okay, since
      this is only used on the allocation slow path.
      
      Bug: v8:11778, chromium:1213266
      Change-Id: I9464f53fd50057ec2540ab5b79f74ee52a5d7500
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2903143
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74814}
      f2fd431a
  16. 07 May, 2021 1 commit
    • Dominik Inführ's avatar
      [heap] Immediately update external memory on JSArrayBuffer::Detach · edd27c77
      Dominik Inführ authored
      This CL changes the accounting of array buffers, such that Detach
      deducts the backing store immediately. Previously this was corrected
      in the next GC cycle.
      
      Not updating backing_store_bytes_ immediately could cause an overflow
      in WasmMemoryObject::Grow. Grow first detaches the backing store from
      the old JSArrayBuffer and then attaches it to a new one. This results
      in the backing store being accounted twice temporarily, this could cause
      overflows on 32-bit systems.
      
      Bug: chromium:1204455
      Change-Id: I7cf2ca9a12bb5caf7bcffa25a34567774cf155b8
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2871458
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74429}
      edd27c77
  17. 12 Apr, 2021 1 commit
  18. 29 Mar, 2021 1 commit
  19. 09 Mar, 2021 1 commit
  20. 24 Nov, 2020 1 commit
  21. 11 Nov, 2020 1 commit
  22. 09 Nov, 2020 1 commit
  23. 29 Oct, 2020 1 commit
  24. 24 Sep, 2020 1 commit
  25. 21 Sep, 2020 1 commit
    • Ulan Degenbaev's avatar
      [heap] Fix tracking of code pages for V8 stack unwinder (attempt #2) · b24d8de1
      Ulan Degenbaev authored
      When a compaction space allocates a new code page, that pages needs to
      be added to the Isolate::code_pages_ array used for stack unwinding.
      Since the array is owned by the main thread, compaction thread cannot
      directly modify it. Because of that code pages are added upon merging
      of the compaction space to the main space in MergeLocalSpace.
      
      The bug was that all code pages coming from the compaction space
      were added to the code_pages_ array. However, some of the pages are
      not newly allocated but merely borrowed from the main space.
      
      This CL keeps track of all newly allocated paged by a compaction space.
      
      Bug: v8:10900
      Change-Id: Iff3ff5d608df60fb752d2e0ffc29e51f2d967936
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2418718
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70023}
      b24d8de1
  26. 18 Sep, 2020 2 commits
    • Maya Lekova's avatar
      Revert "[heap] Fix tracking of code pages for V8 stack unwinder" · 027e5888
      Maya Lekova authored
      This reverts commit af5f437c.
      
      Reason for revert: Seems to break TSAN - https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20TSAN/33286?
      
      Original change's description:
      > [heap] Fix tracking of code pages for V8 stack unwinder
      > 
      > When a compaction space allocates a new code page, that pages needs to
      > be added to the Isolate::code_pages_ array used for stack unwinding.
      > Since the array is owned by the main thread, compaction thread cannot
      > directly modify it. Because of that code pages are added upon merging
      > of the compaction space to the main spage in MergeLocalSpace.
      > 
      > The bug was that all code pages coming from the compaction space
      > were added to the code_pages_ array. However, some of the pages are
      > not newly allocated but merely borrowed from the main space.
      > 
      > This CL introduces a new page flag for marking pages that are borrowed
      > during compaction and skips them in MergeLocalSpace.
      > 
      > Bug: v8:10900
      > Change-Id: I786dc5747bd7c785ae58dfd8b841c00774efb15e
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2416500
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
      > Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#69992}
      
      TBR=ulan@chromium.org,jkummerow@chromium.org,dinfuehr@chromium.org
      
      Change-Id: I13f8b64014750af95423166152dc9bee8cec12d0
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:10900
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2418395Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
      Commit-Queue: Maya Lekova <mslekova@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69993}
      027e5888
    • Ulan Degenbaev's avatar
      [heap] Fix tracking of code pages for V8 stack unwinder · af5f437c
      Ulan Degenbaev authored
      When a compaction space allocates a new code page, that pages needs to
      be added to the Isolate::code_pages_ array used for stack unwinding.
      Since the array is owned by the main thread, compaction thread cannot
      directly modify it. Because of that code pages are added upon merging
      of the compaction space to the main spage in MergeLocalSpace.
      
      The bug was that all code pages coming from the compaction space
      were added to the code_pages_ array. However, some of the pages are
      not newly allocated but merely borrowed from the main space.
      
      This CL introduces a new page flag for marking pages that are borrowed
      during compaction and skips them in MergeLocalSpace.
      
      Bug: v8:10900
      Change-Id: I786dc5747bd7c785ae58dfd8b841c00774efb15e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2416500Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69992}
      af5f437c
  27. 03 Sep, 2020 1 commit
  28. 14 Aug, 2020 1 commit
    • Leszek Swirski's avatar
      [offthread] Change OffThreadIsolate to LocalIsolate · f1589bbe
      Leszek Swirski authored
      This patch introduces a new LocalIsolate and LocalFactory, which use
      LocalHeap and replace OffThreadIsolate and OffThreadFactory. This allows
      us to remove those classes, as well as the related OffThreadSpace,
      OffThreadLargeObjectSpace, OffThreadHeap, and OffThreadTransferHandle.
      OffThreadLogger becomes LocalLogger.
      
      LocalHeap behaves more like Heap than OffThreadHeap did, so this allows
      us to additionally remove the concept of "Finish" and "Publish" that the
      OffThreadIsolate had, and allows us to internalize strings directly with
      the newly-concurrent string table (where the implementation can now move
      to FactoryBase).
      
      This patch also removes the off-thread support from the deserializer
      entirely, as well as removing the LocalIsolateWrapper which allowed
      run-time distinction between Isolate and OffThreadIsolate. LocalHeap
      doesn't support the reservation model used by the deserializer, and we
      will likely move the deserializer to use LocalIsolate unconditionally
      once we figure out the details of how to do this.
      
      Bug: chromium:1011762
      
      Change-Id: I1a1a0a72952b19a8a4c167c11a863c153a1252fc
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2315990
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Auto-Submit: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69397}
      f1589bbe
  29. 13 Aug, 2020 2 commits
  30. 12 Aug, 2020 1 commit
  31. 11 Aug, 2020 2 commits
  32. 05 Aug, 2020 1 commit
    • Dominik Inführ's avatar
      [heap] Remove PagedSpace::SizeOfObjects · ab8368df
      Dominik Inführ authored
      PagedSpace::SizeOfObjects() then returns exactly the same value as
      PagedSpace::Size(). SizeOfObjects() used to deduct the current LAB,
      however this is now more difficult with local heaps. Accessing the
      main thread LAB from concurrent threads causes a data race. Also
      LocalHeaps have their own LAB, which should be deducted as well to be
      uniform with the main thread. However this would be tricky and expensive.
      The simpler solution is to do not deduct the main thread LAB anymore.
      
      Bug: v8:10315
      Change-Id: I3c47e1a65caca9395737251aa694b295e78c7fb5
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2336090
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69245}
      ab8368df
  33. 04 Aug, 2020 1 commit
    • Dominik Inführ's avatar
      Reland "[heap] Refactor allocation observer in AllocationCounter" · 9fff9a73
      Dominik Inführ authored
      This is a reland of b354e344
      
      This CL adds 3 fixes:
      
      * Unprotect code object before creating filler
      * Allows AllocationObserver::Step to add more AllocationObservers
      * Update limit in NewSpace::UpdateLinearAllocationArea
      
      Original change's description:
      > [heap] Refactor allocation observer in AllocationCounter
      >
      > Moves accounting of allocation observers into the AllocationCounter
      > class. This CL removes top_on_previous_step_ for counters that are
      > increased regularly in the slow path of the allocation functions.
      >
      > AdvanceAllocationObservers() informs the AllocationCounter about
      > allocated bytes, InvokeAllocationObservers() needs to be invoked when
      > an allocation step is reached. NextBytes() returns the number of bytes
      > until the next AllocationObserver::Step needs to run.
      >
      > Bug: v8:10315
      > Change-Id: I8b6eb8719ab032d44ee0614d2a0f2645bfce9df6
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2320650
      > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#69170}
      
      Bug: v8:10315
      Change-Id: I89ab4d5069a234a293471f613dab16b47d8fff89
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2332805Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69216}
      9fff9a73