diff --git a/lib/api/src/import_object.rs b/lib/api/src/import_object.rs index 202155b1d..bf499fcc9 100644 --- a/lib/api/src/import_object.rs +++ b/lib/api/src/import_object.rs @@ -263,8 +263,8 @@ macro_rules! import_namespace { mod test { use super::*; use crate::{Global, Store, Val}; - use wasmer_types::Type; use wasmer_engine::ChainableNamedResolver; + use wasmer_types::Type; use wasmer_vm::Export; #[test] diff --git a/lib/api/src/lib.rs b/lib/api/src/lib.rs index 007195526..69dbd084c 100644 --- a/lib/api/src/lib.rs +++ b/lib/api/src/lib.rs @@ -63,10 +63,6 @@ pub use crate::types::{ pub use crate::types::{Val as Value, ValType as Type}; pub use crate::utils::is_wasm; pub use target_lexicon::{Architecture, CallingConvention, OperatingSystem, Triple, HOST}; -pub use wasmer_types::{ - Atomically, Bytes, GlobalInit, LocalFunctionIndex, MemoryView, Pages, ValueType, - WASM_MAX_PAGES, WASM_MIN_PAGES, WASM_PAGE_SIZE, -}; #[cfg(feature = "compiler")] pub use wasmer_compiler::CompilerConfig; pub use wasmer_compiler::{ @@ -77,6 +73,10 @@ pub use wasmer_engine::{ ChainableNamedResolver, DeserializeError, Engine, InstantiationError, LinkError, NamedResolver, NamedResolverChain, Resolver, RuntimeError, SerializeError, }; +pub use wasmer_types::{ + Atomically, Bytes, GlobalInit, LocalFunctionIndex, MemoryView, Pages, ValueType, + WASM_MAX_PAGES, WASM_MIN_PAGES, WASM_PAGE_SIZE, +}; pub use wasmer_vm::{raise_user_trap, Export, MemoryError}; #[cfg(feature = "wat")] pub use wat::parse_bytes as wat2wasm; diff --git a/lib/c-api/src/instance.rs b/lib/c-api/src/instance.rs index a3c9a5dbf..d42363192 100644 --- a/lib/c-api/src/instance.rs +++ b/lib/c-api/src/instance.rs @@ -13,10 +13,10 @@ use std::collections::HashMap; use std::ffi::CStr; use std::ptr::NonNull; use std::slice; -use wasmer_types::{entity::*, ExportIndex, MemoryIndex}; use wasmer::{ Exports, Extern, Function, Global, ImportObject, Instance, Memory, Module, Table, Val, }; +use wasmer_types::{entity::*, ExportIndex, MemoryIndex}; /// Opaque pointer to an Instance type plus metadata. /// diff --git a/lib/cli/src/store.rs b/lib/cli/src/store.rs index 9d24f458f..096c34d13 100644 --- a/lib/cli/src/store.rs +++ b/lib/cli/src/store.rs @@ -201,10 +201,10 @@ impl StoreOptions { use std::fmt; use std::fs::File; use std::io::Write; - use wasmer_types::entity::EntityRef; use wasmer_compiler_llvm::{ CompiledFunctionKind, InkwellMemoryBuffer, InkwellModule, LLVMCallbacks, LLVM, }; + use wasmer_types::entity::EntityRef; let mut config = LLVM::new(); struct Callbacks { debug_dir: PathBuf, diff --git a/lib/compiler-cranelift/src/compiler.rs b/lib/compiler-cranelift/src/compiler.rs index c9403fbf8..400687699 100644 --- a/lib/compiler-cranelift/src/compiler.rs +++ b/lib/compiler-cranelift/src/compiler.rs @@ -19,14 +19,14 @@ use cranelift_codegen::{binemit, Context}; #[cfg(feature = "unwind")] use gimli::write::{Address, EhFrame, FrameTable}; use rayon::prelude::{IntoParallelRefIterator, ParallelIterator}; -use wasmer_types::entity::{EntityRef, PrimaryMap}; -use wasmer_types::{FunctionIndex, LocalFunctionIndex, SignatureIndex}; use wasmer_compiler::CompileError; use wasmer_compiler::{CallingConvention, ModuleTranslationState, Target}; use wasmer_compiler::{ Compilation, CompileModuleInfo, CompiledFunction, CompiledFunctionFrameInfo, CompiledFunctionUnwindInfo, Compiler, Dwarf, FunctionBody, FunctionBodyData, SectionIndex, }; +use wasmer_types::entity::{EntityRef, PrimaryMap}; +use wasmer_types::{FunctionIndex, LocalFunctionIndex, SignatureIndex}; /// A compiler that compiles a WebAssembly module with Cranelift, translating the Wasm to Cranelift IR, /// optimizing it and then translating to assembly. diff --git a/lib/compiler-cranelift/src/dwarf.rs b/lib/compiler-cranelift/src/dwarf.rs index 7947b8ae9..07e67bbdb 100644 --- a/lib/compiler-cranelift/src/dwarf.rs +++ b/lib/compiler-cranelift/src/dwarf.rs @@ -1,9 +1,9 @@ use gimli::write::{Address, EndianVec, Result, Writer}; use gimli::{RunTimeEndian, SectionId}; -use wasmer_types::entity::EntityRef; -use wasmer_types::LocalFunctionIndex; use wasmer_compiler::{CustomSection, CustomSectionProtection, SectionBody}; use wasmer_compiler::{Endianness, Relocation, RelocationKind, RelocationTarget}; +use wasmer_types::entity::EntityRef; +use wasmer_types::LocalFunctionIndex; #[derive(Clone, Debug)] pub struct WriterRelocate { diff --git a/lib/compiler-cranelift/src/func_environ.rs b/lib/compiler-cranelift/src/func_environ.rs index 043c00c7b..dc4dfe74e 100644 --- a/lib/compiler-cranelift/src/func_environ.rs +++ b/lib/compiler-cranelift/src/func_environ.rs @@ -12,10 +12,10 @@ use cranelift_codegen::ir::types::*; use cranelift_codegen::ir::{AbiParam, ArgumentPurpose, Function, InstBuilder, Signature}; use cranelift_codegen::isa::TargetFrontendConfig; use std::convert::TryFrom; +use wasmer_compiler::{WasmError, WasmResult}; use wasmer_types::entity::EntityRef; use wasmer_types::entity::PrimaryMap; use wasmer_types::{FunctionIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex}; -use wasmer_compiler::{WasmError, WasmResult}; use wasmer_vm::VMBuiltinFunctionIndex; use wasmer_vm::VMOffsets; use wasmer_vm::{MemoryStyle, ModuleInfo, TableStyle}; diff --git a/lib/compiler-cranelift/src/sink.rs b/lib/compiler-cranelift/src/sink.rs index c80c6e5b6..41ef8dd56 100644 --- a/lib/compiler-cranelift/src/sink.rs +++ b/lib/compiler-cranelift/src/sink.rs @@ -3,9 +3,9 @@ use crate::translator::{irlibcall_to_libcall, irreloc_to_relocationkind}; use cranelift_codegen::binemit; use cranelift_codegen::ir::{self, ExternalName}; +use wasmer_compiler::{JumpTable, Relocation, RelocationTarget, SourceLoc, TrapInformation}; use wasmer_types::entity::EntityRef; use wasmer_types::{FunctionIndex, LocalFunctionIndex}; -use wasmer_compiler::{JumpTable, Relocation, RelocationTarget, SourceLoc, TrapInformation}; use wasmer_vm::{ModuleInfo, TrapCode}; /// Implementation of a relocation sink that just saves all the information for later diff --git a/lib/compiler-cranelift/src/trampoline/dynamic_function.rs b/lib/compiler-cranelift/src/trampoline/dynamic_function.rs index d433fed32..e350ae16a 100644 --- a/lib/compiler-cranelift/src/trampoline/dynamic_function.rs +++ b/lib/compiler-cranelift/src/trampoline/dynamic_function.rs @@ -16,8 +16,8 @@ use std::cmp; use std::mem; use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext}; -use wasmer_types::FunctionType; use wasmer_compiler::{CompileError, FunctionBody}; +use wasmer_types::FunctionType; use wasmer_vm::VMOffsets; /// Create a trampoline for invoking a WebAssembly function. diff --git a/lib/compiler-cranelift/src/trampoline/function_call.rs b/lib/compiler-cranelift/src/trampoline/function_call.rs index c0d41c6b9..bb39860ce 100644 --- a/lib/compiler-cranelift/src/trampoline/function_call.rs +++ b/lib/compiler-cranelift/src/trampoline/function_call.rs @@ -19,8 +19,8 @@ use cranelift_codegen::Context; use cranelift_codegen::{binemit, ir}; use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext}; use std::mem; -use wasmer_types::FunctionType; use wasmer_compiler::{CompileError, FunctionBody}; +use wasmer_types::FunctionType; /// Create a trampoline for invoking a WebAssembly function. pub fn make_trampoline_function_call( diff --git a/lib/compiler-cranelift/src/translator/code_translator.rs b/lib/compiler-cranelift/src/translator/code_translator.rs index 4b825aaac..6d3e98670 100644 --- a/lib/compiler-cranelift/src/translator/code_translator.rs +++ b/lib/compiler-cranelift/src/translator/code_translator.rs @@ -42,10 +42,10 @@ use cranelift_codegen::ir::{ use cranelift_codegen::packed_option::ReservedValue; use cranelift_frontend::{FunctionBuilder, Variable}; use std::vec::Vec; -use wasmer_types::{FunctionIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex}; use wasmer_compiler::wasmparser::{MemoryImmediate, Operator}; use wasmer_compiler::{to_wasm_error, WasmResult}; use wasmer_compiler::{wasm_unsupported, ModuleTranslationState}; +use wasmer_types::{FunctionIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex}; // Clippy warns about "flags: _" but its important to document that the flags field is ignored #[cfg_attr( diff --git a/lib/compiler-cranelift/src/translator/func_environ.rs b/lib/compiler-cranelift/src/translator/func_environ.rs index bc91e5926..cfc07b388 100644 --- a/lib/compiler-cranelift/src/translator/func_environ.rs +++ b/lib/compiler-cranelift/src/translator/func_environ.rs @@ -12,9 +12,9 @@ use cranelift_codegen::ir::immediates::Offset32; use cranelift_codegen::ir::{self, InstBuilder}; use cranelift_codegen::isa::TargetFrontendConfig; use cranelift_frontend::FunctionBuilder; -use wasmer_types::{FunctionIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex}; use wasmer_compiler::wasmparser::Operator; use wasmer_compiler::WasmResult; +use wasmer_types::{FunctionIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex}; /// The value of a WebAssembly global variable. #[derive(Clone, Copy)] diff --git a/lib/compiler-cranelift/src/translator/func_state.rs b/lib/compiler-cranelift/src/translator/func_state.rs index eaee1a9b0..a9af4b181 100644 --- a/lib/compiler-cranelift/src/translator/func_state.rs +++ b/lib/compiler-cranelift/src/translator/func_state.rs @@ -13,8 +13,8 @@ use super::func_environ::{FuncEnvironment, GlobalVariable}; use crate::{HashMap, Occupied, Vacant}; use cranelift_codegen::ir::{self, Block, Inst, Value}; use std::vec::Vec; -use wasmer_types::{FunctionIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex}; use wasmer_compiler::WasmResult; +use wasmer_types::{FunctionIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex}; /// Information about the presence of an associated `else` for an `if`, or the /// lack thereof. diff --git a/lib/compiler-cranelift/src/translator/func_translator.rs b/lib/compiler-cranelift/src/translator/func_translator.rs index e203f71d4..173707f0c 100644 --- a/lib/compiler-cranelift/src/translator/func_translator.rs +++ b/lib/compiler-cranelift/src/translator/func_translator.rs @@ -17,12 +17,12 @@ use cranelift_codegen::ir::{self, Block, InstBuilder, ValueLabel}; use cranelift_codegen::timing; use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext, Variable}; use tracing::info; -use wasmer_types::LocalFunctionIndex; use wasmer_compiler::wasmparser; use wasmer_compiler::{ to_wasm_error, wasm_unsupported, GenerateMiddlewareChain, MiddlewareBinaryReader, ModuleTranslationState, WasmResult, }; +use wasmer_types::LocalFunctionIndex; /// WebAssembly to Cranelift IR function translator. /// diff --git a/lib/compiler-cranelift/src/translator/translation_utils.rs b/lib/compiler-cranelift/src/translator/translation_utils.rs index 9b900d686..4b4c77e25 100644 --- a/lib/compiler-cranelift/src/translator/translation_utils.rs +++ b/lib/compiler-cranelift/src/translator/translation_utils.rs @@ -7,12 +7,12 @@ use cranelift_codegen::binemit::Reloc; use cranelift_codegen::ir::{self, AbiParam}; use cranelift_codegen::isa::TargetFrontendConfig; use cranelift_frontend::FunctionBuilder; -use wasmer_types::entity::{EntityRef, SecondaryMap}; -use wasmer_types::{FunctionType, Type}; use wasmer_compiler::wasm_unsupported; use wasmer_compiler::wasmparser; use wasmer_compiler::{JumpTable, RelocationKind}; use wasmer_compiler::{WasmError, WasmResult}; +use wasmer_types::entity::{EntityRef, SecondaryMap}; +use wasmer_types::{FunctionType, Type}; use wasmer_vm::libcalls::LibCall; /// Helper function translate a Function signature into Cranelift Ir diff --git a/lib/compiler-llvm/src/compiler.rs b/lib/compiler-llvm/src/compiler.rs index b55f40ec7..24f401bbc 100644 --- a/lib/compiler-llvm/src/compiler.rs +++ b/lib/compiler-llvm/src/compiler.rs @@ -6,13 +6,13 @@ use inkwell::memory_buffer::MemoryBuffer; use inkwell::module::Module; use inkwell::targets::FileType; use rayon::prelude::{IntoParallelRefIterator, ParallelIterator}; -use wasmer_types::entity::{EntityRef, PrimaryMap}; -use wasmer_types::{FunctionIndex, LocalFunctionIndex, SignatureIndex}; use wasmer_compiler::{ Compilation, CompileError, CompileModuleInfo, Compiler, CustomSection, CustomSectionProtection, Dwarf, FunctionBodyData, ModuleTranslationState, RelocationTarget, SectionBody, SectionIndex, Symbol, SymbolRegistry, Target, }; +use wasmer_types::entity::{EntityRef, PrimaryMap}; +use wasmer_types::{FunctionIndex, LocalFunctionIndex, SignatureIndex}; //use std::sync::{Arc, Mutex}; diff --git a/lib/compiler-llvm/src/config.rs b/lib/compiler-llvm/src/config.rs index 97f8e6e4b..2a90d2700 100644 --- a/lib/compiler-llvm/src/config.rs +++ b/lib/compiler-llvm/src/config.rs @@ -8,8 +8,8 @@ use itertools::Itertools; use std::fmt::Debug; use std::sync::Arc; use target_lexicon::Architecture; -use wasmer_types::{FunctionType, LocalFunctionIndex}; use wasmer_compiler::{Compiler, CompilerConfig, FunctionMiddlewareGenerator, Target, Triple}; +use wasmer_types::{FunctionType, LocalFunctionIndex}; /// The InkWell ModuleInfo type pub type InkwellModule<'ctx> = inkwell::module::Module<'ctx>; diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs index 5de0ee809..1c118203a 100644 --- a/lib/compiler-llvm/src/object_file.rs +++ b/lib/compiler-llvm/src/object_file.rs @@ -1,12 +1,12 @@ use std::collections::{HashMap, HashSet}; use std::convert::TryFrom; -use wasmer_types::entity::{PrimaryMap, SecondaryMap}; use wasmer_compiler::{ CompileError, CompiledFunctionFrameInfo, CustomSection, CustomSectionProtection, CustomSections, FunctionAddressMap, FunctionBody, InstructionAddressMap, Relocation, RelocationKind, RelocationTarget, SectionBody, SectionIndex, SourceLoc, }; +use wasmer_types::entity::{PrimaryMap, SecondaryMap}; use wasmer_vm::libcalls::LibCall; use wasmer_types::entity::entity_impl; diff --git a/lib/compiler-llvm/src/trampoline/wasm.rs b/lib/compiler-llvm/src/trampoline/wasm.rs index 56da38545..a954919df 100644 --- a/lib/compiler-llvm/src/trampoline/wasm.rs +++ b/lib/compiler-llvm/src/trampoline/wasm.rs @@ -17,8 +17,8 @@ use inkwell::{ }; use std::cmp; use std::convert::TryInto; -use wasmer_types::{FunctionType, LocalFunctionIndex}; use wasmer_compiler::{CompileError, FunctionBody, RelocationTarget}; +use wasmer_types::{FunctionType, LocalFunctionIndex}; pub struct FuncTrampoline { ctx: Context, diff --git a/lib/compiler-llvm/src/translator/abi.rs b/lib/compiler-llvm/src/translator/abi.rs index bc62583bc..66343c758 100644 --- a/lib/compiler-llvm/src/translator/abi.rs +++ b/lib/compiler-llvm/src/translator/abi.rs @@ -22,8 +22,8 @@ use inkwell::{ }, AddressSpace, }; -use wasmer_types::{FunctionType as FuncSig, Type}; use wasmer_compiler::CompileError; +use wasmer_types::{FunctionType as FuncSig, Type}; // Given a function definition, retrieve the parameter that is the vmctx pointer. pub fn get_vmctx_ptr_param<'ctx>(func_value: &FunctionValue<'ctx>) -> PointerValue<'ctx> { diff --git a/lib/compiler-llvm/src/translator/code.rs b/lib/compiler-llvm/src/translator/code.rs index f74226681..836bb7864 100644 --- a/lib/compiler-llvm/src/translator/code.rs +++ b/lib/compiler-llvm/src/translator/code.rs @@ -24,16 +24,16 @@ use smallvec::SmallVec; use crate::config::{CompiledFunctionKind, LLVM}; use crate::object_file::{load_object_file, CompiledFunction}; -use wasmer_types::entity::PrimaryMap; -use wasmer_types::{ - FunctionIndex, FunctionType, GlobalIndex, LocalFunctionIndex, MemoryIndex, SignatureIndex, - TableIndex, Type, -}; use wasmer_compiler::wasmparser::{MemoryImmediate, Operator}; use wasmer_compiler::{ to_wasm_error, wptype_to_type, CompileError, FunctionBodyData, GenerateMiddlewareChain, MiddlewareBinaryReader, ModuleTranslationState, RelocationTarget, Symbol, SymbolRegistry, }; +use wasmer_types::entity::PrimaryMap; +use wasmer_types::{ + FunctionIndex, FunctionType, GlobalIndex, LocalFunctionIndex, MemoryIndex, SignatureIndex, + TableIndex, Type, +}; use wasmer_vm::{MemoryStyle, ModuleInfo, TableStyle}; const FUNCTION_SECTION: &str = "__TEXT,wasmer_function"; diff --git a/lib/compiler-llvm/src/translator/intrinsics.rs b/lib/compiler-llvm/src/translator/intrinsics.rs index 02c54d126..506de76bc 100644 --- a/lib/compiler-llvm/src/translator/intrinsics.rs +++ b/lib/compiler-llvm/src/translator/intrinsics.rs @@ -20,12 +20,12 @@ use inkwell::{ AddressSpace, }; use std::collections::{hash_map::Entry, HashMap}; +use wasmer_compiler::CompileError; use wasmer_types::entity::{EntityRef, PrimaryMap}; use wasmer_types::{ FunctionIndex, FunctionType as FuncType, GlobalIndex, LocalFunctionIndex, MemoryIndex, Mutability, SignatureIndex, TableIndex, Type, }; -use wasmer_compiler::CompileError; use wasmer_vm::ModuleInfo as WasmerCompilerModule; use wasmer_vm::{MemoryStyle, TrapCode, VMBuiltinFunctionIndex, VMOffsets}; diff --git a/lib/compiler-singlepass/src/codegen_x64.rs b/lib/compiler-singlepass/src/codegen_x64.rs index b4f972167..8599d7320 100644 --- a/lib/compiler-singlepass/src/codegen_x64.rs +++ b/lib/compiler-singlepass/src/codegen_x64.rs @@ -3,14 +3,6 @@ use dynasmrt::{x64::Assembler, DynamicLabel}; use smallvec::{smallvec, SmallVec}; use std::collections::BTreeMap; use std::iter; -use wasmer_types::{ - entity::{EntityRef, PrimaryMap, SecondaryMap}, - FunctionType, -}; -use wasmer_types::{ - FunctionIndex, GlobalIndex, LocalFunctionIndex, LocalMemoryIndex, MemoryIndex, SignatureIndex, - TableIndex, Type, -}; use wasmer_compiler::wasmparser::{ MemoryImmediate, Operator, Type as WpType, TypeOrFuncType as WpTypeOrFuncType, }; @@ -19,6 +11,14 @@ use wasmer_compiler::{ FunctionBody, Relocation, RelocationKind, RelocationTarget, SectionBody, SectionIndex, TrapInformation, }; +use wasmer_types::{ + entity::{EntityRef, PrimaryMap, SecondaryMap}, + FunctionType, +}; +use wasmer_types::{ + FunctionIndex, GlobalIndex, LocalFunctionIndex, LocalMemoryIndex, MemoryIndex, SignatureIndex, + TableIndex, Type, +}; use wasmer_vm::{MemoryStyle, ModuleInfo, TableStyle, TrapCode, VMBuiltinFunctionIndex, VMOffsets}; /// The singlepass per-function code generator. diff --git a/lib/compiler-singlepass/src/compiler.rs b/lib/compiler-singlepass/src/compiler.rs index 6c68a61db..93170589d 100644 --- a/lib/compiler-singlepass/src/compiler.rs +++ b/lib/compiler-singlepass/src/compiler.rs @@ -9,8 +9,6 @@ use crate::codegen_x64::{ use crate::config::Singlepass; use rayon::prelude::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator}; use std::sync::Arc; -use wasmer_types::entity::{EntityRef, PrimaryMap}; -use wasmer_types::{FunctionIndex, FunctionType, LocalFunctionIndex, MemoryIndex, TableIndex}; use wasmer_compiler::wasmparser::BinaryReaderError; use wasmer_compiler::TrapInformation; use wasmer_compiler::{Compilation, CompileError, CompiledFunction, Compiler, SectionIndex}; @@ -19,6 +17,8 @@ use wasmer_compiler::{ ModuleTranslationState, Target, }; use wasmer_compiler::{FunctionBody, FunctionBodyData}; +use wasmer_types::entity::{EntityRef, PrimaryMap}; +use wasmer_types::{FunctionIndex, FunctionType, LocalFunctionIndex, MemoryIndex, TableIndex}; use wasmer_vm::{ModuleInfo, TrapCode, VMOffsets}; /// A compiler that compiles a WebAssembly module with Singlepass. diff --git a/lib/compiler-singlepass/src/config.rs b/lib/compiler-singlepass/src/config.rs index bca23d2a8..d59fd9386 100644 --- a/lib/compiler-singlepass/src/config.rs +++ b/lib/compiler-singlepass/src/config.rs @@ -3,8 +3,8 @@ use crate::compiler::SinglepassCompiler; use std::sync::Arc; -use wasmer_types::Features; use wasmer_compiler::{Compiler, CompilerConfig, CpuFeature, FunctionMiddlewareGenerator, Target}; +use wasmer_types::Features; #[derive(Debug, Clone)] pub struct Singlepass { diff --git a/lib/engine-jit/src/artifact.rs b/lib/engine-jit/src/artifact.rs index 3a6fde510..767b7f55a 100644 --- a/lib/engine-jit/src/artifact.rs +++ b/lib/engine-jit/src/artifact.rs @@ -8,11 +8,6 @@ use crate::serialize::SerializableCompilation; use crate::serialize::SerializableModule; use crate::unwind::UnwindRegistry; use std::sync::{Arc, Mutex}; -use wasmer_types::entity::{BoxedSlice, PrimaryMap}; -use wasmer_types::{ - FunctionIndex, LocalFunctionIndex, MemoryIndex, OwnedDataInitializer, SignatureIndex, - TableIndex, -}; use wasmer_compiler::{CompileError, Features, Triple}; #[cfg(feature = "compiler")] use wasmer_compiler::{CompileModuleInfo, ModuleEnvironment}; @@ -21,6 +16,11 @@ use wasmer_engine::{ }; #[cfg(feature = "compiler")] use wasmer_engine::{Engine, SerializableFunctionFrameInfo, Tunables}; +use wasmer_types::entity::{BoxedSlice, PrimaryMap}; +use wasmer_types::{ + FunctionIndex, LocalFunctionIndex, MemoryIndex, OwnedDataInitializer, SignatureIndex, + TableIndex, +}; use wasmer_vm::{FunctionBodyPtr, MemoryStyle, ModuleInfo, TableStyle, VMSharedSignatureIndex}; /// A compiled wasm module, ready to be instantiated. diff --git a/lib/engine-jit/src/code_memory.rs b/lib/engine-jit/src/code_memory.rs index 0b98e2a3f..ac92aeb62 100644 --- a/lib/engine-jit/src/code_memory.rs +++ b/lib/engine-jit/src/code_memory.rs @@ -6,8 +6,8 @@ use crate::unwind::UnwindRegistry; use std::mem::ManuallyDrop; use std::sync::Arc; use std::{cmp, mem}; -use wasmer_types::entity::{EntityRef, PrimaryMap}; use wasmer_compiler::{CompiledFunctionUnwindInfo, FunctionBody, SectionBody}; +use wasmer_types::entity::{EntityRef, PrimaryMap}; use wasmer_vm::{FunctionBodyPtr, Mmap, VMFunctionBody}; /// The optimal alignment for functions. diff --git a/lib/engine-jit/src/engine.rs b/lib/engine-jit/src/engine.rs index e969568a1..59b753961 100644 --- a/lib/engine-jit/src/engine.rs +++ b/lib/engine-jit/src/engine.rs @@ -4,15 +4,15 @@ use crate::unwind::UnwindRegistry; use crate::{CodeMemory, JITArtifact}; use std::collections::HashMap; use std::sync::{Arc, Mutex}; -use wasmer_types::entity::PrimaryMap; -use wasmer_types::Features; -use wasmer_types::{FunctionIndex, FunctionType, LocalFunctionIndex, SignatureIndex}; #[cfg(feature = "compiler")] use wasmer_compiler::Compiler; use wasmer_compiler::{ CompileError, CustomSection, CustomSectionProtection, FunctionBody, SectionIndex, Target, }; use wasmer_engine::{Artifact, DeserializeError, Engine, EngineId, Tunables}; +use wasmer_types::entity::PrimaryMap; +use wasmer_types::Features; +use wasmer_types::{FunctionIndex, FunctionType, LocalFunctionIndex, SignatureIndex}; use wasmer_vm::{ FunctionBodyPtr, ModuleInfo, SignatureRegistry, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline, diff --git a/lib/engine-jit/src/link.rs b/lib/engine-jit/src/link.rs index 77f5d806b..b76889bca 100644 --- a/lib/engine-jit/src/link.rs +++ b/lib/engine-jit/src/link.rs @@ -1,12 +1,12 @@ //! Linking for JIT-compiled code. use std::ptr::write_unaligned; -use wasmer_types::entity::{EntityRef, PrimaryMap}; -use wasmer_types::LocalFunctionIndex; use wasmer_compiler::{ JumpTable, JumpTableOffsets, Relocation, RelocationKind, RelocationTarget, Relocations, SectionIndex, }; +use wasmer_types::entity::{EntityRef, PrimaryMap}; +use wasmer_types::LocalFunctionIndex; use wasmer_vm::ModuleInfo; use wasmer_vm::{FunctionBodyPtr, VMFunctionBody}; diff --git a/lib/engine-jit/src/serialize.rs b/lib/engine-jit/src/serialize.rs index 9d9f00335..92596ff33 100644 --- a/lib/engine-jit/src/serialize.rs +++ b/lib/engine-jit/src/serialize.rs @@ -1,11 +1,11 @@ use serde::{Deserialize, Serialize}; -use wasmer_types::entity::PrimaryMap; -use wasmer_types::{FunctionIndex, LocalFunctionIndex, OwnedDataInitializer, SignatureIndex}; use wasmer_compiler::{ CompileModuleInfo, CustomSection, Dwarf, FunctionBody, JumpTableOffsets, Relocation, SectionIndex, }; use wasmer_engine::SerializableFunctionFrameInfo; +use wasmer_types::entity::PrimaryMap; +use wasmer_types::{FunctionIndex, LocalFunctionIndex, OwnedDataInitializer, SignatureIndex}; // /// The serializable function data // #[derive(Serialize, Deserialize)] diff --git a/lib/engine-native/src/artifact.rs b/lib/engine-native/src/artifact.rs index 92779d0ed..0236a7567 100644 --- a/lib/engine-native/src/artifact.rs +++ b/lib/engine-native/src/artifact.rs @@ -14,13 +14,6 @@ use std::sync::Arc; use tempfile::NamedTempFile; #[cfg(feature = "compiler")] use tracing::trace; -use wasmer_types::entity::{BoxedSlice, PrimaryMap}; -#[cfg(feature = "compiler")] -use wasmer_types::DataInitializer; -use wasmer_types::{ - FunctionIndex, LocalFunctionIndex, MemoryIndex, OwnedDataInitializer, SignatureIndex, - TableIndex, -}; use wasmer_compiler::{CompileError, Features, OperatingSystem, Symbol, SymbolRegistry, Triple}; #[cfg(feature = "compiler")] use wasmer_compiler::{ @@ -33,6 +26,13 @@ use wasmer_engine::{ use wasmer_engine::{Engine, Tunables}; #[cfg(feature = "compiler")] use wasmer_object::{emit_compilation, emit_data, get_object_for_target}; +use wasmer_types::entity::{BoxedSlice, PrimaryMap}; +#[cfg(feature = "compiler")] +use wasmer_types::DataInitializer; +use wasmer_types::{ + FunctionIndex, LocalFunctionIndex, MemoryIndex, OwnedDataInitializer, SignatureIndex, + TableIndex, +}; use wasmer_vm::{ FunctionBodyPtr, MemoryStyle, ModuleInfo, TableStyle, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline, diff --git a/lib/engine-native/src/engine.rs b/lib/engine-native/src/engine.rs index 0d2294e81..5eb30d702 100644 --- a/lib/engine-native/src/engine.rs +++ b/lib/engine-native/src/engine.rs @@ -6,12 +6,12 @@ use std::path::Path; use std::sync::Arc; use std::sync::Mutex; #[cfg(feature = "compiler")] -use wasmer_types::Features; -use wasmer_types::FunctionType; -#[cfg(feature = "compiler")] use wasmer_compiler::Compiler; use wasmer_compiler::{CompileError, Target}; use wasmer_engine::{Artifact, DeserializeError, Engine, EngineId, Tunables}; +#[cfg(feature = "compiler")] +use wasmer_types::Features; +use wasmer_types::FunctionType; use wasmer_vm::{SignatureRegistry, VMSharedSignatureIndex, VMTrampoline}; /// A WebAssembly `Native` Engine. diff --git a/lib/engine-native/src/serialize.rs b/lib/engine-native/src/serialize.rs index 5df8e22e8..644b63d03 100644 --- a/lib/engine-native/src/serialize.rs +++ b/lib/engine-native/src/serialize.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; +use wasmer_compiler::{CompileModuleInfo, SectionIndex, Symbol, SymbolRegistry}; use wasmer_types::entity::{EntityRef, PrimaryMap}; use wasmer_types::{FunctionIndex, LocalFunctionIndex, OwnedDataInitializer, SignatureIndex}; -use wasmer_compiler::{CompileModuleInfo, SectionIndex, Symbol, SymbolRegistry}; /// Serializable struct that represents the compiled metadata. #[derive(Serialize, Deserialize, Debug)] diff --git a/lib/engine/src/artifact.rs b/lib/engine/src/artifact.rs index 4be0e1ab5..9da00f6ef 100644 --- a/lib/engine/src/artifact.rs +++ b/lib/engine/src/artifact.rs @@ -5,12 +5,12 @@ use std::any::Any; use std::fs; use std::path::Path; use std::sync::Arc; +use wasmer_compiler::Features; use wasmer_types::entity::{BoxedSlice, PrimaryMap}; use wasmer_types::{ DataInitializer, FunctionIndex, LocalFunctionIndex, MemoryIndex, OwnedDataInitializer, SignatureIndex, TableIndex, }; -use wasmer_compiler::Features; use wasmer_vm::{ FunctionBodyPtr, InstanceHandle, MemoryStyle, ModuleInfo, TableStyle, VMSharedSignatureIndex, }; diff --git a/lib/engine/src/engine.rs b/lib/engine/src/engine.rs index f66ef219a..17978b351 100644 --- a/lib/engine/src/engine.rs +++ b/lib/engine/src/engine.rs @@ -5,8 +5,8 @@ use crate::{Artifact, DeserializeError}; use std::path::Path; use std::sync::atomic::{AtomicUsize, Ordering::SeqCst}; use std::sync::Arc; -use wasmer_types::FunctionType; use wasmer_compiler::{CompileError, Target}; +use wasmer_types::FunctionType; use wasmer_vm::{VMSharedSignatureIndex, VMTrampoline}; /// A unimplemented Wasmer `Engine`. diff --git a/lib/engine/src/error.rs b/lib/engine/src/error.rs index 5860d7231..87f771ebe 100644 --- a/lib/engine/src/error.rs +++ b/lib/engine/src/error.rs @@ -2,8 +2,8 @@ use crate::trap::RuntimeError; use std::io; use thiserror::Error; -use wasmer_types::ExternType; use wasmer_compiler::CompileError; +use wasmer_types::ExternType; /// The Serialize error can occur when serializing a /// compiled Module into a binary. diff --git a/lib/engine/src/trap/frame_info.rs b/lib/engine/src/trap/frame_info.rs index e46cab698..310dc5679 100644 --- a/lib/engine/src/trap/frame_info.rs +++ b/lib/engine/src/trap/frame_info.rs @@ -14,9 +14,9 @@ use crate::serialize::SerializableFunctionFrameInfo; use std::cmp; use std::collections::BTreeMap; use std::sync::{Arc, RwLock}; +use wasmer_compiler::{CompiledFunctionFrameInfo, SourceLoc, TrapInformation}; use wasmer_types::entity::{BoxedSlice, EntityRef, PrimaryMap}; use wasmer_types::LocalFunctionIndex; -use wasmer_compiler::{CompiledFunctionFrameInfo, SourceLoc, TrapInformation}; use wasmer_vm::{FunctionBodyPtr, ModuleInfo}; lazy_static::lazy_static! { diff --git a/tests/lib/engine-dummy/src/artifact.rs b/tests/lib/engine-dummy/src/artifact.rs index 59ae12349..42cda621a 100644 --- a/tests/lib/engine-dummy/src/artifact.rs +++ b/tests/lib/engine-dummy/src/artifact.rs @@ -5,15 +5,15 @@ use crate::engine::DummyEngine; #[cfg(feature = "serialize")] use serde::{Deserialize, Serialize}; use std::sync::Arc; +use wasmer_compiler::CompileError; +#[cfg(feature = "compiler")] +use wasmer_compiler::ModuleEnvironment; +use wasmer_engine::{Artifact, DeserializeError, Engine as _, SerializeError, Tunables}; use wasmer_types::entity::{BoxedSlice, PrimaryMap}; use wasmer_types::{ Features, FunctionIndex, LocalFunctionIndex, MemoryIndex, OwnedDataInitializer, SignatureIndex, TableIndex, }; -use wasmer_compiler::CompileError; -#[cfg(feature = "compiler")] -use wasmer_compiler::ModuleEnvironment; -use wasmer_engine::{Artifact, DeserializeError, Engine as _, SerializeError, Tunables}; use wasmer_vm::{ FunctionBodyPtr, MemoryStyle, ModuleInfo, TableStyle, VMContext, VMFunctionBody, VMSharedSignatureIndex, diff --git a/tests/lib/engine-dummy/src/engine.rs b/tests/lib/engine-dummy/src/engine.rs index 21f8300f6..0a8a3e255 100644 --- a/tests/lib/engine-dummy/src/engine.rs +++ b/tests/lib/engine-dummy/src/engine.rs @@ -2,9 +2,9 @@ use crate::DummyArtifact; use std::sync::Arc; -use wasmer_types::FunctionType; use wasmer_compiler::{CompileError, Features, Target}; use wasmer_engine::{Artifact, DeserializeError, Engine, EngineId, Tunables}; +use wasmer_types::FunctionType; use wasmer_vm::{ SignatureRegistry, VMContext, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline, };