mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-10 14:48:27 +00:00
Renamed FuncType to FunctionType
This commit is contained in:
@@ -9,7 +9,7 @@ use crate::target::Target;
|
||||
use crate::FunctionBodyData;
|
||||
use crate::ModuleTranslationState;
|
||||
use wasm_common::entity::PrimaryMap;
|
||||
use wasm_common::{Features, FuncType, LocalFuncIndex, MemoryIndex, TableIndex};
|
||||
use wasm_common::{Features, FunctionType, LocalFuncIndex, MemoryIndex, TableIndex};
|
||||
use wasmer_runtime::Module;
|
||||
use wasmer_runtime::{MemoryPlan, TablePlan};
|
||||
use wasmparser::{validate, OperatorValidatorConfig, ValidatingParserConfig};
|
||||
@@ -82,6 +82,6 @@ pub trait Compiler {
|
||||
/// ```
|
||||
fn compile_wasm_trampolines(
|
||||
&self,
|
||||
signatures: &[FuncType],
|
||||
signatures: &[FunctionType],
|
||||
) -> Result<Vec<FunctionBody>, CompileError>;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::{WasmError, WasmResult};
|
||||
use std::convert::TryFrom;
|
||||
use std::sync::Arc;
|
||||
use wasm_common::entity::PrimaryMap;
|
||||
use wasm_common::FuncType;
|
||||
use wasm_common::FunctionType;
|
||||
use wasm_common::{
|
||||
DataIndex, DataInitializer, DataInitializerLocation, ElemIndex, ExportIndex, FuncIndex,
|
||||
GlobalIndex, GlobalInit, GlobalType, ImportIndex, LocalFuncIndex, MemoryIndex, MemoryType,
|
||||
@@ -102,7 +102,7 @@ impl<'data> ModuleEnvironment<'data> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn declare_signature(&mut self, sig: FuncType) -> WasmResult<()> {
|
||||
pub(crate) fn declare_signature(&mut self, sig: FunctionType) -> WasmResult<()> {
|
||||
// TODO: Deduplicate signatures.
|
||||
self.result.module.signatures.push(sig);
|
||||
Ok(())
|
||||
|
||||
@@ -18,15 +18,16 @@ use std::vec::Vec;
|
||||
use wasm_common::entity::packed_option::ReservedValue;
|
||||
use wasm_common::entity::EntityRef;
|
||||
use wasm_common::{
|
||||
DataIndex, ElemIndex, FuncIndex, FuncType, GlobalIndex, GlobalInit, GlobalType, MemoryIndex,
|
||||
MemoryType, Pages, SignatureIndex, TableIndex, TableType, Type, V128,
|
||||
DataIndex, ElemIndex, FuncIndex, FunctionType, GlobalIndex, GlobalInit, GlobalType,
|
||||
MemoryIndex, MemoryType, Pages, SignatureIndex, TableIndex, TableType, Type, V128,
|
||||
};
|
||||
use wasmparser::{
|
||||
self, CodeSectionReader, Data, DataKind, DataSectionReader, Element, ElementItem, ElementItems,
|
||||
ElementKind, ElementSectionReader, Export, ExportSectionReader, ExternalKind,
|
||||
FuncType as WPFuncType, FunctionSectionReader, GlobalSectionReader, GlobalType as WPGlobalType,
|
||||
ImportSectionEntryType, ImportSectionReader, MemorySectionReader, MemoryType as WPMemoryType,
|
||||
NameSectionReader, Naming, NamingReader, Operator, TableSectionReader, TypeSectionReader,
|
||||
FuncType as WPFunctionType, FunctionSectionReader, GlobalSectionReader,
|
||||
GlobalType as WPGlobalType, ImportSectionEntryType, ImportSectionReader, MemorySectionReader,
|
||||
MemoryType as WPMemoryType, NameSectionReader, Naming, NamingReader, Operator,
|
||||
TableSectionReader, TypeSectionReader,
|
||||
};
|
||||
|
||||
/// Helper function translating wasmparser types to Wasm Type.
|
||||
@@ -57,7 +58,7 @@ pub fn parse_type_section(
|
||||
|
||||
for entry in types {
|
||||
match entry.map_err(to_wasm_error)? {
|
||||
WPFuncType {
|
||||
WPFunctionType {
|
||||
form: wasmparser::Type::Func,
|
||||
params,
|
||||
returns,
|
||||
@@ -76,7 +77,7 @@ pub fn parse_type_section(
|
||||
.expect("only numeric types are supported in function signatures")
|
||||
})
|
||||
.collect();
|
||||
let sig = FuncType::new(sig_params, sig_returns);
|
||||
let sig = FunctionType::new(sig_params, sig_returns);
|
||||
environ.declare_signature(sig)?;
|
||||
module_translation_state.wasm_types.push((params, returns));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user