Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify deps #2662

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/api/src/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ pub use wasmer_vm::{raise_user_trap, MemoryError};
pub mod vm {
//! The `vm` module re-exports wasmer-vm types.

pub use wasmer_types::{MemoryStyle, TableStyle};
pub use wasmer_vm::{
Memory, MemoryError, MemoryStyle, Table, TableStyle, VMExtern, VMMemoryDefinition,
VMTableDefinition,
Memory, MemoryError, Table, VMExtern, VMMemoryDefinition, VMTableDefinition,
};
}

Expand Down
6 changes: 2 additions & 4 deletions lib/api/src/sys/tunables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ use std::sync::Arc;
use target_lexicon::{OperatingSystem, PointerWidth};
use wasmer_compiler::Target;
use wasmer_engine::Tunables;
use wasmer_types::{MemoryStyle, TableStyle};
use wasmer_vm::MemoryError;
use wasmer_vm::{
LinearMemory, LinearTable, Memory, MemoryStyle, Table, TableStyle, VMMemoryDefinition,
VMTableDefinition,
};
use wasmer_vm::{LinearMemory, LinearTable, Memory, Table, VMMemoryDefinition, VMTableDefinition};

/// Tunable parameters for WebAssembly compilation.
/// This is the reference implementation of the `Tunables` trait,
Expand Down
1 change: 0 additions & 1 deletion lib/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ wasmer-engine = { version = "2.0.0", path = "../engine" }
wasmer-engine-universal = { version = "2.0.0", path = "../engine-universal", optional = true }
wasmer-engine-dylib = { version = "2.0.0", path = "../engine-dylib", optional = true }
wasmer-engine-staticlib = { version = "2.0.0", path = "../engine-staticlib", optional = true }
wasmer-vm = { version = "2.0.0", path = "../vm" }
wasmer-wasi = { version = "2.0.0", path = "../wasi", optional = true }
wasmer-wasi-experimental-io-devices = { version = "2.0.0", path = "../wasi-experimental-io-devices", optional = true }
wasmer-wast = { version = "2.0.0", path = "../../tests/lib/wast", optional = true }
Expand Down
1 change: 0 additions & 1 deletion lib/compiler-cranelift/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ edition = "2018"

[dependencies]
wasmer-compiler = { path = "../compiler", version = "2.0.0", features = ["translator"], default-features = false }
wasmer-vm = { path = "../vm", version = "2.0.0" }
wasmer-types = { path = "../types", version = "2.0.0", default-features = false, features = ["std"] }
cranelift-entity = { version = "0.76", default-features = false }
cranelift-codegen = { version = "0.76", default-features = false, features = ["x86", "arm64"] }
Expand Down
6 changes: 2 additions & 4 deletions lib/compiler-cranelift/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ use wasmer_compiler::{
};
#[cfg(all(target_arch = "x86_64", target_os = "linux"))]
use wasmer_compiler::{
CustomSection, CustomSectionProtection, Relocation, RelocationKind, RelocationTarget,
CustomSection, CustomSectionProtection, LibCall, Relocation, RelocationKind, RelocationTarget,
SectionBody,
};
use wasmer_types::entity::{EntityRef, PrimaryMap};
use wasmer_types::{FunctionIndex, LocalFunctionIndex, SignatureIndex};
#[cfg(all(target_arch = "x86_64", target_os = "linux"))]
use wasmer_vm::libcalls::LibCall;

/// A compiler that compiles a WebAssembly module with Cranelift, translating the Wasm to Cranelift IR,
/// optimizing it and then translating to assembly.
Expand Down Expand Up @@ -274,7 +272,7 @@ impl Compiler for CraneliftCompiler {
.into_iter()
.collect::<PrimaryMap<SignatureIndex, FunctionBody>>();

use wasmer_vm::VMOffsets;
use wasmer_types::VMOffsets;
let offsets = VMOffsets::new_for_trampolines(frontend_config.pointer_bytes());
// dynamic function trampolines (only for imported functions)
let dynamic_function_trampolines = module
Expand Down
8 changes: 3 additions & 5 deletions lib/compiler-cranelift/src/func_environ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ use wasmer_compiler::{WasmError, WasmResult};
use wasmer_types::entity::EntityRef;
use wasmer_types::entity::PrimaryMap;
use wasmer_types::{
FunctionIndex, FunctionType, GlobalIndex, LocalFunctionIndex, MemoryIndex, ModuleInfo,
SignatureIndex, TableIndex, Type as WasmerType,
FunctionIndex, FunctionType, GlobalIndex, LocalFunctionIndex, MemoryIndex, MemoryStyle,
ModuleInfo, SignatureIndex, TableIndex, TableStyle, Type as WasmerType, VMBuiltinFunctionIndex,
VMOffsets,
};
use wasmer_vm::VMBuiltinFunctionIndex;
use wasmer_vm::VMOffsets;
use wasmer_vm::{MemoryStyle, TableStyle};

/// Compute an `ir::ExternalName` for a given wasm function index.
pub fn get_function_name(func_index: FunctionIndex) -> ir::ExternalName {
Expand Down
3 changes: 1 addition & 2 deletions lib/compiler-cranelift/src/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ use wasmer_compiler::{JumpTable, Relocation, RelocationTarget, TrapInformation};
#[cfg(all(target_arch = "x86_64", target_os = "linux"))]
use wasmer_compiler::{RelocationKind, SectionIndex};
use wasmer_types::entity::EntityRef;
use wasmer_types::{FunctionIndex, LocalFunctionIndex, ModuleInfo};
use wasmer_vm::TrapCode;
use wasmer_types::{FunctionIndex, LocalFunctionIndex, ModuleInfo, TrapCode};

/// Implementation of a relocation sink that just saves all the information for later
pub(crate) struct RelocSink<'a> {
Expand Down
3 changes: 1 addition & 2 deletions lib/compiler-cranelift/src/trampoline/dynamic_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ use std::mem;

use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
use wasmer_compiler::{CompileError, FunctionBody};
use wasmer_types::FunctionType;
use wasmer_vm::VMOffsets;
use wasmer_types::{FunctionType, VMOffsets};

/// Create a trampoline for invoking a WebAssembly function.
pub fn make_trampoline_dynamic_function(
Expand Down
8 changes: 3 additions & 5 deletions lib/compiler-cranelift/src/translator/translation_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ use cranelift_codegen::ir::{self, AbiParam};
use cranelift_codegen::isa::TargetFrontendConfig;
use cranelift_entity::{EntityRef as CraneliftEntityRef, SecondaryMap as CraneliftSecondaryMap};
use cranelift_frontend::FunctionBuilder;
use wasmer_compiler::wasm_unsupported;
use wasmer_compiler::wasmparser;
use wasmer_compiler::{JumpTable, RelocationKind};
use wasmer_compiler::{WasmError, WasmResult};
use wasmer_compiler::{
wasm_unsupported, wasmparser, JumpTable, LibCall, RelocationKind, 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
pub fn signature_to_cranelift_ir(
Expand Down
1 change: 0 additions & 1 deletion lib/compiler-llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ edition = "2018"

[dependencies]
wasmer-compiler = { path = "../compiler", version = "2.0.0", features = ["translator"] }
wasmer-vm = { path = "../vm", version = "2.0.0" }
wasmer-types = { path = "../types", version = "2.0.0" }
target-lexicon = { version = "0.12.2", default-features = false }
smallvec = "1.6"
Expand Down
3 changes: 1 addition & 2 deletions lib/compiler-llvm/src/abi/aarch64_systemv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use inkwell::{
AddressSpace,
};
use wasmer_compiler::CompileError;
use wasmer_types::{FunctionType as FuncSig, Type};
use wasmer_vm::VMOffsets;
use wasmer_types::{FunctionType as FuncSig, Type, VMOffsets};

use std::convert::TryInto;

Expand Down
3 changes: 1 addition & 2 deletions lib/compiler-llvm/src/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ use inkwell::{
values::{BasicValueEnum, CallSiteValue, FunctionValue, PointerValue},
};
use wasmer_compiler::CompileError;
use wasmer_types::FunctionType as FuncSig;
use wasmer_vm::VMOffsets;
use wasmer_types::{FunctionType as FuncSig, VMOffsets};

mod aarch64_systemv;
mod x86_64_systemv;
Expand Down
3 changes: 1 addition & 2 deletions lib/compiler-llvm/src/abi/x86_64_systemv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ use inkwell::{
AddressSpace,
};
use wasmer_compiler::CompileError;
use wasmer_types::{FunctionType as FuncSig, Type};
use wasmer_vm::VMOffsets;
use wasmer_types::{FunctionType as FuncSig, Type, VMOffsets};

use std::convert::TryInto;

Expand Down
3 changes: 1 addition & 2 deletions lib/compiler-llvm/src/object_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ use std::num::TryFromIntError;

use wasmer_compiler::{
CompileError, CompiledFunctionFrameInfo, CustomSection, CustomSectionProtection,
CustomSections, FunctionAddressMap, FunctionBody, InstructionAddressMap, Relocation,
CustomSections, FunctionAddressMap, FunctionBody, InstructionAddressMap, LibCall, Relocation,
RelocationKind, RelocationTarget, SectionBody, SectionIndex, SourceLoc,
};
use wasmer_types::entity::{PrimaryMap, SecondaryMap};
use wasmer_vm::libcalls::LibCall;

fn map_tryfromint_err(error: TryFromIntError) -> CompileError {
CompileError::Codegen(format!("int doesn't fit: {}", error))
Expand Down
5 changes: 2 additions & 3 deletions lib/compiler-llvm/src/translator/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ use wasmer_compiler::{
};
use wasmer_types::entity::PrimaryMap;
use wasmer_types::{
FunctionIndex, FunctionType, GlobalIndex, LocalFunctionIndex, MemoryIndex, ModuleInfo,
SignatureIndex, TableIndex, Type,
FunctionIndex, FunctionType, GlobalIndex, LocalFunctionIndex, MemoryIndex, MemoryStyle,
ModuleInfo, SignatureIndex, TableIndex, TableStyle, Type, VMOffsets,
};
use wasmer_vm::{MemoryStyle, TableStyle, VMOffsets};

const FUNCTION_SECTION: &str = "__TEXT,wasmer_function";

Expand Down
4 changes: 2 additions & 2 deletions lib/compiler-llvm/src/translator/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ use wasmer_compiler::CompileError;
use wasmer_types::entity::{EntityRef, PrimaryMap};
use wasmer_types::{
FunctionIndex, FunctionType as FuncType, GlobalIndex, LocalFunctionIndex, MemoryIndex,
ModuleInfo as WasmerCompilerModule, Mutability, SignatureIndex, TableIndex, Type,
MemoryStyle, ModuleInfo as WasmerCompilerModule, Mutability, SignatureIndex, TableIndex,
TrapCode, Type, VMBuiltinFunctionIndex, VMOffsets,
};
use wasmer_vm::{MemoryStyle, TrapCode, VMBuiltinFunctionIndex, VMOffsets};

pub fn type_to_llvm_ptr<'ctx>(
intrinsics: &Intrinsics<'ctx>,
Expand Down
1 change: 0 additions & 1 deletion lib/compiler-singlepass/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ edition = "2018"

[dependencies]
wasmer-compiler = { path = "../compiler", version = "2.0.0", features = ["translator"], default-features = false }
wasmer-vm = { path = "../vm", version = "2.0.0" }
wasmer-types = { path = "../types", version = "2.0.0", default-features = false, features = ["std"] }
rayon = { version = "1.5", optional = true }
hashbrown = { version = "0.11", optional = true }
Expand Down
6 changes: 3 additions & 3 deletions lib/compiler-singlepass/src/codegen_x64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ use wasmer_types::{
FunctionType,
};
use wasmer_types::{
FunctionIndex, GlobalIndex, LocalFunctionIndex, LocalMemoryIndex, MemoryIndex, ModuleInfo,
SignatureIndex, TableIndex, Type,
FunctionIndex, GlobalIndex, LocalFunctionIndex, LocalMemoryIndex, MemoryIndex, MemoryStyle,
ModuleInfo, SignatureIndex, TableIndex, TableStyle, TrapCode, Type, VMBuiltinFunctionIndex,
VMOffsets,
};
use wasmer_vm::{MemoryStyle, TableStyle, TrapCode, VMBuiltinFunctionIndex, VMOffsets};

/// The singlepass per-function code generator.
pub struct FuncGen<'a> {
Expand Down
6 changes: 3 additions & 3 deletions lib/compiler-singlepass/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ use wasmer_compiler::{
};
use wasmer_types::entity::{EntityRef, PrimaryMap};
use wasmer_types::{
FunctionIndex, FunctionType, LocalFunctionIndex, MemoryIndex, ModuleInfo, TableIndex,
FunctionIndex, FunctionType, LocalFunctionIndex, MemoryIndex, ModuleInfo, TableIndex, TrapCode,
VMOffsets,
};
use wasmer_vm::{TrapCode, VMOffsets};

/// A compiler that compiles a WebAssembly module with Singlepass.
/// It does the compilation in one pass
Expand Down Expand Up @@ -211,7 +211,7 @@ mod tests {
use std::str::FromStr;
use target_lexicon::triple;
use wasmer_compiler::{CpuFeature, Features, Triple};
use wasmer_vm::{MemoryStyle, TableStyle};
use wasmer_types::{MemoryStyle, TableStyle};

fn dummy_compilation_ingredients<'a>() -> (
CompileModuleInfo,
Expand Down
3 changes: 1 addition & 2 deletions lib/compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ readme = "README.md"
edition = "2018"

[dependencies]
wasmer-vm = { path = "../vm", version = "2.0.0" }
wasmer-types = { path = "../types", version = "2.0.0", default-features = false }
wasmparser = { version = "0.78", optional = true, default-features = false }
target-lexicon = { version = "0.12.2", default-features = false }
Expand All @@ -33,7 +32,7 @@ translator = ["wasmparser"]
std = ["wasmer-types/std"]
core = ["hashbrown", "wasmer-types/core"]
enable-serde = ["serde", "serde_bytes", "wasmer-types/enable-serde"]
enable-rkyv = ["rkyv", "wasmer-vm/enable-rkyv", "wasmer-types/enable-rkyv"]
enable-rkyv = ["rkyv", "wasmer-types/enable-rkyv"]

[badges]
maintenance = { status = "experimental" }
2 changes: 2 additions & 0 deletions lib/compiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ mod unwind;
#[cfg(feature = "translator")]
#[macro_use]
mod translator;
mod libcall;
mod section;
mod sourceloc;

Expand All @@ -77,6 +78,7 @@ pub use crate::function::{
Functions, TrampolinesSection,
};
pub use crate::jump_table::{JumpTable, JumpTableOffsets};
pub use crate::libcall::LibCall;
pub use crate::module::CompileModuleInfo;
pub use crate::relocation::{Relocation, RelocationKind, RelocationTarget, Relocations};
pub use crate::section::{CustomSection, CustomSectionProtection, SectionBody, SectionIndex};
Expand Down
Loading