Skip to content

Locate the code cache's source hash by V8 version in code-cache-test - #8691

Merged
erikcorry merged 2 commits into
mainfrom
ecorry/code-cache-test-v8-15.9
Nov 19, 2026
Merged

erikcorry merged 2 commits into
mainfrom
ecorry/code-cache-test-v8-15.9

Conversation

@erikcorry

Copy link
Copy Markdown
Contributor

V8 15.9 moved the payload and trusted payload lengths of SerializedData's header ahead of the per-subclass entries, so SerializedCodeData's source hash follows four 32-bit words rather than two. The test that corrupts the flags hash computed its offset from the source hash's, so against 15.9 it corrupted the source hash instead.

Choose the offset by V8 version, so that one workerd builds against both 15.8 and 15.9 and edgeworker's V8 roll, or its revert, needs no workerd change.

V8 15.9 moved the payload and trusted payload lengths of
SerializedData's header ahead of the per-subclass entries, so
SerializedCodeData's source hash follows four 32-bit words rather
than two. The test that corrupts the flags hash computed its offset
from the source hash's, so against 15.9 it corrupted the source hash
instead.

Choose the offset by V8 version, so that one workerd builds against
both 15.8 and 15.9 and edgeworker's V8 roll, or its revert, needs no
workerd change.
@erikcorry
erikcorry requested review from a team as code owners November 19, 2026 20:29

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by the review of 1eb5586d.

This review, of e4d96128

💬 Approved with comments — A small, correct test-only change; the only comment is an optional suggestion to make the V8 version check exact.

Findings: 1 suggestion (1 is an inline comment on the diff)

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


📋 Code Quality: 💬 1 suggestion

One optional suggestion to make the V8 version check exact.

Recommendation: 💬 Optional Nits

  • [SUGGESTION] Version check V8_MAJOR_VERSION > 15 || V8_MINOR_VERSION >= 9 would also match a V8 older than 15 whose minor number is 9 or higher (for example 14.9). (src/workerd/jsg/code-cache-test.c++:51)
View full review

The change picks the right header layout for V8 15.8 and 15.9. The comments now sit next to the constants they describe and state the current layout for each version. One optional suggestion: the #if condition is also true for a V8 older than 15 whose minor number is 9 or higher.


✅ All other checks passed

📝 Documentation: ✅ LGTM

The comments describe the header layout for each V8 version accurately.


Reviewed commit: e4d96128

Comment thread src/workerd/jsg/code-cache-test.c++ Resolved

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved — A small, correct test-only change. The earlier suggestion about the V8 version check is fixed, and there are no other findings.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

📋 Code Quality: ✅ LGTM

The condition is now V8_MAJOR_VERSION > 15 || (V8_MAJOR_VERSION == 15 && V8_MINOR_VERSION >= 9), so a V8 older than 15 with a minor number of 9 or higher no longer matches it. The explicit #include <v8-version.h> is correct, and each layout comment sits next to the offset constant it describes.


📝 Documentation: ✅ LGTM

The comments describe the header layout for each V8 version accurately.


Reviewed commit: 1eb5586d

@erikcorry
erikcorry merged commit f6001a9 into main Nov 19, 2026
23 checks passed
@erikcorry
erikcorry deleted the ecorry/code-cache-test-v8-15.9 branch November 19, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants