1. 13 Aug, 2020 1 commit
    • Leszek Swirski's avatar
      [runtime] Compress the off-heap string table · 279bd3e1
      Leszek Swirski authored
      Rather than an Object array, use a Tagged_t array to store the
      elements of the off-heap string table. This matches the old on-heap
      string table's behaviour, and recovers memory regressions from that
      work.
      
      To be able to do this, this also introduces a new slot type,
      OffHeapObjectSlot. This is because CompressedObjectSlot assumes that
      the slot is on-heap, and that it can mask the slot location to
      recover the isolate root. OffHeapObjectSlot doesn't define an
      operator*, and instead provides a `load(const Isolate*)` method.
      The other slots also gain this method so that they can use it in
      slot-templated functions. Also, the RootVisitor gains an
      OffHeapObjectSlot overload, which is UNREACHABLE by default and only
      needs to be defined by visitors that can access the string table.
      
      As a drive-by, fix some non-atomic accesses to the off-heap string
      table, also using the new slot.
      
      Bug: chromium:1109553
      Bug: chromium:1115116
      Bug: chromium:1115559
      Bug: chromium:1115683
      Change-Id: I819ed7bf820e9ef98ad5d5f9d0d592efbb6f5aa6
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2352489
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69381}
      279bd3e1
  2. 22 Apr, 2020 1 commit
    • Dan Elphick's avatar
      [snapshot] Rename partial snapshot to context snapshot · 71bd50e1
      Dan Elphick authored
      The partial snapshot/serializer/deserializer are renamed to context *,
      while the partial snapshot cache is renamed to startup object cache in
      line with the read-only object cache (as this better reflects where it
      lives and what it does).
      
      To avoid a gap in the file history due to renaming both the files and
      identifiers simulataneously, this leaves all the partial-*.* files in
      place. They will be renamed in a follow-up CL.
      
      Bug: v8:10416
      Change-Id: I5ef41cad751aaa24b35ee2b3c72bd0295832f2c6
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2144115
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Auto-Submit: Dan Elphick <delphick@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67306}
      71bd50e1
  3. 06 Nov, 2019 1 commit
  4. 24 May, 2019 1 commit
  5. 09 May, 2019 1 commit
  6. 08 Mar, 2019 1 commit
  7. 06 Mar, 2019 1 commit
  8. 20 Dec, 2018 1 commit
  9. 17 Dec, 2018 1 commit
  10. 10 Dec, 2018 2 commits
  11. 07 Dec, 2018 1 commit
  12. 12 Nov, 2018 1 commit
  13. 24 Oct, 2018 1 commit
  14. 16 Oct, 2018 2 commits
    • Dan Elphick's avatar
      [snapshot] Create a ReadOnly snapshot · f602712f
      Dan Elphick authored
      In preparation for sharing RO_SPACE between all Isolates within a
      process, this first pulls RO_SPACE out of the Startup snapshot and puts
      it in its own ReadOnly snapshot.
      
      The snapshot is first populated with the read-only roots. After that the
      StartupSerializer serializes as before but starting from the first
      mutable root. References to objects in the ReadOnly snapshot that aren't
      themselves roots are added to a new cache called ReadOnlyObjectCache
      which functions like the PartialSnapshotCache but lives in the
      ReadOnlySerializer rather than the StartupSerializer. These cache
      entries are referenced using a new bytecode: ReadOnlyObjectCache. (To
      make room for this, the ApiReference bytecode has been moved).
      
      To reduce code duplication, the StartupSerializer has been refactored to
      create a new base class RootSerializer, which ReadOnlySerializer also
      subclasses. The base class is responsible primarily for keeping track of
      already serialized roots and visiting the roots.
      
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Change-Id: Iff26042886130ae22eccf2e11b35f6f226f4a792
      Bug: v8:8191
      Reviewed-on: https://chromium-review.googlesource.com/c/1244676
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56681}
      f602712f
    • Dan Elphick's avatar
      Clarify roots iteration · 08b8e0ff
      Dan Elphick authored
      Change Heap::IterateStrongRoots to never iterate the read-only roots. In
      doing so remove VISIT_ALL_BUT_READ_ONLY and
      VISIT_ONLY_STRONG_FOR_SERIALIZATION. All such uses should now use
      VISIT_ALL and VISIT_ONLY_STRONG. Where ReadOnlyRoots iteration is
      required, this adds ReadOnlyRoots(isolate)->Iterate() at the call site.
      
      Add new begin, end, strong_mutable_roots_begin and
      strong_mutable_roots_end methods to RootsTable and try and make the
      existing uses a little more consistent.
      
      Bug: v8:8191
      Change-Id: Ie9d0f9e5186db418428e2fafd38432b0bd879daa
      Reviewed-on: https://chromium-review.googlesource.com/c/1278500
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56672}
      08b8e0ff
  15. 19 Sep, 2018 2 commits
  16. 11 Sep, 2018 1 commit
  17. 30 Apr, 2018 1 commit
  18. 19 Mar, 2018 1 commit
    • jgruber's avatar
      Reland "[builtins] Remove off-heap builtins from the snapshot" · fd70917d
      jgruber authored
      This is a reland of f1b1ec70
      
      Original change's description:
      > [builtins] Remove off-heap builtins from the snapshot
      >
      > This CL is the final major step towards shipping off-heap-safe builtins
      > embedded into the binary.
      >
      > Prior to snapshot serialization, we now:
      > * create the embedded blob containing off-heap instruction streams,
      > * use that to generate embedded.cc (containing embedded binary data),
      > * replace off-heap-safe builtins with trampolines,
      > * and serialize those into the final snapshot.
      >
      > The new RelocInfo::OFF_HEAP_TARGET kind is used to fix up trampoline
      > targets on deserialization.
      >
      > Bug: v8:6666
      > Change-Id: Ib07aea9e3bd7ecdec42291c1388b3a7453ea96ce
      > Reviewed-on: https://chromium-review.googlesource.com/950775
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Reviewed-by: Yang Guo <yangguo@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#51960}
      
      TBR=yangguo@chromium.org,mstarzinger@chromium.org
      
      Cq-Include-Trybots: luci.v8.try:v8_mac64_dbg,v8_mac64_rel
      Bug: v8:6666
      Change-Id: Id9954af3c8195754ff3658c4603858904fcf88c4
      Reviewed-on: https://chromium-review.googlesource.com/964481
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52006}
      fd70917d
  19. 15 Mar, 2018 2 commits
  20. 05 Mar, 2018 3 commits
  21. 19 Feb, 2018 1 commit
  22. 14 Feb, 2018 1 commit
  23. 26 Oct, 2017 2 commits
  24. 13 Oct, 2017 1 commit
  25. 28 Aug, 2017 1 commit
  26. 19 Jul, 2017 1 commit
    • Ulan Degenbaev's avatar
      [heap] Instrument mark-compact to track retaining paths for debugging. · 40c34606
      Ulan Degenbaev authored
      This patch adds a new intrinsic: %DebugTrackRetainingPath(object).
      Calling the intrinsic in JS code saves a weak reference to the given
      object in GC internal table of tracked objects.
      
      Each subsequent full GC prints to stdout the retaining path for each
      tracked object (if it is still alive). The retaining path is the real
      path that the marker took from the root set to the tracked object.
      
      This is useful for investigating of memory leaks:
      1) Add %DebugTrackRetainingPath(leaking_object) in JS code.
      For example:
        function foo() {
          let x = { bar: "bar"};
          %DebugTrackRetainingPath(x);
          return () => { return x; }
        }
      
        let closure = foo();
        gc();
      
      2) Run d8 with --allow-natives-syntax --track-retaining-path --expose-gc.
      
      3) Check the retaining path in stdout.
      
      For more detailed inspection, run d8 in gdb and set breakpoint in
      
      v8: :internal::Heap::PrintRetainingPath.
      Change-Id: I01a0faac1e009bc6c321fa75613900b49d2b036f
      Reviewed-on: https://chromium-review.googlesource.com/575972
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#46766}
      40c34606
  27. 25 Apr, 2017 2 commits
    • ulan's avatar
      Add a host parameter to ObjectVisitor methods. · c59f78f6
      ulan authored
      This makes an ObjectVisitor as powerful as a StaticVisitor and allows
      slots recording in ObjectVisitor.
      
      This patch also renames VisitCell method of ObjectVisitor to
      VisitCellPointer, so that VisitCell is free to be used for actually
      visiting a cell.
      
      BUG=chromium:709075
      
      Review-Url: https://codereview.chromium.org/2810653002
      Cr-Commit-Position: refs/heads/master@{#44860}
      c59f78f6
    • ulan's avatar
      Decouple root visitors from object visitors. · e671ed36
      ulan authored
      This patch adds a new interface called RootVisitor and changes the root
      iteration functions to accept a RootVisitor instead of an ObjectVisitor.
      
      Future CLs will change ObjectVisitor to provide the host object to all
      visiting functions, which will bring it in sync with static visitors.
      
      Having separate visitors for roots and objects removes ambiguity in
      VisitPointers and reduces chances of forgetting to record slots.
      
      This is intended as pure refactoring. All places that require behavior
      change are marked with TODO and will addressed in future CLs.
      
      BUG=chromium:709075
      
      Review-Url: https://codereview.chromium.org/2801073006
      Cr-Commit-Position: refs/heads/master@{#44852}
      e671ed36