mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
deps: V8: cherry-pick 7cb6188cf913
Original commit message:
[wasm][exnref] Accept non-nullable exn catch type
R=jkummerow@chromium.org
Fixed: 373681572
Change-Id: Iecfc86d2ce6592a6f442bc3504ddde58ff236f64
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5938956
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#96637}
Refs: https://github.com/v8/v8/commit/7cb6188cf9132d43e6c631befb0584a47a0e7d69
PR-URL: https://github.com/nodejs/node/pull/62783
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
92804cdbea
commit
2268567237
4 files changed
+16
-7
No files matched your search
+1
-1
@@ -38,7 +38,7 @@
|
||||
|
||||
# Reset this number to 0 on major V8 upgrades.
|
||||
# Increment by one for each non-official patch applied to deps/v8.
|
||||
'v8_embedder_string': '-node.51',
|
||||
'v8_embedder_string': '-node.52',
|
||||
|
||||
##### V8 defaults for Node.js #####
|
||||
|
||||
|
||||
+2
-2
@@ -3280,7 +3280,7 @@ class WasmFullDecoder : public WasmDecoder<ValidationTag, decoding_mode> {
|
||||
}
|
||||
if (catch_case.kind == kCatchRef || catch_case.kind == kCatchAllRef) {
|
||||
stack_.EnsureMoreCapacity(1, this->zone_);
|
||||
Push(kWasmExnRef);
|
||||
Push(ValueType::Ref(HeapType::kExn));
|
||||
push_count += 1;
|
||||
}
|
||||
Control* target = control_at(catch_case.br_imm.depth);
|
||||
@@ -3506,7 +3506,7 @@ class WasmFullDecoder : public WasmDecoder<ValidationTag, decoding_mode> {
|
||||
}
|
||||
if (catch_case.kind == kCatchRef || catch_case.kind == kCatchAllRef) {
|
||||
stack_.EnsureMoreCapacity(1, this->zone_);
|
||||
Push(kWasmExnRef);
|
||||
Push(ValueType::Ref(HeapType::kExn));
|
||||
push_count += 1;
|
||||
}
|
||||
base::Vector<Value> values(
|
||||
|
||||
+2
-2
@@ -1406,7 +1406,7 @@ class WasmGraphBuildingInterface {
|
||||
|
||||
if (catch_case.kind == kCatchAll || catch_case.kind == kCatchAllRef) {
|
||||
if (catch_case.kind == kCatchAllRef) {
|
||||
DCHECK_EQ(values[0].type, kWasmExnRef);
|
||||
DCHECK_EQ(values[0].type, ValueType::Ref(HeapType::kExn));
|
||||
values[0].node = block->try_info->exception;
|
||||
}
|
||||
BrOrRet(decoder, catch_case.br_imm.depth);
|
||||
@@ -1473,7 +1473,7 @@ class WasmGraphBuildingInterface {
|
||||
}
|
||||
|
||||
if (catch_case.kind == kCatchRef) {
|
||||
DCHECK_EQ(values.last().type, kWasmExnRef);
|
||||
DCHECK_EQ(values.last().type, ValueType::Ref(HeapType::kExn));
|
||||
values.last().node = block->try_info->exception;
|
||||
}
|
||||
BrOrRet(decoder, catch_case.br_imm.depth);
|
||||
|
||||
@@ -2994,7 +2994,7 @@ TEST_F(FunctionBodyDecoderTest, TryTable) {
|
||||
U32V_1(1), CatchKind::kCatchAllRef, U32V_1(0), kExprEnd,
|
||||
kExprUnreachable, kExprEnd, kExprDrop},
|
||||
kAppendEnd);
|
||||
// // Duplicate catch-all.
|
||||
// Duplicate catch-all.
|
||||
ExpectValidates(
|
||||
sigs.v_v(),
|
||||
{kExprBlock, kExnRefCode, WASM_TRY_TABLE_OP, U32V_1(4),
|
||||
@@ -3002,12 +3002,21 @@ TEST_F(FunctionBodyDecoderTest, TryTable) {
|
||||
CatchKind::kCatchAllRef, U32V_1(0), CatchKind::kCatchAllRef, U32V_1(0),
|
||||
kExprEnd, kExprUnreachable, kExprEnd, kExprDrop},
|
||||
kAppendEnd);
|
||||
// // Catch-all before catch.
|
||||
// Catch-all before catch.
|
||||
ExpectValidates(
|
||||
sigs.v_v(),
|
||||
{WASM_TRY_TABLE_OP, U32V_1(2), CatchKind::kCatchAll, U32V_1(0),
|
||||
CatchKind::kCatch, ex, U32V_1(0), kExprEnd, kExprUnreachable},
|
||||
kAppendEnd);
|
||||
// Non-nullable exnref.
|
||||
ValueType kNonNullableExnRef = ValueType::Ref(HeapType::kExn);
|
||||
auto sig = FixedSizeSignature<ValueType>::Returns(kNonNullableExnRef);
|
||||
uint8_t sig_id = builder.AddSignature(&sig);
|
||||
ExpectValidates(
|
||||
sigs.v_v(),
|
||||
{kExprBlock, sig_id, WASM_TRY_TABLE_OP, U32V_1(1), CatchKind::kCatchRef,
|
||||
ex, U32V_1(0), kExprEnd, kExprUnreachable, kExprEnd, kExprDrop},
|
||||
kAppendEnd);
|
||||
|
||||
constexpr uint8_t kInvalidCatchKind = kLastCatchKind + 1;
|
||||
ExpectFailure(sigs.v_v(),
|
||||
|
||||
Reference in new issue
Block a user