[test] Make bytecode expectation tests read golden snippets [v8/v8 : main]

0 views
Skip to first unread message

Leszek Swirski (Gerrit)

unread,
Sep 3, 2025, 1:57:42 PM (4 days ago) Sep 3
to Patrick Thier, V8 LUCI CQ, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Patrick Thier

Leszek Swirski voted and added 1 comment

Votes added by Leszek Swirski

Auto-Submit+1

1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Leszek Swirski . resolved

PTAL -- in a followup I'll try to make these tests register dynamically based on the golden files present.

Open in Gerrit

Related details

Attention is currently required from:
  • Patrick Thier
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
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: I6d82073233cf6abe268bf9137a862d215e4e27a0
Gerrit-Change-Number: 6912523
Gerrit-PatchSet: 2
Gerrit-Owner: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Patrick Thier <pth...@chromium.org>
Gerrit-Attention: Patrick Thier <pth...@chromium.org>
Gerrit-Comment-Date: Wed, 03 Sep 2025 17:57:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Patrick Thier (Gerrit)

unread,
Sep 4, 2025, 4:13:47 AM (3 days ago) Sep 4
to Leszek Swirski, V8 LUCI CQ, v8-re...@googlegroups.com, victorgo...@chromium.org
Attention needed from Leszek Swirski

Patrick Thier voted and added 5 comments

Votes added by Patrick Thier

Code-Review+1

5 comments

Patchset-level comments
Patrick Thier . resolved

LGTM

File test/unittests/interpreter/bytecode-expectations-parser.cc
Line 37, Patchset 2 (Latest): // If it was not an escape sequence, emit the previous backslash
Patrick Thier . unresolved
```suggestion
// If it was not an escape sequence, emit the previous backslash.
```
Line 49, Patchset 2 (Latest): }
Patrick Thier . unresolved

What if the last character was a backslash? Please either handle that case or add a DCHECK ensuring that doesn't happen.

Line 59, Patchset 2 (Latest): // Skip to the beginning of the options header
Patrick Thier . unresolved
```suggestion
// Skip to the beginning of the options header.
```
Line 104, Patchset 2 (Latest): CHECK_GE(line.size(), 2u); // We should have the indent
Patrick Thier . unresolved
```suggestion
CHECK_GE(line.size(), 2u); // We should have the indent.
```
Open in Gerrit

Related details

Attention is currently required from:
  • Leszek Swirski
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I6d82073233cf6abe268bf9137a862d215e4e27a0
Gerrit-Change-Number: 6912523
Gerrit-PatchSet: 2
Gerrit-Owner: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Patrick Thier <pth...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Thu, 04 Sep 2025 08:13:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Leszek Swirski (Gerrit)

unread,
Sep 4, 2025, 5:44:42 AM (3 days ago) Sep 4
to Patrick Thier, V8 LUCI CQ, v8-re...@googlegroups.com, victorgo...@chromium.org

Leszek Swirski voted and added 5 comments

Votes added by Leszek Swirski

Commit-Queue+2

5 comments

Patchset-level comments
Leszek Swirski . resolved

Thanks

File test/unittests/interpreter/bytecode-expectations-parser.cc
Line 37, Patchset 2 (Latest): // If it was not an escape sequence, emit the previous backslash
Patrick Thier . resolved
```suggestion
// If it was not an escape sequence, emit the previous backslash.
```
Leszek Swirski

Done

Patrick Thier . resolved

What if the last character was a backslash? Please either handle that case or add a DCHECK ensuring that doesn't happen.

Leszek Swirski

Good call, added handling (emitting the backslash as-is, same as for "not an escape sequence" above).

Line 59, Patchset 2 (Latest): // Skip to the beginning of the options header
Patrick Thier . resolved
```suggestion
// Skip to the beginning of the options header.
```
Leszek Swirski

Done

Line 104, Patchset 2 (Latest): CHECK_GE(line.size(), 2u); // We should have the indent
Patrick Thier . resolved
```suggestion
CHECK_GE(line.size(), 2u); // We should have the indent.
```
Leszek Swirski

Done

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
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: I6d82073233cf6abe268bf9137a862d215e4e27a0
Gerrit-Change-Number: 6912523
Gerrit-PatchSet: 2
Gerrit-Owner: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Patrick Thier <pth...@chromium.org>
Gerrit-Comment-Date: Thu, 04 Sep 2025 09:44:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Patrick Thier <pth...@chromium.org>
satisfied_requirement
open
diffy

V8 LUCI CQ (Gerrit)

unread,
Sep 4, 2025, 5:47:00 AM (3 days ago) Sep 4
to Leszek Swirski, Patrick Thier, v8-re...@googlegroups.com, victorgo...@chromium.org

V8 LUCI CQ submitted the change

Change information

Commit message:
[test] Make bytecode expectation tests read golden snippets

Make the golden file snippets the source of truth for bytecode
expectations tests, to remove the duplicated snippets between the
bytecode-generator-unittest and the golden files. This should make it
simpler to add new expectation tests, by adding a snippet to a golden
file and rebaselining. It also unifies the handling of the header
options, like wrapping and flags.

The expectations parsing logic is extracted to a new
`BytecodeExpectationsParser`, which is used by both the test and the
expectations generator.
Change-Id: I6d82073233cf6abe268bf9137a862d215e4e27a0
Commit-Queue: Leszek Swirski <les...@chromium.org>
Auto-Submit: Leszek Swirski <les...@chromium.org>
Reviewed-by: Patrick Thier <pth...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#102236}
Files:
  • M test/unittests/BUILD.gn
  • A test/unittests/interpreter/bytecode-expectations-parser.cc
  • A test/unittests/interpreter/bytecode-expectations-parser.h
  • M test/unittests/interpreter/bytecode-expectations-printer.cc
  • M test/unittests/interpreter/bytecode-expectations-printer.h
  • M test/unittests/interpreter/bytecode-generator-unittest.cc
  • M test/unittests/interpreter/bytecode_expectations/PropertyStores.golden
  • M test/unittests/interpreter/generate-bytecode-expectations.cc
Change size: XL
Delta: 8 files changed, 1482 insertions(+), 3983 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Patrick Thier
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: I6d82073233cf6abe268bf9137a862d215e4e27a0
Gerrit-Change-Number: 6912523
Gerrit-PatchSet: 3
Gerrit-Owner: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Patrick Thier <pth...@chromium.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages