MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / process_inline_code_section_entry

Method process_inline_code_section_entry

crates/parser/src/module.rs:213–241  ·  view source on GitHub ↗
(
        &mut self,
        function: wasmparser::FunctionBody<'_>,
        validator: &mut Validator,
        options: &ParserOptions,
    )

Source from the content-addressed store, hash-verified

211 }
212
213 pub(crate) fn process_inline_code_section_entry(
214 &mut self,
215 function: wasmparser::FunctionBody<'_>,
216 validator: &mut Validator,
217 options: &ParserOptions,
218 ) -> Result<()> {
219 debug!("Found code section entry");
220
221 let func_validator_allocs = self.func_validator_allocations.take().unwrap_or_default();
222 let operators_reader_allocs = self.operators_reader_allocations.take().unwrap_or_default();
223
224 let func_to_validate = validator.code_section_entry(&function)?;
225 let func_validator = func_to_validate.into_validator(func_validator_allocs);
226
227 let (code, func_validator_allocs, operators_reader_allocs) =
228 convert_module_code(function, func_validator, operators_reader_allocs)?;
229
230 self.code.push(optimize_function_code(
231 code,
232 options,
233 self.function_results(self.code.len()),
234 (imported_func_count(&self.imports) + self.code.len()) as u32,
235 imported_memory_count(&self.imports),
236 ));
237
238 self.func_validator_allocations = Some(func_validator_allocs);
239 self.operators_reader_allocations = Some(operators_reader_allocs);
240 Ok(())
241 }
242
243 pub(crate) fn process_borrowed_code_section_entry(
244 &mut self,

Callers 2

parse_module_streamMethod · 0.80

Calls 7

convert_module_codeFunction · 0.85
optimize_function_codeFunction · 0.85
imported_func_countFunction · 0.85
imported_memory_countFunction · 0.85
function_resultsMethod · 0.80
pushMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected