Skip to content

Commit 22e9d96

Browse files
sroettgerV8 LUCI CQ
authored andcommitted
[interpreter] don't elide hole checks across optional chain
Bug: 427663123 Change-Id: Iefdb15828d807bf9452b88e918a4b46cc2d422fa Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6678591 Commit-Queue: Stephen Röttger <[email protected]> Reviewed-by: Toon Verwaest <[email protected]> Cr-Commit-Position: refs/heads/main@{#101050}
1 parent 47c9ee6 commit 22e9d96

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/interpreter/bytecode-generator.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,8 @@ class V8_NODISCARD BytecodeGenerator::OptionalChainNullLabelScope final {
12211221
public:
12221222
explicit OptionalChainNullLabelScope(BytecodeGenerator* bytecode_generator)
12231223
: bytecode_generator_(bytecode_generator),
1224-
labels_(bytecode_generator->zone()) {
1224+
labels_(bytecode_generator->zone()),
1225+
hole_check_scope_(bytecode_generator) {
12251226
prev_ = bytecode_generator_->optional_chaining_null_labels_;
12261227
bytecode_generator_->optional_chaining_null_labels_ = &labels_;
12271228
}
@@ -1236,6 +1237,9 @@ class V8_NODISCARD BytecodeGenerator::OptionalChainNullLabelScope final {
12361237
BytecodeGenerator* bytecode_generator_;
12371238
BytecodeLabels labels_;
12381239
BytecodeLabels* prev_;
1240+
// Use the same scope for the entire optional chain, as links earlier in the
1241+
// chain dominate later links, linearly.
1242+
HoleCheckElisionScope hole_check_scope_;
12391243
};
12401244

12411245
// LoopScope delimits the scope of {loop}, from its header to its final jump.
@@ -6483,9 +6487,6 @@ template <typename ExpressionFunc>
64836487
void BytecodeGenerator::BuildOptionalChain(ExpressionFunc expression_func) {
64846488
BytecodeLabel done;
64856489
OptionalChainNullLabelScope label_scope(this);
6486-
// Use the same scope for the entire optional chain, as links earlier in the
6487-
// chain dominate later links, linearly.
6488-
HoleCheckElisionScope elider(this);
64896490
expression_func();
64906491
builder()->Jump(&done);
64916492
label_scope.labels()->Bind(builder());

0 commit comments

Comments
 (0)