Skip to content

Commit 17fe672

Browse files
authored
Update spec test suite submodule (#2444)
Pull in some renamings in the custom descriptors proposal.
1 parent a2582c1 commit 17fe672

32 files changed

Lines changed: 645 additions & 645 deletions

File tree

crates/wasm-encoder/src/core/code.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,14 +1324,14 @@ pub enum Instruction<'a> {
13241324
I64MulWideU,
13251325

13261326
RefGetDesc(u32),
1327-
RefCastDescNonNull(HeapType),
1328-
RefCastDescNullable(HeapType),
1329-
BrOnCastDesc {
1327+
RefCastDescEqNonNull(HeapType),
1328+
RefCastDescEqNullable(HeapType),
1329+
BrOnCastDescEq {
13301330
relative_depth: u32,
13311331
from_ref_type: RefType,
13321332
to_ref_type: RefType,
13331333
},
1334-
BrOnCastDescFail {
1334+
BrOnCastDescEqFail {
13351335
relative_depth: u32,
13361336
from_ref_type: RefType,
13371337
to_ref_type: RefType,
@@ -2173,18 +2173,18 @@ impl Encode for Instruction<'_> {
21732173
Instruction::I64MulWideS => sink.i64_mul_wide_s(),
21742174
Instruction::I64MulWideU => sink.i64_mul_wide_u(),
21752175
Instruction::RefGetDesc(type_index) => sink.ref_get_desc(type_index),
2176-
Instruction::RefCastDescNonNull(hty) => sink.ref_cast_desc_non_null(hty),
2177-
Instruction::RefCastDescNullable(hty) => sink.ref_cast_desc_nullable(hty),
2178-
Instruction::BrOnCastDesc {
2176+
Instruction::RefCastDescEqNonNull(hty) => sink.ref_cast_desc_eq_non_null(hty),
2177+
Instruction::RefCastDescEqNullable(hty) => sink.ref_cast_desc_eq_nullable(hty),
2178+
Instruction::BrOnCastDescEq {
21792179
relative_depth,
21802180
from_ref_type,
21812181
to_ref_type,
2182-
} => sink.br_on_cast_desc(relative_depth, from_ref_type, to_ref_type),
2183-
Instruction::BrOnCastDescFail {
2182+
} => sink.br_on_cast_desc_eq(relative_depth, from_ref_type, to_ref_type),
2183+
Instruction::BrOnCastDescEqFail {
21842184
relative_depth,
21852185
from_ref_type,
21862186
to_ref_type,
2187-
} => sink.br_on_cast_desc_fail(relative_depth, from_ref_type, to_ref_type),
2187+
} => sink.br_on_cast_desc_eq_fail(relative_depth, from_ref_type, to_ref_type),
21882188
};
21892189
}
21902190
}

crates/wasm-encoder/src/core/instructions.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4649,24 +4649,24 @@ impl<'a> InstructionSink<'a> {
46494649
self
46504650
}
46514651

4652-
/// Encode [`Instruction::RefCastDescNonNull`].
4653-
pub fn ref_cast_desc_non_null(&mut self, ht: HeapType) -> &mut Self {
4652+
/// Encode [`Instruction::RefCastDescEqNonNull`].
4653+
pub fn ref_cast_desc_eq_non_null(&mut self, ht: HeapType) -> &mut Self {
46544654
self.sink.push(0xFB);
46554655
35u32.encode(self.sink);
46564656
ht.encode(self.sink);
46574657
self
46584658
}
46594659

4660-
/// Encode [`Instruction::RefCastDescNullable`].
4661-
pub fn ref_cast_desc_nullable(&mut self, ht: HeapType) -> &mut Self {
4660+
/// Encode [`Instruction::RefCastDescEqNullable`].
4661+
pub fn ref_cast_desc_eq_nullable(&mut self, ht: HeapType) -> &mut Self {
46624662
self.sink.push(0xFB);
46634663
36u32.encode(self.sink);
46644664
ht.encode(self.sink);
46654665
self
46664666
}
46674667

4668-
/// Encode [`Instruction::BrOnCastDesc`].
4669-
pub fn br_on_cast_desc(
4668+
/// Encode [`Instruction::BrOnCastDescEq`].
4669+
pub fn br_on_cast_desc_eq(
46704670
&mut self,
46714671
relative_depth: u32,
46724672
from_ref_type: RefType,
@@ -4682,8 +4682,8 @@ impl<'a> InstructionSink<'a> {
46824682
self
46834683
}
46844684

4685-
/// Encode [`Instruction::BrOnCastDescFail`].
4686-
pub fn br_on_cast_desc_fail(
4685+
/// Encode [`Instruction::BrOnCastDescEqFail`].
4686+
pub fn br_on_cast_desc_eq_fail(
46874687
&mut self,
46884688
relative_depth: u32,
46894689
from_ref_type: RefType,

crates/wasmparser/src/arity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ fn visit_switch(module: &dyn ModuleArity, cont: u32, _tag: u32) -> Option<(u32,
307307
Some((params, cont_params))
308308
}
309309

310-
fn visit_br_on_cast_desc(
310+
fn visit_br_on_cast_desc_eq(
311311
module: &dyn ModuleArity,
312312
depth: u32,
313313
_from: RefType,
@@ -317,7 +317,7 @@ fn visit_br_on_cast_desc(
317317
Some((params + 1, params))
318318
}
319319

320-
fn visit_br_on_cast_desc_fail(
320+
fn visit_br_on_cast_desc_eq_fail(
321321
module: &dyn ModuleArity,
322322
depth: u32,
323323
_from: RefType,

crates/wasmparser/src/binary_reader.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,8 +1369,8 @@ impl<'a> BinaryReader<'a> {
13691369
visitor.visit_struct_new_default_desc(type_index)
13701370
}
13711371
0x22 => visitor.visit_ref_get_desc(self.read()?),
1372-
0x23 => visitor.visit_ref_cast_desc_non_null(self.read()?),
1373-
0x24 => visitor.visit_ref_cast_desc_nullable(self.read()?),
1372+
0x23 => visitor.visit_ref_cast_desc_eq_non_null(self.read()?),
1373+
0x24 => visitor.visit_ref_cast_desc_eq_nullable(self.read()?),
13741374
0x25 => {
13751375
let pos = self.original_position();
13761376
let cast_flags = self.read_u8()?;
@@ -1392,7 +1392,7 @@ impl<'a> BinaryReader<'a> {
13921392
RefType::new(to_type_nullable, to_heap_type).ok_or_else(|| {
13931393
format_err!(pos, "implementation error: type index too large")
13941394
})?;
1395-
visitor.visit_br_on_cast_desc(relative_depth, from_ref_type, to_ref_type)
1395+
visitor.visit_br_on_cast_desc_eq(relative_depth, from_ref_type, to_ref_type)
13961396
}
13971397
0x26 => {
13981398
let pos = self.original_position();
@@ -1415,7 +1415,7 @@ impl<'a> BinaryReader<'a> {
14151415
RefType::new(to_type_nullable, to_heap_type).ok_or_else(|| {
14161416
format_err!(pos, "implementation error: type index too large")
14171417
})?;
1418-
visitor.visit_br_on_cast_desc_fail(relative_depth, from_ref_type, to_ref_type)
1418+
visitor.visit_br_on_cast_desc_eq_fail(relative_depth, from_ref_type, to_ref_type)
14191419
}
14201420

14211421
_ => bail!(pos, "unknown 0xfb subopcode: 0x{code:x}"),

crates/wasmparser/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,18 +303,18 @@ macro_rules! _for_each_operator_group {
303303
StructNewDesc { struct_type_index: u32 } => visit_struct_new_desc (arity custom)
304304
StructNewDefaultDesc { struct_type_index: u32 } => visit_struct_new_default_desc (arity 1 -> 1)
305305
RefGetDesc { type_index: u32 } => visit_ref_get_desc (arity 1 -> 1)
306-
RefCastDescNonNull { hty: $crate::HeapType } => visit_ref_cast_desc_non_null (arity 2 -> 1)
307-
RefCastDescNullable { hty: $crate::HeapType } => visit_ref_cast_desc_nullable (arity 2 -> 1)
308-
BrOnCastDesc {
306+
RefCastDescEqNonNull { hty: $crate::HeapType } => visit_ref_cast_desc_eq_non_null (arity 2 -> 1)
307+
RefCastDescEqNullable { hty: $crate::HeapType } => visit_ref_cast_desc_eq_nullable (arity 2 -> 1)
308+
BrOnCastDescEq {
309309
relative_depth: u32,
310310
from_ref_type: $crate::RefType,
311311
to_ref_type: $crate::RefType
312-
} => visit_br_on_cast_desc (arity custom)
313-
BrOnCastDescFail {
312+
} => visit_br_on_cast_desc_eq (arity custom)
313+
BrOnCastDescEqFail {
314314
relative_depth: u32,
315315
from_ref_type: $crate::RefType,
316316
to_ref_type: $crate::RefType
317-
} => visit_br_on_cast_desc_fail (arity custom)
317+
} => visit_br_on_cast_desc_eq_fail (arity custom)
318318
}
319319

320320
// 0xFC operators

crates/wasmparser/src/validator/operators.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ where
15271527

15281528
/// Common helper for both nullable and non-nullable variants of `ref.cast_desc`
15291529
/// instructions.
1530-
fn check_ref_cast_desc(&mut self, nullable: bool, heap_type: HeapType) -> Result<()> {
1530+
fn check_ref_cast_desc_eq(&mut self, nullable: bool, heap_type: HeapType) -> Result<()> {
15311531
let is_exact = self.check_maybe_exact_descriptor_ref(heap_type)?;
15321532

15331533
self.check_downcast(nullable, heap_type)?;
@@ -4549,13 +4549,13 @@ where
45494549
}
45504550
}
45514551

4552-
fn visit_ref_cast_desc_non_null(&mut self, heap_type: HeapType) -> Self::Output {
4553-
self.check_ref_cast_desc(false, heap_type)
4552+
fn visit_ref_cast_desc_eq_non_null(&mut self, heap_type: HeapType) -> Self::Output {
4553+
self.check_ref_cast_desc_eq(false, heap_type)
45544554
}
4555-
fn visit_ref_cast_desc_nullable(&mut self, heap_type: HeapType) -> Self::Output {
4556-
self.check_ref_cast_desc(true, heap_type)
4555+
fn visit_ref_cast_desc_eq_nullable(&mut self, heap_type: HeapType) -> Self::Output {
4556+
self.check_ref_cast_desc_eq(true, heap_type)
45574557
}
4558-
fn visit_br_on_cast_desc(
4558+
fn visit_br_on_cast_desc_eq(
45594559
&mut self,
45604560
relative_depth: u32,
45614561
mut from_ref_type: RefType,
@@ -4595,7 +4595,7 @@ where
45954595
self.push_operand(diff_ty)?;
45964596
Ok(())
45974597
}
4598-
fn visit_br_on_cast_desc_fail(
4598+
fn visit_br_on_cast_desc_eq_fail(
45994599
&mut self,
46004600
relative_depth: u32,
46014601
mut from_ref_type: RefType,

crates/wasmprinter/src/operator.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -769,13 +769,13 @@ macro_rules! define_visit {
769769
(payload $self:ident RefGetDesc $hty:ident) => (
770770
$self.struct_type_index($hty)?;
771771
);
772-
(payload $self:ident RefCastDescNonNull $hty:ident) => (
772+
(payload $self:ident RefCastDescEqNonNull $hty:ident) => (
773773
$self.push_str(" ")?;
774774
let rty = RefType::new(false, $hty)
775775
.ok_or_else(|| anyhow!("implementation limit: type index too large"))?;
776776
$self.printer.print_reftype($self.state, rty)?;
777777
);
778-
(payload $self:ident RefCastDescNullable $hty:ident) => (
778+
(payload $self:ident RefCastDescEqNullable $hty:ident) => (
779779
$self.push_str(" ")?;
780780
let rty = RefType::new(true, $hty)
781781
.ok_or_else(|| anyhow!("implementation limit: type index too large"))?;
@@ -1409,10 +1409,10 @@ macro_rules! define_visit {
14091409
(name I64MulWideS) => ("i64.mul_wide_s");
14101410
(name I64MulWideU) => ("i64.mul_wide_u");
14111411
(name RefGetDesc) => ("ref.get_desc");
1412-
(name RefCastDescNonNull) => ("ref.cast_desc");
1413-
(name RefCastDescNullable) => ("ref.cast_desc");
1414-
(name BrOnCastDesc) => ("br_on_cast_desc");
1415-
(name BrOnCastDescFail) => ("br_on_cast_desc_fail");
1412+
(name RefCastDescEqNonNull) => ("ref.cast_desc_eq");
1413+
(name RefCastDescEqNullable) => ("ref.cast_desc_eq");
1414+
(name BrOnCastDescEq) => ("br_on_cast_desc_eq");
1415+
(name BrOnCastDescEqFail) => ("br_on_cast_desc_eq_fail");
14161416
}
14171417

14181418
impl<'a> VisitOperator<'a> for PrintOperator<'_, '_, '_, '_> {

crates/wast/src/core/binary.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,7 @@ impl Encode for BrOnCastFail<'_> {
15991599
}
16001600
}
16011601

1602-
impl Encode for RefCastDesc<'_> {
1602+
impl Encode for RefCastDescEq<'_> {
16031603
fn encode(&self, e: &mut Vec<u8>) {
16041604
e.push(0xfb);
16051605
if self.r#type.nullable {
@@ -1611,7 +1611,7 @@ impl Encode for RefCastDesc<'_> {
16111611
}
16121612
}
16131613

1614-
impl Encode for BrOnCastDesc<'_> {
1614+
impl Encode for BrOnCastDescEq<'_> {
16151615
fn encode(&self, e: &mut Vec<u8>) {
16161616
e.push(0xfb);
16171617
e.push(0x25);
@@ -1625,7 +1625,7 @@ impl Encode for BrOnCastDesc<'_> {
16251625
}
16261626
}
16271627

1628-
impl Encode for BrOnCastDescFail<'_> {
1628+
impl Encode for BrOnCastDescEqFail<'_> {
16291629
fn encode(&self, e: &mut Vec<u8>) {
16301630
e.push(0xfb);
16311631
e.push(0x26);

crates/wast/src/core/expr.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,9 +1208,9 @@ instructions! {
12081208
StructNewDesc(Index<'a>) : [0xfb, 32] : "struct.new_desc",
12091209
StructNewDefaultDesc(Index<'a>) : [0xfb, 33] : "struct.new_default_desc",
12101210
RefGetDesc(Index<'a>): [0xfb, 34] : "ref.get_desc",
1211-
RefCastDesc(RefCastDesc<'a>) : [] : "ref.cast_desc",
1212-
BrOnCastDesc(Box<BrOnCastDesc<'a>>) : [] : "br_on_cast_desc",
1213-
BrOnCastDescFail(Box<BrOnCastDescFail<'a>>) : [] : "br_on_cast_desc_fail",
1211+
RefCastDescEq(RefCastDescEq<'a>) : [] : "ref.cast_desc_eq",
1212+
BrOnCastDescEq(Box<BrOnCastDescEq<'a>>) : [] : "br_on_cast_desc_eq",
1213+
BrOnCastDescEqFail(Box<BrOnCastDescEqFail<'a>>) : [] : "br_on_cast_desc_eq_fail",
12141214
}
12151215
}
12161216

@@ -1974,22 +1974,22 @@ impl<'a> Parse<'a> for BrOnCastFail<'a> {
19741974

19751975
/// Extra data associated with the `ref.cast_desc` instruction
19761976
#[derive(Debug, Clone)]
1977-
pub struct RefCastDesc<'a> {
1977+
pub struct RefCastDescEq<'a> {
19781978
/// The type to cast to.
19791979
pub r#type: RefType<'a>,
19801980
}
19811981

1982-
impl<'a> Parse<'a> for RefCastDesc<'a> {
1982+
impl<'a> Parse<'a> for RefCastDescEq<'a> {
19831983
fn parse(parser: Parser<'a>) -> Result<Self> {
1984-
Ok(RefCastDesc {
1984+
Ok(RefCastDescEq {
19851985
r#type: parser.parse()?,
19861986
})
19871987
}
19881988
}
19891989

1990-
/// Extra data associated with the `br_on_cast_desc` instruction
1990+
/// Extra data associated with the `br_on_cast_desc_eq` instruction
19911991
#[derive(Debug, Clone)]
1992-
pub struct BrOnCastDesc<'a> {
1992+
pub struct BrOnCastDescEq<'a> {
19931993
/// The label to branch to.
19941994
pub label: Index<'a>,
19951995
/// The type we're casting from.
@@ -1998,9 +1998,9 @@ pub struct BrOnCastDesc<'a> {
19981998
pub to_type: RefType<'a>,
19991999
}
20002000

2001-
impl<'a> Parse<'a> for BrOnCastDesc<'a> {
2001+
impl<'a> Parse<'a> for BrOnCastDescEq<'a> {
20022002
fn parse(parser: Parser<'a>) -> Result<Self> {
2003-
Ok(BrOnCastDesc {
2003+
Ok(BrOnCastDescEq {
20042004
label: parser.parse()?,
20052005
from_type: parser.parse()?,
20062006
to_type: parser.parse()?,
@@ -2010,7 +2010,7 @@ impl<'a> Parse<'a> for BrOnCastDesc<'a> {
20102010

20112011
/// Extra data associated with the `br_on_cast_desc_fail` instruction
20122012
#[derive(Debug, Clone)]
2013-
pub struct BrOnCastDescFail<'a> {
2013+
pub struct BrOnCastDescEqFail<'a> {
20142014
/// The label to branch to.
20152015
pub label: Index<'a>,
20162016
/// The type we're casting from.
@@ -2019,9 +2019,9 @@ pub struct BrOnCastDescFail<'a> {
20192019
pub to_type: RefType<'a>,
20202020
}
20212021

2022-
impl<'a> Parse<'a> for BrOnCastDescFail<'a> {
2022+
impl<'a> Parse<'a> for BrOnCastDescEqFail<'a> {
20232023
fn parse(parser: Parser<'a>) -> Result<Self> {
2024-
Ok(BrOnCastDescFail {
2024+
Ok(BrOnCastDescEqFail {
20252025
label: parser.parse()?,
20262026
from_type: parser.parse()?,
20272027
to_type: parser.parse()?,

crates/wast/src/core/resolve/names.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,15 +692,15 @@ impl<'a, 'b> ExprResolver<'a, 'b> {
692692
RefGetDesc(i) => {
693693
self.resolver.resolve(i, Ns::Type)?;
694694
}
695-
RefCastDesc(i) => {
695+
RefCastDescEq(i) => {
696696
self.resolver.resolve_reftype(&mut i.r#type)?;
697697
}
698-
BrOnCastDesc(i) => {
698+
BrOnCastDescEq(i) => {
699699
self.resolve_label(&mut i.label)?;
700700
self.resolver.resolve_reftype(&mut i.to_type)?;
701701
self.resolver.resolve_reftype(&mut i.from_type)?;
702702
}
703-
BrOnCastDescFail(i) => {
703+
BrOnCastDescEqFail(i) => {
704704
self.resolve_label(&mut i.label)?;
705705
self.resolver.resolve_reftype(&mut i.to_type)?;
706706
self.resolver.resolve_reftype(&mut i.from_type)?;

0 commit comments

Comments
 (0)