1. 08 Apr, 2021 1 commit
    • Michael Lippautz's avatar
      cppgc: Check for correct base class inheritance · 143e6a74
      Michael Lippautz authored
      The only valid way to define a GCed type T is by inheriting from
      GarbageCollected<T>. Since this is prone to typos (see tests), add a
      simple check that covers most interesting use cases.
      
      The static assert covers
        A -> B -> GarbageCollected<C>
      
      The static assert does not cover
       A -> B -> C -> GarbageCollected<B>
      
      (In order to do so, we would need __direct_bases() support which is
      not yet available for C++.)
      
      Bug: pdfium:1670, chromium:1056170
      Change-Id: I494de48992f8ba9a1f0f9daad60584d828717403
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2810415Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#73854}
      143e6a74
  2. 06 Apr, 2021 1 commit
  3. 17 Mar, 2021 4 commits
    • Michael Lippautz's avatar
      cppgc: Refactor object allocation to improve binary size · fdae1b65
      Michael Lippautz authored
      Refactor SpacePolicy on a non-templated class to avoid the situation
      of having MakeGarbageCollectedTraitBase<T>::SpacePolicy<U> refer to
      different T and U which make it hard for the compiler to alias
      anything.
      
      Bug: chromium:1056170
      Change-Id: I78eb0362d43403ad2712bcb65746eeb9f6ad44fa
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2769338Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#73494}
      fdae1b65
    • Michael Lippautz's avatar
      Reland "cppgc: Rework GC info creation" · a03a868e
      Michael Lippautz authored
      This is a reland of d76064df
      
      Original change's description:
      > cppgc: Rework GC info creation
      >
      > Previously, GCInfoTrait relied on the non-trivial constructor of a
      > static object for registering a new GCInfo object. The generated code
      > is required to be thread-safe which is achieved by introducing guard
      > variables in the compiler.
      >
      > The new version is similar to Blink in that it relies on zero
      > initialization of a trivially constructible atomic.
      >
      > Compared to guard variables that are created per GCInfo registration,
      > the atomic creates less bloat (~20bytes/type) and also results in a
      > better fast path.
      >
      > Minimum example: https://godbolt.org/z/qrdTf8
      >
      > Bug: chromium:1056170
      > Change-Id: I95efbbf035b655d0440c9477f5391e310e2b71fa
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2764750
      > Reviewed-by: Omer Katz <omerkatz@chromium.org>
      > Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#73463}
      
      Bug: chromium:1056170
      Change-Id: I01e60beabc1d279d352361657f408f113aac768e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2767021
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Omer Katz <omerkatz@chromium.org>
      Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
      Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#73471}
      a03a868e
    • Maya Lekova's avatar
      Revert "cppgc: Rework GC info creation" · 8b9d0138
      Maya Lekova authored
      This reverts commit d76064df.
      
      Reason for revert: Breaking MSAN - https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/37390/overview
      
      Original change's description:
      > cppgc: Rework GC info creation
      >
      > Previously, GCInfoTrait relied on the non-trivial constructor of a
      > static object for registering a new GCInfo object. The generated code
      > is required to be thread-safe which is achieved by introducing guard
      > variables in the compiler.
      >
      > The new version is similar to Blink in that it relies on zero
      > initialization of a trivially constructible atomic.
      >
      > Compared to guard variables that are created per GCInfo registration,
      > the atomic creates less bloat (~20bytes/type) and also results in a
      > better fast path.
      >
      > Minimum example: https://godbolt.org/z/qrdTf8
      >
      > Bug: chromium:1056170
      > Change-Id: I95efbbf035b655d0440c9477f5391e310e2b71fa
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2764750
      > Reviewed-by: Omer Katz <omerkatz@chromium.org>
      > Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#73463}
      
      Bug: chromium:1056170
      Change-Id: I71960103513d6db7789d752b70727d014c2e6406
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2767020
      Auto-Submit: Maya Lekova <mslekova@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Michael Lippautz <mlippautz@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@{#73466}
      8b9d0138
    • Michael Lippautz's avatar
      cppgc: Rework GC info creation · d76064df
      Michael Lippautz authored
      Previously, GCInfoTrait relied on the non-trivial constructor of a
      static object for registering a new GCInfo object. The generated code
      is required to be thread-safe which is achieved by introducing guard
      variables in the compiler.
      
      The new version is similar to Blink in that it relies on zero
      initialization of a trivially constructible atomic.
      
      Compared to guard variables that are created per GCInfo registration,
      the atomic creates less bloat (~20bytes/type) and also results in a
      better fast path.
      
      Minimum example: https://godbolt.org/z/qrdTf8
      
      Bug: chromium:1056170
      Change-Id: I95efbbf035b655d0440c9477f5391e310e2b71fa
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2764750Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#73463}
      d76064df
  4. 12 Mar, 2021 1 commit
  5. 11 Mar, 2021 2 commits
  6. 09 Mar, 2021 1 commit
  7. 08 Mar, 2021 3 commits
  8. 04 Mar, 2021 1 commit
  9. 02 Mar, 2021 1 commit
  10. 26 Feb, 2021 4 commits
  11. 25 Feb, 2021 1 commit
    • Omer Katz's avatar
      cppgc: Add WasConservativeGC to HeapState · 199359da
      Omer Katz authored
      This CL adds WasConservativeGC to HeapState which reports whether the
      last GC was finalized conservatively. The state is updated at the end of
      marking atomic pause.
      
      Currently the library integration in Blink ignores the stack state when
      scheduling a forced GC for testing. That means that we always schedule
      another GC after a forced GC.
      This causes a crash in web_tests which assume no GC is happening
      between forced GCs if the thread is not idle and no new allocations
      happen.
      
      Usage CL: https://crrev.com/c/2720201
      
      Drive by: Fix stack state for MarkingVerifier in CppHeap.
      
      Bug: chromium:1056170
      Change-Id: I6ad23ed7c1a53fae96425b968bc4b3eb18ce80b7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2720279
      Commit-Queue: Omer Katz <omerkatz@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#73064}
      199359da
  12. 24 Feb, 2021 5 commits
  13. 17 Feb, 2021 2 commits
    • Omer Katz's avatar
      cppgc: Implement process-global state accessors. · c174643b
      Omer Katz authored
      Process global accessors for total physical size and used size are
      needed for blink. These are implemented via an allocation observer that
      atomically updates static counters.
      
      The public api only provides getters for the counters. An internal class
      is in charge of updating the counters as needed. A similar split is also
      applied to IsAnyIncrementalOrConcurrentMarking().
      
      Drive-by: ProcessHeap is merged into cppgc::internal::WriteBarrier.
      
      Bug: chromium:1056170
      Change-Id: Iaedebd1ac9d49238ce6bdd52ffa5d1ef4d28203d
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2695394
      Commit-Queue: Omer Katz <omerkatz@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72832}
      c174643b
    • Michael Lippautz's avatar
      cppgc: Remove ephemeron filter · 11f1e12b
      Michael Lippautz authored
      Previously, ephemerons without a base_object_payload have been
      filtered.  base_object_payload is currently used to differentiate
      between GarbageCollected and just traceable objects, so we need to
      pass on the empty descriptor.
      
      Bug: chromium:1056170
      Change-Id: I9cba53295779ec74dce2822b7bf83f477bc3241f
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2700039Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72820}
      11f1e12b
  14. 16 Feb, 2021 1 commit
    • Omer Katz's avatar
      cppgc: Handle non-gced traceable ephemeron values · 75131637
      Omer Katz authored
      On-heap hash maps in blink are limited to Member types and non-traceable
      types. The only exception to that is TraceWrapperV8Reference. Thus
      ephemerons can have non-gced traceable values. This values should not be
      pushed to the marking worklist since we expect everything in the
      worklist to be marked and not in construction (but these values don't
      have an object header).
      Instead, when getting a non-gced value we should immediately trace it.
      
      This is only relevant to ephemerons. Any other case would go through
      Trace(const T&) that dispatches to the TraceTrait.
      
      Blink has 1 use case of HeahHashMap from WeakMember<ScriptWrappable> to
      TraceWrapperV8Reference.
      
      Bug: chromium:1056170
      Change-Id: Ia8f341d6bb1fc8fd3655b2be66b7814896549d1e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2696648Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Omer Katz <omerkatz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72763}
      75131637
  15. 12 Feb, 2021 1 commit
  16. 11 Feb, 2021 3 commits
  17. 10 Feb, 2021 1 commit
  18. 09 Feb, 2021 1 commit
  19. 08 Feb, 2021 1 commit
  20. 05 Feb, 2021 1 commit
    • Michael Lippautz's avatar
      cppgc: Fix low-level write barriers · 65893d84
      Michael Lippautz authored
      Some types of supported low-level write barrier only requires passing
      a slot, which may not be even part of a heap object but stack.
      
      This complicates the situation, as even with caged heap, there's no
      way to distinguish a stack and heap slot.
      
      Solve this by passing an optional callback that can lazy be used to
      get the heap. This can be used by the embedder to retrieve the heap
      from e.g. TLS if needed.  This aligns the barrier with Oilpan in
      Blink.
      
      Bug: chromium:1056170
      Change-Id: I1e5d022ab17a2614a67b6ef39ed12691bcbd0ac6
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2675924Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72550}
      65893d84
  21. 03 Feb, 2021 1 commit
  22. 02 Feb, 2021 1 commit
  23. 29 Jan, 2021 1 commit
  24. 28 Jan, 2021 1 commit