@@ -20,16 +20,6 @@ macro_rules! validate_then_visit {
2020 ) * } ;
2121}
2222
23- macro_rules! validate_then_visit_simd {
24- ( $( @$proposal: ident $op: ident $( { $( $arg: ident: $argty: ty) ,* } ) ? => $visit: ident ( $( $ann: tt) * ) ) * ) => { $(
25- fn $visit( & mut self $( $( , $arg: $argty) * ) ?) -> Self :: Output {
26- self . 1. $visit( $( $( $arg. clone( ) ) ,* ) ?) ;
27- self . 1 . validator_visitor( self . 0 ) . simd_visitor( ) . expect( "simd_visitor is supported by the validator" ) . $visit( $( $( $arg) ,* ) ?) ?;
28- Ok ( ( ) )
29- }
30- ) * } ;
31- }
32-
3323impl < ' a , R : WasmModuleResources > VisitOperator < ' a > for ValidateThenVisit < ' _ , R > {
3424 type Output = Result < ( ) > ;
3525 wasmparser:: for_each_visit_operator!( validate_then_visit) ;
@@ -40,7 +30,7 @@ impl<'a, R: WasmModuleResources> VisitOperator<'a> for ValidateThenVisit<'_, R>
4030}
4131
4232impl < R : WasmModuleResources > VisitSimdOperator < ' _ > for ValidateThenVisit < ' _ , R > {
43- wasmparser:: for_each_visit_simd_operator!( validate_then_visit_simd ) ;
33+ wasmparser:: for_each_visit_simd_operator!( validate_then_visit ) ;
4434}
4535
4636pub ( crate ) fn process_operators_and_validate < R : WasmModuleResources > (
@@ -137,8 +127,8 @@ impl<R: WasmModuleResources> FunctionBuilder<R> {
137127 pub ( crate ) fn validator_visitor (
138128 & mut self ,
139129 offset : usize ,
140- ) -> impl VisitOperator < ' _ , Output = Result < ( ) , wasmparser:: BinaryReaderError > > {
141- self . validator . visitor ( offset)
130+ ) -> impl VisitOperator < ' _ , Output = Result < ( ) , wasmparser:: BinaryReaderError > > + VisitSimdOperator < ' _ > {
131+ self . validator . simd_visitor ( offset)
142132 }
143133
144134 pub ( crate ) fn validator_finish ( & mut self , offset : usize ) -> Result < ( ) , wasmparser:: BinaryReaderError > {
@@ -173,8 +163,8 @@ macro_rules! impl_visit_operator {
173163 ( @@sign_extension $( $rest: tt) * ) => { } ;
174164 ( @@saturating_float_to_int $( $rest: tt) * ) => { } ;
175165 ( @@bulk_memory $( $rest: tt) * ) => { } ;
176- // (@@tail_call $($rest:tt)* ) => {};
177166 ( @@simd $( $rest: tt) * ) => { } ;
167+
178168 ( @@$proposal: ident $op: ident $( { $( $arg: ident: $argty: ty) ,* } ) ? => $visit: ident ( $( $ann: tt) * ) ) => {
179169 #[ cold]
180170 fn $visit( & mut self $( $( , $arg: $argty) * ) ?) {
@@ -212,14 +202,6 @@ impl<'a, R: WasmModuleResources> wasmparser::VisitOperator<'a> for FunctionBuild
212202 visit_memory_init( MemoryInit , u32 , u32 ) , visit_memory_copy( MemoryCopy , u32 , u32 ) , visit_table_init( TableInit , u32 , u32 ) , visit_memory_fill( MemoryFill , u32 ) , visit_data_drop( DataDrop , u32 ) , visit_elem_drop( ElemDrop , u32 )
213203 }
214204
215- // fn visit_return_call(&mut self, function_index: u32) -> Self::Output {
216- // self.instructions.push(Instruction::ReturnCall(function_index));
217- // }
218-
219- // fn visit_return_call_indirect(&mut self, type_index: u32, table_index: u32) -> Self::Output {
220- // self.instructions.push(Instruction::ReturnCallIndirect(type_index, table_index));
221- // }
222-
223205 fn visit_global_set ( & mut self , global_index : u32 ) -> Self :: Output {
224206 match self . validator . get_operand_type ( 0 ) {
225207 Some ( Some ( t) ) => self . instructions . push ( match t {
@@ -247,6 +229,7 @@ impl<'a, R: WasmModuleResources> wasmparser::VisitOperator<'a> for FunctionBuild
247229 _ => self . visit_unreachable ( ) ,
248230 }
249231 }
232+
250233 fn visit_select ( & mut self ) -> Self :: Output {
251234 match self . validator . get_operand_type ( 1 ) {
252235 Some ( Some ( t) ) => self . visit_typed_select ( t) ,
0 commit comments