MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / convert_valtype

Method convert_valtype

crates/environ/src/types.rs:2567–2576  ·  view source on GitHub ↗

Converts a wasmparser value type to a wasmtime type

(&self, ty: wasmparser::ValType)

Source from the content-addressed store, hash-verified

2565
2566 /// Converts a wasmparser value type to a wasmtime type
2567 fn convert_valtype(&self, ty: wasmparser::ValType) -> WasmResult<WasmValType> {
2568 Ok(match ty {
2569 wasmparser::ValType::I32 => WasmValType::I32,
2570 wasmparser::ValType::I64 => WasmValType::I64,
2571 wasmparser::ValType::F32 => WasmValType::F32,
2572 wasmparser::ValType::F64 => WasmValType::F64,
2573 wasmparser::ValType::V128 => WasmValType::V128,
2574 wasmparser::ValType::Ref(t) => WasmValType::Ref(self.convert_ref_type(t)?),
2575 })
2576 }
2577
2578 /// Converts a wasmparser reference type to a wasmtime type
2579 fn convert_ref_type(&self, ty: wasmparser::RefType) -> WasmResult<WasmRefType> {

Callers 10

newMethod · 0.80
resolve_block_sigMethod · 0.80
declare_localsFunction · 0.80
convert_global_typeMethod · 0.80
convert_storage_typeMethod · 0.80
convert_func_typeMethod · 0.80
translate_payloadMethod · 0.80
translate_payloadMethod · 0.80

Implementers 6

env.rswinch/codegen/src/codegen/env.rs
func_environ.rscrates/cranelift/src/func_environ.rs
types_builder.rscrates/environ/src/component/types_bui
translate.rscrates/environ/src/component/translate
module_environ.rscrates/environ/src/compile/module_envi
module_types.rscrates/environ/src/compile/module_type

Calls 3

OkFunction · 0.85
convert_ref_typeMethod · 0.80
RefEnum · 0.50

Tested by

no test coverage detected