Repository navigation
Locate the code cache's source hash by V8 version in code-cache-test - #8691
Conversation
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.
There was a problem hiding this comment.
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 >= 9would 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
There was a problem hiding this comment.
✅ 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
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.