@@ -20,16 +20,6 @@ macro_rules! validate_then_visit {
20
20
) * } ;
21
21
}
22
22
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
-
33
23
impl < ' a , R : WasmModuleResources > VisitOperator < ' a > for ValidateThenVisit < ' _ , R > {
34
24
type Output = Result < ( ) > ;
35
25
wasmparser:: for_each_visit_operator!( validate_then_visit) ;
@@ -40,7 +30,7 @@ impl<'a, R: WasmModuleResources> VisitOperator<'a> for ValidateThenVisit<'_, R>
40
30
}
41
31
42
32
impl < 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 ) ;
44
34
}
45
35
46
36
pub ( crate ) fn process_operators_and_validate < R : WasmModuleResources > (
@@ -137,8 +127,8 @@ impl<R: WasmModuleResources> FunctionBuilder<R> {
137
127
pub ( crate ) fn validator_visitor (
138
128
& mut self ,
139
129
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)
142
132
}
143
133
144
134
pub ( crate ) fn validator_finish ( & mut self , offset : usize ) -> Result < ( ) , wasmparser:: BinaryReaderError > {
@@ -173,8 +163,8 @@ macro_rules! impl_visit_operator {
173
163
( @@sign_extension $( $rest: tt) * ) => { } ;
174
164
( @@saturating_float_to_int $( $rest: tt) * ) => { } ;
175
165
( @@bulk_memory $( $rest: tt) * ) => { } ;
176
- // (@@tail_call $($rest:tt)* ) => {};
177
166
( @@simd $( $rest: tt) * ) => { } ;
167
+
178
168
( @@$proposal: ident $op: ident $( { $( $arg: ident: $argty: ty) ,* } ) ? => $visit: ident ( $( $ann: tt) * ) ) => {
179
169
#[ cold]
180
170
fn $visit( & mut self $( $( , $arg: $argty) * ) ?) {
@@ -212,14 +202,6 @@ impl<'a, R: WasmModuleResources> wasmparser::VisitOperator<'a> for FunctionBuild
212
202
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 )
213
203
}
214
204
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
-
223
205
fn visit_global_set ( & mut self , global_index : u32 ) -> Self :: Output {
224
206
match self . validator . get_operand_type ( 0 ) {
225
207
Some ( Some ( t) ) => self . instructions . push ( match t {
@@ -247,6 +229,7 @@ impl<'a, R: WasmModuleResources> wasmparser::VisitOperator<'a> for FunctionBuild
247
229
_ => self . visit_unreachable ( ) ,
248
230
}
249
231
}
232
+
250
233
fn visit_select ( & mut self ) -> Self :: Output {
251
234
match self . validator . get_operand_type ( 1 ) {
252
235
Some ( Some ( t) ) => self . visit_typed_select ( t) ,
0 commit comments