[heap] Cleanup descriptor array trimming flags [v8/v8 : main]

0 views
Skip to first unread message

Omer Katz (Gerrit)

unread,
Jun 30, 2026, 5:55:04 AM (yesterday) Jun 30
to v8-s...@luci-project-accounts.iam.gserviceaccount.com, android-bu...@system.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com

Omer Katz removed a vote from this change

Removed Commit-Queue+1 by Omer Katz <omer...@chromium.org>
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: deleteVote
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icfbbdbdf8c95ec6757ad766e39efb828fd113361
Gerrit-Change-Number: 7995075
Gerrit-PatchSet: 4
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
unsatisfied_requirement
open
diffy

Omer Katz (Gerrit)

unread,
5:03 AM (19 hours ago) 5:03 AM
to Dominik Inführ, Michael Lippautz, v8-s...@luci-project-accounts.iam.gserviceaccount.com, android-bu...@system.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ and Michael Lippautz

Omer Katz added 1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
  • Michael Lippautz
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icfbbdbdf8c95ec6757ad766e39efb828fd113361
Gerrit-Change-Number: 7995075
Gerrit-PatchSet: 6
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Comment-Date: Wed, 01 Jul 2026 09:03:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Omer Katz (Gerrit)

unread,
5:05 AM (19 hours ago) 5:05 AM
to Dominik Inführ, Michael Lippautz, v8-s...@luci-project-accounts.iam.gserviceaccount.com, android-bu...@system.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ and Michael Lippautz

Omer Katz added 1 comment

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Omer Katz . resolved

First M152 canary is already out. I think it should be safe to land this clean up now.

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
  • Michael Lippautz
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icfbbdbdf8c95ec6757ad766e39efb828fd113361
Gerrit-Change-Number: 7995075
Gerrit-PatchSet: 8
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Comment-Date: Wed, 01 Jul 2026 09:05:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Omer Katz (Gerrit)

unread,
5:23 AM (18 hours ago) 5:23 AM
to Dominik Inführ, Michael Lippautz, v8-s...@luci-project-accounts.iam.gserviceaccount.com, android-bu...@system.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ and Michael Lippautz

Omer Katz added 1 comment

Patchset-level comments
Omer Katz . resolved

I'll split the StrongDescriptorArray stuff to a separate CL and will resend later.

Gerrit-Comment-Date: Wed, 01 Jul 2026 09:23:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Michael Lippautz (Gerrit)

unread,
5:39 AM (18 hours ago) 5:39 AM
to Omer Katz, Dominik Inführ, v8-s...@luci-project-accounts.iam.gserviceaccount.com, android-bu...@system.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
Attention needed from Omer Katz

Michael Lippautz added 1 comment

Patchset-level comments
Michael Lippautz . resolved

As discussed offline: Would be nice if we could land this in smaller chunks :)

Open in Gerrit

Related details

Attention is currently required from:
  • Omer Katz
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icfbbdbdf8c95ec6757ad766e39efb828fd113361
Gerrit-Change-Number: 7995075
Gerrit-PatchSet: 8
Gerrit-Owner: Omer Katz <omer...@chromium.org>
Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-Attention: Omer Katz <omer...@chromium.org>
Gerrit-Comment-Date: Wed, 01 Jul 2026 09:39:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Omer Katz (Gerrit)

unread,
9:06 AM (15 hours ago) 9:06 AM
to Dominik Inführ, Michael Lippautz, v8-s...@luci-project-accounts.iam.gserviceaccount.com, android-bu...@system.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ and Michael Lippautz

Omer Katz added 1 comment

Patchset-level comments
File-level comment, Patchset 10 (Latest):
Omer Katz . resolved

ptal.

I moved the StrongDescriptorArray cleanup to a followup CL.
I tried to split this CL even further, but I think it makes more sense to keep as is.

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
  • Michael Lippautz
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Icfbbdbdf8c95ec6757ad766e39efb828fd113361
Gerrit-Change-Number: 7995075
Gerrit-PatchSet: 10
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
Gerrit-Comment-Date: Wed, 01 Jul 2026 13:06:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Michael Lippautz (Gerrit)

unread,
9:38 AM (14 hours ago) 9:38 AM
to Omer Katz, Dominik Inführ, v8-s...@luci-project-accounts.iam.gserviceaccount.com, android-bu...@system.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
Attention needed from Dominik Inführ and Omer Katz

Michael Lippautz added 2 comments

File src/objects/map-inl.h
Line 970, Patchset 10 (Latest): WriteBarrier::ForDescriptorArray(descriptors);
Michael Lippautz . unresolved

Isn't this wrong? It tries to mark the descriptor array which won't work if this happens repeatedly?

In the spirit of a regular write barrier we should just have a write barrier for the individual slot here: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/descriptor-array-inl.h;l=297;drc=a81bc8561d938a2cfa58705d6d7c1121a2dd0f78?q=DescriptorArray::append&ss=chromium

?

File src/objects/map.cc
Line 746, Patchset 10 (Latest): WriteBarrier::ForDescriptorArray(to_replace);
Michael Lippautz . unresolved

I don't understand why this is necessary. I guess it's fine to keep for now but I don't see why we need to keep `to_replace` alive here.

Open in Gerrit

Related details

Attention is currently required from:
  • Dominik Inführ
  • Omer Katz
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Icfbbdbdf8c95ec6757ad766e39efb828fd113361
    Gerrit-Change-Number: 7995075
    Gerrit-PatchSet: 10
    Gerrit-Owner: Omer Katz <omer...@chromium.org>
    Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
    Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
    Gerrit-CC: Hannes Payer <hpa...@chromium.org>
    Gerrit-Attention: Omer Katz <omer...@chromium.org>
    Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
    Gerrit-Comment-Date: Wed, 01 Jul 2026 13:38:53 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Omer Katz (Gerrit)

    unread,
    10:40 AM (13 hours ago) 10:40 AM
    to Dominik Inführ, Michael Lippautz, v8-s...@luci-project-accounts.iam.gserviceaccount.com, android-bu...@system.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
    Attention needed from Dominik Inführ and Michael Lippautz

    Omer Katz added 2 comments

    File src/objects/map-inl.h
    Line 970, Patchset 10: WriteBarrier::ForDescriptorArray(descriptors);
    Michael Lippautz . resolved

    Isn't this wrong? It tries to mark the descriptor array which won't work if this happens repeatedly?

    In the spirit of a regular write barrier we should just have a write barrier for the individual slot here: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/descriptor-array-inl.h;l=297;drc=a81bc8561d938a2cfa58705d6d7c1121a2dd0f78?q=DescriptorArray::append&ss=chromium

    ?

    Omer Katz

    I looked into it. It's not wrong just leftover from a bygone era and now redundant. We already get write barrier for the newly appended descriptor in `DescriptorArray::Set` (I was surprised actually that `Relaxed_Store` includes a barrier for each write). This write barrier most likely was historically needed for making sure the whole array is marked when we append a new descriptor to the end. In an older version of V8, without the write barrier, you would try to trim the array and lost the newly appended descriptor. That's no longer the case.
    I removed it.

    File src/objects/map.cc
    Line 746, Patchset 10: WriteBarrier::ForDescriptorArray(to_replace);
    Michael Lippautz . resolved

    I don't understand why this is necessary. I guess it's fine to keep for now but I don't see why we need to keep `to_replace` alive here.

    Omer Katz

    I think the comment above explains why it was necessary. Specifically, "The old descriptors will not be trimmed in the mark-compactor, we need to mark all its elements", e.g. in case to_replace was already marked.
    Since we now always mark all elements, this write barrier should not be needed anymore.
    I removed it.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dominik Inführ
    • Michael Lippautz
    Submit Requirements:
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: v8/v8
      Gerrit-Branch: main
      Gerrit-Change-Id: Icfbbdbdf8c95ec6757ad766e39efb828fd113361
      Gerrit-Change-Number: 7995075
      Gerrit-PatchSet: 11
      Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
      Gerrit-Attention: Dominik Inführ <dinf...@chromium.org>
      Gerrit-Comment-Date: Wed, 01 Jul 2026 14:40:06 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Michael Lippautz <mlip...@chromium.org>
      unsatisfied_requirement
      open
      diffy

      Dominik Inführ (Gerrit)

      unread,
      11:24 AM (12 hours ago) 11:24 AM
      to Omer Katz, Michael Lippautz, v8-s...@luci-project-accounts.iam.gserviceaccount.com, android-bu...@system.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
      Attention needed from Michael Lippautz and Omer Katz

      Dominik Inführ added 5 comments

      Patchset-level comments
      File-level comment, Patchset 13 (Latest):
      Dominik Inführ . resolved

      Cool, thanks a lot! LGTM

      File src/heap/heap-write-barrier.h
      Line 100, Patchset 10: static inline void ForDescriptorArray(Tagged<DescriptorArray>);
      Dominik Inführ . unresolved

      Do we still need this? It feels like the remaining uses aren't necessary but I could easily miss something.

      File src/heap/mark-compact.cc
      Line 4122, Patchset 10:void MarkCompactCollector::WeakenStrongDescriptorArrays() {
      Dominik Inführ . unresolved

      Do we still need strong descriptor arrays? Strictly speaking we shouldn't be in the deserializer when we trim DescriptorArrays because we don't trim with a stack. It's a bit indirect though but this is similar to what we do for strings. I guess could e.g. CHECK that none of the LocalHeaps is in the deserializer to make sure this holds. If so, not for this CL obviously.

      File src/heap/marking-barrier.cc
      Line 147, Patchset 10: MarkValueLocal(descriptor_array);
      Dominik Inführ . unresolved

      <3

      File src/objects/map.cc
      Line 2540, Patchset 13 (Latest): WriteBarrier::ForDescriptorArray(descriptors);
      Dominik Inführ . unresolved

      This barrier here shouldn't be necessary, right? The set_instance_descriptors above should mark it.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Michael Lippautz
      • Omer Katz
      Submit Requirements:
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: v8/v8
        Gerrit-Branch: main
        Gerrit-Change-Id: Icfbbdbdf8c95ec6757ad766e39efb828fd113361
        Gerrit-Change-Number: 7995075
        Gerrit-PatchSet: 13
        Gerrit-Attention: Omer Katz <omer...@chromium.org>
        Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
        Gerrit-Comment-Date: Wed, 01 Jul 2026 15:23:59 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        unsatisfied_requirement
        open
        diffy

        Dominik Inführ (Gerrit)

        unread,
        11:24 AM (12 hours ago) 11:24 AM
        to Omer Katz, Michael Lippautz, v8-s...@luci-project-accounts.iam.gserviceaccount.com, android-bu...@system.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
        Attention needed from Michael Lippautz and Omer Katz

        Dominik Inführ voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Michael Lippautz
        • Omer Katz
        Submit Requirements:
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: v8/v8
          Gerrit-Branch: main
          Gerrit-Change-Id: Icfbbdbdf8c95ec6757ad766e39efb828fd113361
          Gerrit-Change-Number: 7995075
          Gerrit-PatchSet: 13
          Gerrit-Owner: Omer Katz <omer...@chromium.org>
          Gerrit-Reviewer: Dominik Inführ <dinf...@chromium.org>
          Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
          Gerrit-Reviewer: Omer Katz <omer...@chromium.org>
          Gerrit-CC: Hannes Payer <hpa...@chromium.org>
          Gerrit-Attention: Omer Katz <omer...@chromium.org>
          Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
          Gerrit-Comment-Date: Wed, 01 Jul 2026 15:24:14 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Omer Katz (Gerrit)

          unread,
          11:38 AM (12 hours ago) 11:38 AM
          to Dominik Inführ, Michael Lippautz, v8-s...@luci-project-accounts.iam.gserviceaccount.com, android-bu...@system.gserviceaccount.com, Hannes Payer, jgrube...@chromium.org, mlippau...@chromium.org, v8-flag...@chromium.org, v8-re...@googlegroups.com
          Attention needed from Michael Lippautz

          Omer Katz added 4 comments

          File src/heap/heap-write-barrier.h
          Line 100, Patchset 10: static inline void ForDescriptorArray(Tagged<DescriptorArray>);
          Dominik Inführ . resolved

          Do we still need this? It feels like the remaining uses aren't necessary but I could easily miss something.

          Omer Katz

          Great catch! I believe we no longer need any of the DescriptorArray specific barriers and we can remove all of them 😊

          File src/heap/mark-compact.cc
          Line 4122, Patchset 10:void MarkCompactCollector::WeakenStrongDescriptorArrays() {
          Dominik Inführ . resolved

          Do we still need strong descriptor arrays? Strictly speaking we shouldn't be in the deserializer when we trim DescriptorArrays because we don't trim with a stack. It's a bit indirect though but this is similar to what we do for strings. I guess could e.g. CHECK that none of the LocalHeaps is in the deserializer to make sure this holds. If so, not for this CL obviously.

          Omer Katz

          We don't. The follow up CLs removes that type. That's what Michael was asking earlier to split to a new CL.

          File src/heap/marking-barrier.cc
          Line 147, Patchset 10: MarkValueLocal(descriptor_array);
          Dominik Inführ . resolved

          <3

          Omer Katz

          Acknowledged

          File src/objects/map.cc
          Line 2540, Patchset 13: WriteBarrier::ForDescriptorArray(descriptors);
          Dominik Inführ . resolved

          This barrier here shouldn't be necessary, right? The set_instance_descriptors above should mark it.

          Omer Katz

          No, this one is not needed anymore. The write barrier is covered now by `set_instance_descriptors`.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Michael Lippautz
          Submit Requirements:
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: v8/v8
            Gerrit-Branch: main
            Gerrit-Change-Id: Icfbbdbdf8c95ec6757ad766e39efb828fd113361
            Gerrit-Change-Number: 7995075
            Gerrit-PatchSet: 14
            Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
            Gerrit-Comment-Date: Wed, 01 Jul 2026 15:38:15 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Dominik Inführ <dinf...@chromium.org>
            unsatisfied_requirement
            satisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages