1. 24 Aug, 2022 1 commit
  2. 18 Aug, 2022 1 commit
  3. 10 Aug, 2022 1 commit
    • Michael Lippautz's avatar
      Reland "[handles] Remove precise on-stack representation of global handles" · 65d43890
      Michael Lippautz authored
      This is a reland of commit 6953b555
      
      The reland fixes tests that retrieved the stack start from a
      non-inlined frame's fp. This does not work in certain configurations
      as the resulting marker is too low to consider the first local
      variables in subsequent calls.
      
      The fix uses an inline frame address for the tests to get an upper
      bound of stack addresses to consider.
      
      Original change's description:
      > [handles] Remove precise on-stack representation of global handles
      >
      > Since https://crrev.com/c/3806439 on-stack traced handles are marked
      > conservatively when being used in combination with CppHeap.
      >
      > This change removes the precise on-stack representation of the
      > internal traced nodes as they nodes would anyways be marked
      > conservatively. The effects are:
      > - cheaper representation (just a single node space);
      > - uniform handling: no checks to distinguish on-stack vs on-heap;
      > - no brittleness around cleaning on-stack handles when the event loop
      >  is empty;
      >
      > Change-Id: Id859623bfed77a66bdd064ea8065536264515eae
      > Bug: v8:13141
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3812039
      > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
      > Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#82306}
      
      Bug: v8:13141
      Change-Id: I53ece36220e99d02be6df18f83c18450e5d5037b
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3820585Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#82342}
      65d43890
  4. 09 Aug, 2022 3 commits
  5. 04 Aug, 2022 1 commit
  6. 01 Aug, 2022 1 commit
    • Nico Weber's avatar
      Make bitfields only as wide as necessary for enums · d15d49b0
      Nico Weber authored
      clang now complains when a BitField for an enum is too wide.
      We could suppress this, but it seems kind of useful from an
      uninformed distance, so I made a few bitfields smaller instead.
      
      (For AddressingMode, since its size is target-dependent, I added
      an explicit underlying type to the enum instead, which suppresses
      the diag on a per-enum basis.)
      
      This is without any understanding of the code I'm touching.
      Especially the change in v8-internal.h feels a bit risky to me.
      
      Bug: chromium:1348574
      Change-Id: I73395de593045036b72dadf4e3147b5f7e13c958
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3794708
      Commit-Queue: Nico Weber <thakis@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Auto-Submit: Nico Weber <thakis@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#82109}
      d15d49b0
  7. 22 Jun, 2022 1 commit
  8. 14 Jun, 2022 1 commit
  9. 09 Jun, 2022 1 commit
  10. 13 May, 2022 1 commit
  11. 10 May, 2022 1 commit
    • Michael Lippautz's avatar
      [handles] Fix benign data race · cd04f804
      Michael Lippautz authored
      Upon destroying a v8::TracedReference while concurrent marking is
      running, we merely reset the object pointer but do not get rid of the
      global handle.
      
      We were also restting the parameter which would read the internal
      state for a DCHECK. Remove this clearing as the parameter field is not
      used for v8::TracedReference.
      
      Bug: chromium:1324074
      Change-Id: Ic21bad78deba0925e12c3fc1215b087d0ef5dd7a
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3637796Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#80459}
      cd04f804
  12. 28 Apr, 2022 1 commit
  13. 25 Apr, 2022 2 commits
  14. 22 Apr, 2022 1 commit
  15. 21 Apr, 2022 3 commits
  16. 12 Apr, 2022 1 commit
  17. 11 Apr, 2022 1 commit
    • Michael Lippautz's avatar
      Reland "cppgc-js: Concurrently process v8::TracedReference" · 2da23bd5
      Michael Lippautz authored
      This is a reland of commit 1f0d7d20
      
      The fix merges concurrent marking tasks when marking in the atomic
      pause. Without the fix, Oilpan markers would continue running
      concurrently, possibly discovering new V8 objects. This violates the
      assumption that the final transitive closure runs on a single thread.
      
      Original change's description:
      > cppgc-js: Concurrently process v8::TracedReference
      >
      > Adds concurrent marking for reaching through v8::TracedReference.
      > Before this CL, a v8::TracedReference would always be processed on the
      > main thread by pushing a callback for each encountered reference.
      >
      > This CL now wires up concurrent handling for such references. In particular:
      > - Global handles are already marked as well and not repurposed during
      >   the same GC cycle.
      > - Since global handles are not repurposed, it is enough to
      >   double-deref to the V8 object, checking for possible null pointers.
      > - The bitmap for global handle flags is mostly non-atomic, with the
      >   markbit being the exception.
      > - Finally, all state is wired up in CppHeap. Concurrent markers keep
      >   their own local worklist while the mutator marker directly pushes to
      >   the worklist owned by V8.
      >
      > Bug: v8:12600
      > Change-Id: Ia67dbd18a57dbcccf4dfb9ccfdb9ee438d27fe71
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3516255
      > Reviewed-by: Omer Katz <omerkatz@chromium.org>
      > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
      > Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#79736}
      
      Bug: v8:12600
      Change-Id: I8545041b2c7b3daf7ecea7e3a100e27534e9b8b5
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571887Reviewed-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@{#79919}
      2da23bd5
  18. 05 Apr, 2022 1 commit
    • Leszek Swirski's avatar
      Revert "cppgc-js: Concurrently process v8::TracedReference" · 64e89350
      Leszek Swirski authored
      This reverts commit 1f0d7d20.
      
      Reason for revert: Speculative revert for roll failures in https://chromium-review.googlesource.com/c/chromium/src/+/3569445
      
      Original change's description:
      > cppgc-js: Concurrently process v8::TracedReference
      >
      > Adds concurrent marking for reaching through v8::TracedReference.
      > Before this CL, a v8::TracedReference would always be processed on the
      > main thread by pushing a callback for each encountered reference.
      >
      > This CL now wires up concurrent handling for such references. In particular:
      > - Global handles are already marked as well and not repurposed during
      >   the same GC cycle.
      > - Since global handles are not repurposed, it is enough to
      >   double-deref to the V8 object, checking for possible null pointers.
      > - The bitmap for global handle flags is mostly non-atomic, with the
      >   markbit being the exception.
      > - Finally, all state is wired up in CppHeap. Concurrent markers keep
      >   their own local worklist while the mutator marker directly pushes to
      >   the worklist owned by V8.
      >
      > Bug: v8:12600
      > Change-Id: Ia67dbd18a57dbcccf4dfb9ccfdb9ee438d27fe71
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3516255
      > Reviewed-by: Omer Katz <omerkatz@chromium.org>
      > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
      > Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#79736}
      
      Bug: v8:12600
      Change-Id: I8a91dcd6880580207bf8d315b264edbe42a794e5
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3568474
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Owners-Override: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79778}
      64e89350
  19. 04 Apr, 2022 1 commit
    • Michael Lippautz's avatar
      cppgc-js: Concurrently process v8::TracedReference · 1f0d7d20
      Michael Lippautz authored
      Adds concurrent marking for reaching through v8::TracedReference.
      Before this CL, a v8::TracedReference would always be processed on the
      main thread by pushing a callback for each encountered reference.
      
      This CL now wires up concurrent handling for such references. In particular:
      - Global handles are already marked as well and not repurposed during
        the same GC cycle.
      - Since global handles are not repurposed, it is enough to
        double-deref to the V8 object, checking for possible null pointers.
      - The bitmap for global handle flags is mostly non-atomic, with the
        markbit being the exception.
      - Finally, all state is wired up in CppHeap. Concurrent markers keep
        their own local worklist while the mutator marker directly pushes to
        the worklist owned by V8.
      
      Bug: v8:12600
      Change-Id: Ia67dbd18a57dbcccf4dfb9ccfdb9ee438d27fe71
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3516255Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79736}
      1f0d7d20
  20. 23 Mar, 2022 1 commit
  21. 07 Mar, 2022 1 commit
  22. 17 Feb, 2022 1 commit
  23. 04 Feb, 2022 2 commits
  24. 18 Jan, 2022 1 commit
    • Anton Bikineev's avatar
      Handles: Fix OnStackTracedNodeSpace with -fsanitize=safe-stack · c7fbac6a
      Anton Bikineev authored
      When the stack is split in safe and unsafe parts, on-stack
      TracedReferences are allocated on the unsafe stack. What currently
      happens is that on GC we destroy all the on-stack references below the
      current frame of the *safe* stack. If the safe stack is allocated above
      the unsafe counterpart, then all the traced references will be
      preliminary destructed on GC. This CL fixes it by using
      __builtin___get_unsafe_stack_ptr() if -fsanitize=safe-stack is enabled.
      
      In addition, deduplicate OnStackTracedNodeSpace::IsOnStack() and
      Stack::IsOnStack() and move more logic into ::heap::base::Stack.
      
      Bug: chromium:1278780
      Change-Id: I9582bb1321958b7ec8ef2c0c46b9e42d51bb6f94
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3395033Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Anton Bikineev <bikineev@chromium.org>
      Auto-Submit: Anton Bikineev <bikineev@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78660}
      c7fbac6a
  25. 15 Dec, 2021 1 commit
    • Samuel Groß's avatar
      V8 Sandbox rebranding · 277fdd1d
      Samuel Groß authored
      This CL renames a number of things related to the V8 sandbox.
      Mainly, what used to be under V8_HEAP_SANDBOX is now under
      V8_SANDBOXED_EXTERNAL_POINTERS, while the previous V8 VirtualMemoryCage
      is now simply the V8 Sandbox:
      
      V8_VIRTUAL_MEMORY_CAGE => V8_SANDBOX
      V8_HEAP_SANDBOX => V8_SANDBOXED_EXTERNAL_POINTERS
      V8_CAGED_POINTERS => V8_SANDBOXED_POINTERS
      V8VirtualMemoryCage => Sandbox
      CagedPointer => SandboxedPointer
      fake cage => partially reserved sandbox
      src/security => src/sandbox
      
      This naming scheme should simplify things: the sandbox is now the large
      region of virtual address space inside which V8 mainly operates and
      which should be considered untrusted. Mechanisms like sandboxed pointers
      are then used to attempt to prevent escapes from the sandbox (i.e.
      corruption of memory outside of it). Furthermore, the new naming scheme
      avoids the confusion with the various other "cages" in V8, in
      particular, the VirtualMemoryCage class, by dropping that name entirely.
      
      Future sandbox features are developed under their own V8_SANDBOX_X flag,
      and will, once final, be merged into V8_SANDBOX. Current future features
      are sandboxed external pointers (using the external pointer table), and
      sandboxed pointers (pointers guaranteed to point into the sandbox, e.g.
      because they are encoded as offsets). This CL then also introduces a new
      build flag, v8_enable_sandbox_future, which enables all future features.
      
      Bug: v8:10391
      Change-Id: I5174ea8f5ab40fb96a04af10853da735ad775c96
      Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng,v8_linux_arm64_sim_heap_sandbox_dbg_ng
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3322981Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Commit-Queue: Samuel Groß <saelo@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78384}
      277fdd1d
  26. 29 Oct, 2021 1 commit
  27. 28 Oct, 2021 2 commits
  28. 24 Aug, 2021 1 commit
    • Dan Elphick's avatar
      Reland "[include] Split out v8.h" · ec06bb6c
      Dan Elphick authored
      This is a reland of d1b27019
      
      Fixes include:
      Adding missing file to bazel build
      Forward-declaring classing before friend-classing them to fix win/gcc
      Add missing v8-isolate.h include for vtune builds
      
      Original change's description:
      > [include] Split out v8.h
      >
      > This moves every single class/function out of include/v8.h into a
      > separate header in include/, which v8.h then includes so that
      > externally nothing appears to have changed.
      >
      > Every include of v8.h from inside v8 has been changed to a more
      > fine-grained include.
      >
      > Previously inline functions defined at the bottom of v8.h would call
      > private non-inline functions in the V8 class. Since that class is now
      > in v8-initialization.h and is rarely included (as that would create
      > dependency cycles), this is not possible and so those methods have been
      > moved out of the V8 class into the namespace v8::api_internal.
      >
      > None of the previous files in include/ now #include v8.h, which means
      > if embedders were relying on this transitive dependency then it will
      > give compile failures.
      >
      > v8-inspector.h does depend on v8-scripts.h for the time being to ensure
      > that Chrome continue to compile but that change will be reverted once
      > those transitive #includes in chrome are changed to include it directly.
      >
      > Full design:
      > https://docs.google.com/document/d/1rTD--I8hCAr-Rho1WTumZzFKaDpEp0IJ8ejZtk4nJdA/edit?usp=sharing
      >
      > Bug: v8:11965
      > Change-Id: I53b84b29581632710edc80eb11f819c2097a2877
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3097448
      > Reviewed-by: Yang Guo <yangguo@chromium.org>
      > Reviewed-by: Camillo Bruni <cbruni@chromium.org>
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Commit-Queue: Dan Elphick <delphick@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#76424}
      
      Cq-Include-Trybots: luci.v8.try:v8_linux_vtunejit
      Bug: v8:11965
      Change-Id: I99f5d3a73bf8fe25b650adfaf9567dc4e44a09e6
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3113629Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#76460}
      ec06bb6c
  29. 23 Aug, 2021 2 commits
    • Dan Elphick's avatar
      Revert "[include] Split out v8.h" · 44fe02ce
      Dan Elphick authored
      This reverts commit d1b27019.
      
      Reason for revert: Broke vtune build, tsan build and possibly others
      
      Original change's description:
      > [include] Split out v8.h
      >
      > This moves every single class/function out of include/v8.h into a
      > separate header in include/, which v8.h then includes so that
      > externally nothing appears to have changed.
      >
      > Every include of v8.h from inside v8 has been changed to a more
      > fine-grained include.
      >
      > Previously inline functions defined at the bottom of v8.h would call
      > private non-inline functions in the V8 class. Since that class is now
      > in v8-initialization.h and is rarely included (as that would create
      > dependency cycles), this is not possible and so those methods have been
      > moved out of the V8 class into the namespace v8::api_internal.
      >
      > None of the previous files in include/ now #include v8.h, which means
      > if embedders were relying on this transitive dependency then it will
      > give compile failures.
      >
      > v8-inspector.h does depend on v8-scripts.h for the time being to ensure
      > that Chrome continue to compile but that change will be reverted once
      > those transitive #includes in chrome are changed to include it directly.
      >
      > Full design:
      > https://docs.google.com/document/d/1rTD--I8hCAr-Rho1WTumZzFKaDpEp0IJ8ejZtk4nJdA/edit?usp=sharing
      >
      > Bug: v8:11965
      > Change-Id: I53b84b29581632710edc80eb11f819c2097a2877
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3097448
      > Reviewed-by: Yang Guo <yangguo@chromium.org>
      > Reviewed-by: Camillo Bruni <cbruni@chromium.org>
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Commit-Queue: Dan Elphick <delphick@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#76424}
      
      Bug: v8:11965
      Change-Id: Id57313ae992e720c8b19abc975cd69729e1344aa
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3113627
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Owners-Override: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#76428}
      44fe02ce
    • Dan Elphick's avatar
      [include] Split out v8.h · d1b27019
      Dan Elphick authored
      This moves every single class/function out of include/v8.h into a
      separate header in include/, which v8.h then includes so that
      externally nothing appears to have changed.
      
      Every include of v8.h from inside v8 has been changed to a more
      fine-grained include.
      
      Previously inline functions defined at the bottom of v8.h would call
      private non-inline functions in the V8 class. Since that class is now
      in v8-initialization.h and is rarely included (as that would create
      dependency cycles), this is not possible and so those methods have been
      moved out of the V8 class into the namespace v8::api_internal.
      
      None of the previous files in include/ now #include v8.h, which means
      if embedders were relying on this transitive dependency then it will
      give compile failures.
      
      v8-inspector.h does depend on v8-scripts.h for the time being to ensure
      that Chrome continue to compile but that change will be reverted once
      those transitive #includes in chrome are changed to include it directly.
      
      Full design:
      https://docs.google.com/document/d/1rTD--I8hCAr-Rho1WTumZzFKaDpEp0IJ8ejZtk4nJdA/edit?usp=sharing
      
      Bug: v8:11965
      Change-Id: I53b84b29581632710edc80eb11f819c2097a2877
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3097448Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#76424}
      d1b27019
  30. 11 Jun, 2021 1 commit
    • Dan Elphick's avatar
      [build] Reduce size of inline header cycles · c26965bd
      Dan Elphick authored
      This removes/replaces header includes with the aim of shrinking the
      size of the inline header cycle. Specifically before this CL, there was
      a single Strongly-Connected Component comprising 60 header files from
      src/objects and src/heap.
      
      Now there are two 2 SCCs. The src/heap SCC has 6 files and depends on
      the src/objects SCC, which has 50 files. Additionally some previously
      implicit dependencies have been added.
      
      Dependencies calculated using:
      git grep "#include \"" *.h *.cc | sed 's/:#include "/ /;s/".*$//' | \
      awk 'BEGIN {print "digraph deps {" } END {print "}"} {print "\""$1"\" -> \""$2"\""}'
      
      SCCs found using sccmap from graphviz.
      
      Also removes unused Cell::FromValueAddress method.
      
      Change-Id: Ib19d00ccd14e490ee64d57be4d99b1b3686ac32a
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2951734Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75103}
      c26965bd
  31. 27 Apr, 2021 1 commit
  32. 23 Apr, 2021 1 commit