1. 14 Jan, 2022 1 commit
    • Michael Lippautz's avatar
      Reland "cppgc-js,heap: Implement snapshots for embedder fields" · 804aaa5c
      Michael Lippautz authored
      This is a reland of 142dd775
      
      Original change's description:
      > cppgc-js,heap: Implement snapshots for embedder fields
      >
      > https://crrev.com/c/3293410 added concurrent processing of C++ objects
      > found through V8 embedder fields. The CL missed that those embedder
      > fields are not read atomically from JS objects. The problem is that
      > embedder fields are only aligned to kTaggedSize on builds with pointer
      > compression and are as such mis-aligned for atomic ops. This is not a
      > problem for on-heap values as the upper 32bits are anyways computed
      > from the cage. Is is a problem for generic C++ values though, as they
      > are used with Oilpan.
      >
      > This CL adds the standard marker snapshot protocol for embedder fields.
      >
      > Marker:
      > 1. Snapshot embedder fields
      > 2. Try to mark host object
      > 3. On success: process snapshot
      >
      > Main thread:
      > 1. On setting embedder fields mark the object black first
      > 2. Emit a write barrier for the embedder fields
      >
      > This will get simpler with the heap sandbox that uses a separate table
      > for embedder fields. Once the sandbox is the default configuration, we
      > 	can use it as dependency for the concurrent fast path.
      >
      > Bug: chromium:1285706
      > Change-Id: I6b975ea561be08cda840ef0dd27a11627de93900
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3380983
      > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
      > Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#78604}
      
      Bug: chromium:1285706
      Change-Id: I024e50fc0757fbcd13cb9ffde027dff55f99d25c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3386600Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78631}
      804aaa5c
  2. 13 Jan, 2022 3 commits
    • Lei Zhang's avatar
      Remove many superfluous STL includes in headers. · 87cf0bdd
      Lei Zhang authored
      Use grep to check for obviously unneeded includes. e.g. headers that
      include <vector> but does not contain "std::vector".
      
      Change-Id: I43a9e9f01e072fd495918d28ca4cdad5cfa0294c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3354400Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Lei Zhang <thestig@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78613}
      87cf0bdd
    • Leszek Swirski's avatar
      Revert "cppgc-js,heap: Implement snapshots for embedder fields" · 7d4e3d35
      Leszek Swirski authored
      This reverts commit 142dd775.
      
      Reason for revert: TSAN breaks: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20stress-incremental-marking/6113/overview
      
      Original change's description:
      > cppgc-js,heap: Implement snapshots for embedder fields
      >
      > https://crrev.com/c/3293410 added concurrent processing of C++ objects
      > found through V8 embedder fields. The CL missed that those embedder
      > fields are not read atomically from JS objects. The problem is that
      > embedder fields are only aligned to kTaggedSize on builds with pointer
      > compression and are as such mis-aligned for atomic ops. This is not a
      > problem for on-heap values as the upper 32bits are anyways computed
      > from the cage. Is is a problem for generic C++ values though, as they
      > are used with Oilpan.
      >
      > This CL adds the standard marker snapshot protocol for embedder fields.
      >
      > Marker:
      > 1. Snapshot embedder fields
      > 2. Try to mark host object
      > 3. On success: process snapshot
      >
      > Main thread:
      > 1. On setting embedder fields mark the object black first
      > 2. Emit a write barrier for the embedder fields
      >
      > This will get simpler with the heap sandbox that uses a separate table
      > for embedder fields. Once the sandbox is the default configuration, we
      > 	can use it as dependency for the concurrent fast path.
      >
      > Bug: chromium:1285706
      > Change-Id: I6b975ea561be08cda840ef0dd27a11627de93900
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3380983
      > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
      > Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#78604}
      
      Bug: chromium:1285706
      Change-Id: If1976c0356f450fc068aa4dcc39fb9a0d5417a40
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3386598
      Auto-Submit: Leszek Swirski <leszeks@chromium.org>
      Owners-Override: Leszek Swirski <leszeks@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/main@{#78605}
      7d4e3d35
    • Michael Lippautz's avatar
      cppgc-js,heap: Implement snapshots for embedder fields · 142dd775
      Michael Lippautz authored
      https://crrev.com/c/3293410 added concurrent processing of C++ objects
      found through V8 embedder fields. The CL missed that those embedder
      fields are not read atomically from JS objects. The problem is that
      embedder fields are only aligned to kTaggedSize on builds with pointer
      compression and are as such mis-aligned for atomic ops. This is not a
      problem for on-heap values as the upper 32bits are anyways computed
      from the cage. Is is a problem for generic C++ values though, as they
      are used with Oilpan.
      
      This CL adds the standard marker snapshot protocol for embedder fields.
      
      Marker:
      1. Snapshot embedder fields
      2. Try to mark host object
      3. On success: process snapshot
      
      Main thread:
      1. On setting embedder fields mark the object black first
      2. Emit a write barrier for the embedder fields
      
      This will get simpler with the heap sandbox that uses a separate table
      for embedder fields. Once the sandbox is the default configuration, we
      	can use it as dependency for the concurrent fast path.
      
      Bug: chromium:1285706
      Change-Id: I6b975ea561be08cda840ef0dd27a11627de93900
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3380983Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78604}
      142dd775
  3. 27 Dec, 2021 1 commit
    • Omer Katz's avatar
      cppgc-js, heap: Concurrently push references from v8 to Oilpan · d10f61e1
      Omer Katz authored
      Included in this CL:
      (*) Introduce CppMarkingState that V8 should use to push references to
          Oilpan. CppMarkingState allocates its own Worklist::Locals to
          support concurrent updates from V8.
      (*) Split Oilpan MarkingWorklist object to form a base class used by
          CppMarkingState.
      (*) Remove MarkerFactory and split marking initialization. Marking
          worklists should already be initialized when V8 initializes
          visitors. For incremental marking, this requires splitting
          marking initialization and marking start.
      (*) Drive-by: Mark JSObject::IsApiWrapper and
          JSObject::IsDroppableApiWrapper as const.
      
      Bug: v8:12407
      Change-Id: I35cc816343da86f69a68306204675720e9b3913f
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3293410Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Omer Katz <omerkatz@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78446}
      d10f61e1
  4. 09 Sep, 2020 1 commit
  5. 11 Aug, 2020 1 commit
    • Ulan Degenbaev's avatar
      [heap] Split marking worklist into global worklist and local worklists · 28133adc
      Ulan Degenbaev authored
      This is the first step in refactoring Worklist to allow arbitrary
      number of local worklists with private segments:
      - Introduce MarkingWorklistImpl<> which will eventually replace
        (and will be renamed to) Worklist.
      - MarkingWorklistImpl<> owns the global pool of segments but does not
        keep track of private segments.
      - MarkingWorklistImpl<>::Local owns private segments and can be
        constructed dynamically on background threads.
      - Rename the existing MarkingWorklistsHolder to MarkingWorklists.
      - Rename the existing MarkingWorklists to MarkingWorklists::Local.
      - Rename the existing marking_workists_holder to marking_worklists.
      - Rename the existing marking_worklists to local_marking_worklists.
      
      Design doc: https://bit.ly/2XMtjLi
      Bug: v8:10315
      
      Change-Id: I9da34883ad34f4572fccd40c51e51eaf50c617bc
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2343330Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69330}
      28133adc