Skip to content

Commit 6e965c7

Browse files
thibaudmichaudguybedford
authored andcommitted
deps: V8: cherry-pick 7cb6188cf913
Original commit message: [wasm][exnref] Accept non-nullable exn catch type [email protected] Fixed: 373681572 Change-Id: Iecfc86d2ce6592a6f442bc3504ddde58ff236f64 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5938956 Commit-Queue: Thibaud Michaud <[email protected]> Reviewed-by: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/main@{#96637} Refs: v8/v8@7cb6188
1 parent 0374a22 commit 6e965c7

4 files changed

Lines changed: 16 additions & 7 deletions

File tree

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# Reset this number to 0 on major V8 upgrades.
4040
# Increment by one for each non-official patch applied to deps/v8.
41-
'v8_embedder_string': '-node.51',
41+
'v8_embedder_string': '-node.52',
4242

4343
##### V8 defaults for Node.js #####
4444

deps/v8/src/wasm/function-body-decoder-impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,7 @@ class WasmFullDecoder : public WasmDecoder<ValidationTag, decoding_mode> {
32803280
}
32813281
if (catch_case.kind == kCatchRef || catch_case.kind == kCatchAllRef) {
32823282
stack_.EnsureMoreCapacity(1, this->zone_);
3283-
Push(kWasmExnRef);
3283+
Push(ValueType::Ref(HeapType::kExn));
32843284
push_count += 1;
32853285
}
32863286
Control* target = control_at(catch_case.br_imm.depth);
@@ -3506,7 +3506,7 @@ class WasmFullDecoder : public WasmDecoder<ValidationTag, decoding_mode> {
35063506
}
35073507
if (catch_case.kind == kCatchRef || catch_case.kind == kCatchAllRef) {
35083508
stack_.EnsureMoreCapacity(1, this->zone_);
3509-
Push(kWasmExnRef);
3509+
Push(ValueType::Ref(HeapType::kExn));
35103510
push_count += 1;
35113511
}
35123512
base::Vector<Value> values(

deps/v8/src/wasm/graph-builder-interface.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ class WasmGraphBuildingInterface {
14061406

14071407
if (catch_case.kind == kCatchAll || catch_case.kind == kCatchAllRef) {
14081408
if (catch_case.kind == kCatchAllRef) {
1409-
DCHECK_EQ(values[0].type, kWasmExnRef);
1409+
DCHECK_EQ(values[0].type, ValueType::Ref(HeapType::kExn));
14101410
values[0].node = block->try_info->exception;
14111411
}
14121412
BrOrRet(decoder, catch_case.br_imm.depth);
@@ -1473,7 +1473,7 @@ class WasmGraphBuildingInterface {
14731473
}
14741474

14751475
if (catch_case.kind == kCatchRef) {
1476-
DCHECK_EQ(values.last().type, kWasmExnRef);
1476+
DCHECK_EQ(values.last().type, ValueType::Ref(HeapType::kExn));
14771477
values.last().node = block->try_info->exception;
14781478
}
14791479
BrOrRet(decoder, catch_case.br_imm.depth);

deps/v8/test/unittests/wasm/function-body-decoder-unittest.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,20 +2994,29 @@ TEST_F(FunctionBodyDecoderTest, TryTable) {
29942994
U32V_1(1), CatchKind::kCatchAllRef, U32V_1(0), kExprEnd,
29952995
kExprUnreachable, kExprEnd, kExprDrop},
29962996
kAppendEnd);
2997-
// // Duplicate catch-all.
2997+
// Duplicate catch-all.
29982998
ExpectValidates(
29992999
sigs.v_v(),
30003000
{kExprBlock, kExnRefCode, WASM_TRY_TABLE_OP, U32V_1(4),
30013001
CatchKind::kCatchAll, U32V_1(1), CatchKind::kCatchAll, U32V_1(1),
30023002
CatchKind::kCatchAllRef, U32V_1(0), CatchKind::kCatchAllRef, U32V_1(0),
30033003
kExprEnd, kExprUnreachable, kExprEnd, kExprDrop},
30043004
kAppendEnd);
3005-
// // Catch-all before catch.
3005+
// Catch-all before catch.
30063006
ExpectValidates(
30073007
sigs.v_v(),
30083008
{WASM_TRY_TABLE_OP, U32V_1(2), CatchKind::kCatchAll, U32V_1(0),
30093009
CatchKind::kCatch, ex, U32V_1(0), kExprEnd, kExprUnreachable},
30103010
kAppendEnd);
3011+
// Non-nullable exnref.
3012+
ValueType kNonNullableExnRef = ValueType::Ref(HeapType::kExn);
3013+
auto sig = FixedSizeSignature<ValueType>::Returns(kNonNullableExnRef);
3014+
uint8_t sig_id = builder.AddSignature(&sig);
3015+
ExpectValidates(
3016+
sigs.v_v(),
3017+
{kExprBlock, sig_id, WASM_TRY_TABLE_OP, U32V_1(1), CatchKind::kCatchRef,
3018+
ex, U32V_1(0), kExprEnd, kExprUnreachable, kExprEnd, kExprDrop},
3019+
kAppendEnd);
30113020

30123021
constexpr uint8_t kInvalidCatchKind = kLastCatchKind + 1;
30133022
ExpectFailure(sigs.v_v(),

0 commit comments

Comments
 (0)