[runtime] always sort transition arrays during rehashing [v8/v8 : main]

0 views
Skip to first unread message

Joyee Cheung (Gerrit)

unread,
Apr 2, 2026, 8:35:58 AM (4 days ago) Apr 2
to Igor Sheludko, Michaël Zasso, V8 LUCI CQ, v8-re...@googlegroups.com
Attention needed from Igor Sheludko

Joyee Cheung added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Joyee Cheung . resolved

PTAL, thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
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: Ia813d1fb9d23e08012811d672052d235c0e0bf4d
Gerrit-Change-Number: 7723678
Gerrit-PatchSet: 1
Gerrit-Owner: Joyee Cheung <jo...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Joyee Cheung <jo...@igalia.com>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Comment-Date: Thu, 02 Apr 2026 12:35:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Joyee Cheung (Gerrit)

unread,
Apr 2, 2026, 8:52:51 AM (4 days ago) Apr 2
to Igor Sheludko, Michaël Zasso, V8 LUCI CQ, v8-re...@googlegroups.com
Attention needed from Igor Sheludko

Joyee Cheung added 1 comment

Patchset-level comments
Joyee Cheung . resolved

PTAL, thanks!

Joyee Cheung

By the way I am not sure if we should also remove the sorts added by https://chromium-review.googlesource.com/c/v8/v8/+/7252791 - the root cause for the bug that's being reproduced in the test here seems to be that the `if (entry->hash() > hash)` branch in `LinearSearchName` also implicitly assume hash-sorted order, while the previous bug was about binary search (which explicitly assumes this). Rehashing is a common way to break the assumption, I don't know if the hash-sorted order is always maintained otherwise or if there's another way to break it.

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
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: Ia813d1fb9d23e08012811d672052d235c0e0bf4d
Gerrit-Change-Number: 7723678
Gerrit-PatchSet: 1
Gerrit-Owner: Joyee Cheung <jo...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Joyee Cheung <jo...@igalia.com>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Comment-Date: Thu, 02 Apr 2026 12:52:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Joyee Cheung <jo...@igalia.com>
unsatisfied_requirement
open
diffy

Joyee Cheung (Gerrit)

unread,
Apr 2, 2026, 8:59:24 AM (4 days ago) Apr 2
to Igor Sheludko, Michaël Zasso, V8 LUCI CQ, v8-re...@googlegroups.com
Attention needed from Igor Sheludko

Joyee Cheung added 1 comment

Patchset-level comments
Joyee Cheung . resolved

PTAL, thanks!

Joyee Cheung

By the way I am not sure if we should also remove the sorts added by https://chromium-review.googlesource.com/c/v8/v8/+/7252791 - the root cause for the bug that's being reproduced in the test here seems to be that the `if (entry->hash() > hash)` branch in `LinearSearchName` also implicitly assume hash-sorted order, while the previous bug was about binary search (which explicitly assumes this). Rehashing is a common way to break the assumption, I don't know if the hash-sorted order is always maintained otherwise or if there's another way to break it.

Joyee Cheung

Another alternative might be to fix `LinearSearchName` to no longer implicitly assume the hash-sorted order, and always append it to the end, though I feel for unblocking the V8 upgrade in Node.js that changing he insertion order the blast radius might be bigger than necessary, so maybe that could be left as a follow-up?

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
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: Ia813d1fb9d23e08012811d672052d235c0e0bf4d
Gerrit-Change-Number: 7723678
Gerrit-PatchSet: 1
Gerrit-Owner: Joyee Cheung <jo...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Joyee Cheung <jo...@igalia.com>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Comment-Date: Thu, 02 Apr 2026 12:59:20 +0000
unsatisfied_requirement
open
diffy

Igor Sheludko (Gerrit)

unread,
Apr 2, 2026, 11:36:36 AM (4 days ago) Apr 2
to Joyee Cheung, Michaël Zasso, V8 LUCI CQ, v8-re...@googlegroups.com
Attention needed from Joyee Cheung

Igor Sheludko voted and added 2 comments

Votes added by Igor Sheludko

Code-Review+1

2 comments

Patchset-level comments
Joyee Cheung . resolved

PTAL, thanks!

Joyee Cheung

By the way I am not sure if we should also remove the sorts added by https://chromium-review.googlesource.com/c/v8/v8/+/7252791 - the root cause for the bug that's being reproduced in the test here seems to be that the `if (entry->hash() > hash)` branch in `LinearSearchName` also implicitly assume hash-sorted order, while the previous bug was about binary search (which explicitly assumes this). Rehashing is a common way to break the assumption, I don't know if the hash-sorted order is always maintained otherwise or if there's another way to break it.

Joyee Cheung

Another alternative might be to fix `LinearSearchName` to no longer implicitly assume the hash-sorted order, and always append it to the end, though I feel for unblocking the V8 upgrade in Node.js that changing he insertion order the blast radius might be bigger than necessary, so maybe that could be left as a follow-up?

Igor Sheludko

I agree, fixing `TA::LinearSearchName` is the right way to go. Let's land this as a quick fix and cleanup in a follow-up. Luckily we now we have tests for these cases ))

Igor Sheludko . resolved

lgtm, thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Joyee Cheung
Submit Requirements:
  • requirement 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: Ia813d1fb9d23e08012811d672052d235c0e0bf4d
Gerrit-Change-Number: 7723678
Gerrit-PatchSet: 1
Gerrit-Owner: Joyee Cheung <jo...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Joyee Cheung <jo...@igalia.com>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Attention: Joyee Cheung <jo...@igalia.com>
Gerrit-Comment-Date: Thu, 02 Apr 2026 15:36:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Joyee Cheung <jo...@igalia.com>
satisfied_requirement
open
diffy

Joyee Cheung (Gerrit)

unread,
Apr 2, 2026, 12:57:55 PM (4 days ago) Apr 2
to Igor Sheludko, Michaël Zasso, V8 LUCI CQ, v8-re...@googlegroups.com

Joyee Cheung voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement 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: Ia813d1fb9d23e08012811d672052d235c0e0bf4d
Gerrit-Change-Number: 7723678
Gerrit-PatchSet: 1
Gerrit-Owner: Joyee Cheung <jo...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Joyee Cheung <jo...@igalia.com>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Comment-Date: Thu, 02 Apr 2026 16:57:50 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

V8 LUCI CQ (Gerrit)

unread,
Apr 2, 2026, 1:00:44 PM (4 days ago) Apr 2
to Joyee Cheung, Igor Sheludko, Michaël Zasso, v8-re...@googlegroups.com

V8 LUCI CQ submitted the change

Change information

Commit message:
[runtime] always sort transition arrays during rehashing

After rehashing, the arrays are no longer in hash-sorted order.
In this case, we need to force a re-sort even for small arrays,
so that subsequent linear searches can find the correct transition
and avoid inserting duplicates.
Change-Id: Ia813d1fb9d23e08012811d672052d235c0e0bf4d
Commit-Queue: Joyee Cheung <jo...@igalia.com>
Reviewed-by: Igor Sheludko <ish...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#106255}
Files:
  • M src/objects/objects.cc
  • M src/objects/transitions.cc
  • M src/objects/transitions.h
  • M test/cctest/test-transitions.cc
Change size: M
Delta: 4 files changed, 119 insertions(+), 5 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Igor Sheludko
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ia813d1fb9d23e08012811d672052d235c0e0bf4d
Gerrit-Change-Number: 7723678
Gerrit-PatchSet: 2
Gerrit-Owner: Joyee Cheung <jo...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Joyee Cheung <jo...@igalia.com>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
open
diffy
satisfied_requirement

Joyee Cheung (Gerrit)

unread,
Apr 2, 2026, 1:01:57 PM (4 days ago) Apr 2
to V8 LUCI CQ, Igor Sheludko, Michaël Zasso, v8-re...@googlegroups.com

Joyee Cheung added 1 comment

Patchset-level comments
Igor Sheludko . resolved

lgtm, thanks!

Joyee Cheung

Thanks for the review, I'll work on a follow up and test it with Node.js's debug build, it seems the debug mode tests in Node.js tend to uncover edge cases for this.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement 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: Ia813d1fb9d23e08012811d672052d235c0e0bf4d
Gerrit-Change-Number: 7723678
Gerrit-PatchSet: 2
Gerrit-Owner: Joyee Cheung <jo...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Joyee Cheung <jo...@igalia.com>
Gerrit-CC: Michaël Zasso <mic.b...@gmail.com>
Gerrit-Comment-Date: Thu, 02 Apr 2026 17:01:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Igor Sheludko <ish...@chromium.org>
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages