@@ -1206,7 +1206,8 @@ class V8_NODISCARD BytecodeGenerator::OptionalChainNullLabelScope final {
1206
1206
public:
1207
1207
explicit OptionalChainNullLabelScope (BytecodeGenerator* bytecode_generator)
1208
1208
: bytecode_generator_(bytecode_generator),
1209
- labels_(bytecode_generator->zone ()) {
1209
+ labels_(bytecode_generator->zone ()),
1210
+ hole_check_scope_(bytecode_generator) {
1210
1211
prev_ = bytecode_generator_->optional_chaining_null_labels_ ;
1211
1212
bytecode_generator_->optional_chaining_null_labels_ = &labels_;
1212
1213
}
@@ -1221,6 +1222,9 @@ class V8_NODISCARD BytecodeGenerator::OptionalChainNullLabelScope final {
1221
1222
BytecodeGenerator* bytecode_generator_;
1222
1223
BytecodeLabels labels_;
1223
1224
BytecodeLabels* prev_;
1225
+ // Use the same scope for the entire optional chain, as links earlier in the
1226
+ // chain dominate later links, linearly.
1227
+ HoleCheckElisionScope hole_check_scope_;
1224
1228
};
1225
1229
1226
1230
// LoopScope delimits the scope of {loop}, from its header to its final jump.
@@ -6338,9 +6342,6 @@ template <typename ExpressionFunc>
6338
6342
void BytecodeGenerator::BuildOptionalChain (ExpressionFunc expression_func) {
6339
6343
BytecodeLabel done;
6340
6344
OptionalChainNullLabelScope label_scope (this );
6341
- // Use the same scope for the entire optional chain, as links earlier in the
6342
- // chain dominate later links, linearly.
6343
- HoleCheckElisionScope elider (this );
6344
6345
expression_func ();
6345
6346
builder ()->Jump (&done);
6346
6347
label_scope.labels ()->Bind (builder ());
0 commit comments