Remove unneeded extern crate, macro_use, and tidy uses.

This commit is contained in:
Dan Gohman
2019-11-08 17:13:06 -08:00
parent 31f8f124f5
commit 061b453255
62 changed files with 126 additions and 262 deletions

View File

@@ -1,12 +1,10 @@
use crate::r#ref::HostRef;
use crate::runtime::Store;
use crate::trampoline::generate_func_export;
use crate::trap::Trap;
use crate::types::FuncType;
use crate::values::Val;
use alloc::rc::Rc;
use alloc::vec::Vec;
use crate::trampoline::generate_func_export;
use alloc::{rc::Rc, vec::Vec};
use cranelift_codegen::ir;
use wasmtime_jit::InstanceHandle;
use wasmtime_runtime::Export;

View File

@@ -1,10 +1,8 @@
use alloc::rc::Rc;
use core::cell::{RefCell, RefMut};
use core::hash::{Hash, Hasher};
use wasmtime_jit::{CompilationStrategy, Compiler, Features};
use cranelift_codegen::settings;
use wasmtime_jit::{CompilationStrategy, Compiler, Features};
#[derive(Clone)]
pub struct Context {

View File

@@ -4,14 +4,10 @@ use crate::module::Module;
use crate::r#ref::HostRef;
use crate::runtime::Store;
use crate::{HashMap, HashSet};
use alloc::borrow::ToOwned;
use alloc::boxed::Box;
use alloc::rc::Rc;
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use alloc::{borrow::ToOwned, boxed::Box, rc::Rc, vec::Vec};
use anyhow::Result;
use core::cell::RefCell;
use wasmtime_jit::{instantiate, Resolver};
use wasmtime_runtime::{Export, InstanceHandle};

View File

@@ -16,7 +16,6 @@ mod values;
pub mod wasm;
#[macro_use]
extern crate alloc;
pub use crate::callable::Callable;

View File

@@ -4,11 +4,8 @@ use crate::types::{
ExportType, ExternType, FuncType, GlobalType, ImportType, Limits, MemoryType, Mutability,
TableType, ValType,
};
use alloc::boxed::Box;
use alloc::string::String;
use alloc::vec::Vec;
use alloc::{boxed::Box, string::String, vec::Vec};
use anyhow::Result;
use wasmparser::{validate, ExternalKind, ImportSectionEntryType, ModuleReader, SectionCode};
fn into_memory_type(mt: wasmparser::MemoryType) -> MemoryType {

View File

@@ -1,12 +1,8 @@
use crate::HashMap;
use alloc::boxed::Box;
use alloc::rc::Rc;
use alloc::string::String;
use core::cell::RefCell;
use crate::context::{create_compiler, Context};
use crate::r#ref::HostRef;
use crate::HashMap;
use alloc::{boxed::Box, rc::Rc, string::String};
use core::cell::RefCell;
use cranelift_codegen::{ir, settings};
use wasmtime_jit::{CompilationStrategy, Features};

View File

@@ -1,21 +1,18 @@
//! Support for a calling of an imported function.
use anyhow::Result;
use cranelift_entity::PrimaryMap;
use cranelift_wasm::DefinedFuncIndex;
//use target_lexicon::HOST;
use wasmtime_environ::Module;
use wasmtime_runtime::{Imports, InstanceHandle, VMFunctionBody};
use crate::runtime::Store;
use crate::{HashMap, HashSet};
use alloc::boxed::Box;
use alloc::rc::Rc;
use alloc::string::String;
use alloc::vec::Vec;
use anyhow::Result;
use core::any::Any;
use core::cell::{RefCell, RefMut};
use crate::runtime::Store;
use cranelift_entity::PrimaryMap;
use cranelift_wasm::DefinedFuncIndex;
use wasmtime_environ::Module;
use wasmtime_runtime::{Imports, InstanceHandle, VMFunctionBody};
pub(crate) fn create_handle(
module: Module,

View File

@@ -1,11 +1,13 @@
//! Support for a calling of an imported function.
use super::create_handle::create_handle;
use crate::r#ref::HostRef;
use crate::{Callable, FuncType, Store, Trap, Val};
use alloc::{boxed::Box, rc::Rc, string::ToString, vec::Vec};
use anyhow::Result;
use cranelift_codegen::ir::types;
use cranelift_codegen::ir::{InstBuilder, StackSlotData, StackSlotKind, TrapCode};
use cranelift_codegen::Context;
use cranelift_codegen::{binemit, ir, isa};
use core::cmp;
use cranelift_codegen::ir::{types, InstBuilder, StackSlotData, StackSlotKind, TrapCode};
use cranelift_codegen::{binemit, ir, isa, Context};
use cranelift_entity::{EntityRef, PrimaryMap};
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
use cranelift_wasm::{DefinedFuncIndex, FuncIndex};
@@ -13,16 +15,6 @@ use wasmtime_environ::{CompiledFunction, Export, Module};
use wasmtime_jit::CodeMemory;
use wasmtime_runtime::{InstanceHandle, VMContext, VMFunctionBody};
use alloc::boxed::Box;
use alloc::rc::Rc;
use alloc::string::ToString;
use alloc::vec::Vec;
use core::cmp;
use crate::{Callable, FuncType, Store, Trap, Val};
use super::create_handle::create_handle;
struct TrampolineState {
func: Rc<dyn Callable + 'static>,
trap: Option<HostRef<Trap>>,

View File

@@ -1,12 +1,11 @@
use super::create_handle::create_handle;
use crate::{GlobalType, Mutability, Val};
use alloc::boxed::Box;
use anyhow::Result;
use cranelift_entity::PrimaryMap;
use wasmtime_environ::Module;
use wasmtime_runtime::{InstanceHandle, VMGlobalDefinition};
use super::create_handle::create_handle;
use crate::{GlobalType, Mutability, Val};
#[allow(dead_code)]
pub struct GlobalState {
definition: Box<VMGlobalDefinition>,

View File

@@ -1,3 +1,5 @@
use super::create_handle::create_handle;
use crate::MemoryType;
use alloc::boxed::Box;
use alloc::string::ToString;
use anyhow::Result;
@@ -5,9 +7,6 @@ use cranelift_entity::PrimaryMap;
use wasmtime_environ::Module;
use wasmtime_runtime::InstanceHandle;
use super::create_handle::create_handle;
use crate::MemoryType;
#[allow(dead_code)]
pub fn create_handle_with_memory(memory: &MemoryType) -> Result<InstanceHandle> {

View File

@@ -6,15 +6,14 @@ mod global;
mod memory;
mod table;
use crate::r#ref::HostRef;
use alloc::rc::Rc;
use anyhow::Result;
use self::func::create_handle_with_function;
use self::global::create_global;
use self::memory::create_handle_with_memory;
use self::table::create_handle_with_table;
use super::{Callable, FuncType, GlobalType, MemoryType, Store, TableType, Val};
use crate::r#ref::HostRef;
use alloc::rc::Rc;
use anyhow::Result;
pub use self::global::GlobalState;

View File

@@ -1,3 +1,5 @@
use super::create_handle::create_handle;
use crate::{TableType, ValType};
use alloc::boxed::Box;
use alloc::string::ToString;
use anyhow::Result;
@@ -6,9 +8,6 @@ use cranelift_wasm::TableElementType;
use wasmtime_environ::Module;
use wasmtime_runtime::InstanceHandle;
use super::create_handle::create_handle;
use crate::{TableType, ValType};
pub fn create_handle_with_table(table: &TableType) -> Result<InstanceHandle> {
let mut module = Module::new();

View File

@@ -3,7 +3,6 @@ use crate::r#ref::{AnyRef, HostRef};
use crate::runtime::Store;
use crate::types::ValType;
use core::ptr;
use cranelift_codegen::ir;
use wasmtime_jit::RuntimeValue;

View File

@@ -12,9 +12,7 @@ use super::{
};
use alloc::boxed::Box;
use alloc::rc::Rc;
use core::mem;
use core::ptr;
use core::slice;
use core::{mem, ptr, slice};
macro_rules! declare_vec {
($name:ident, $elem_ty:path) => {

View File

@@ -1,17 +1,12 @@
use alloc::boxed::Box;
use alloc::string::String;
use alloc::vec::Vec;
use std::collections::HashMap;
use std::path::PathBuf;
use wasmparser::{self, ModuleReader, SectionCode};
use gimli;
use alloc::{boxed::Box, string::String, vec::Vec};
use gimli::{
DebugAbbrev, DebugAddr, DebugInfo, DebugLine, DebugLineStr, DebugLoc, DebugLocLists,
DebugRanges, DebugRngLists, DebugStr, DebugStrOffsets, DebugTypes, EndianSlice, LittleEndian,
LocationLists, RangeLists,
};
use std::collections::HashMap;
use std::path::PathBuf;
use wasmparser::{self, ModuleReader, SectionCode};
trait Reader: gimli::Reader<Offset = usize, Endian = LittleEndian> {}

View File

@@ -1,18 +1,14 @@
use crate::HashMap;
use alloc::vec::Vec;
use failure::Error;
use gimli;
use gimli::{AttributeValue, DebugLineOffset, DebugStr, DebuggingInformationEntry, UnitOffset};
use gimli::write;
use super::address_transform::AddressTransform;
use super::expression::{compile_expression, CompiledExpression, FunctionFrameInfo};
use super::range_info_builder::RangeInfoBuilder;
use super::unit::PendingDieRef;
use super::{DebugInputContext, Reader, TransformError};
use crate::HashMap;
use alloc::vec::Vec;
use failure::Error;
use gimli::{
write, AttributeValue, DebugLineOffset, DebugStr, DebuggingInformationEntry, UnitOffset,
};
pub(crate) enum FileAttributeContext<'a> {
Root(Option<DebugLineOffset>),

View File

@@ -7,8 +7,7 @@ use cranelift_codegen::ValueLabelsRanges;
use cranelift_entity::EntityRef;
use cranelift_wasm::{get_vmctx_value_label, DefinedFuncIndex};
use failure::Error;
use gimli::write;
use gimli::{self, Expression, Operation, Reader, ReaderOffset, Register, X86_64};
use gimli::{self, write, Expression, Operation, Reader, ReaderOffset, Register, X86_64};
use more_asserts::{assert_le, assert_lt};
#[derive(Debug)]

View File

@@ -6,9 +6,9 @@ use alloc::vec::Vec;
use core::iter::FromIterator;
use cranelift_entity::EntityRef;
use failure::Error;
use gimli;
use gimli::write;
use gimli::{DebugLine, DebugLineOffset, DebugStr, DebuggingInformationEntry, LineEncoding, Unit};
use gimli::{
write, DebugLine, DebugLineOffset, DebugStr, DebuggingInformationEntry, LineEncoding, Unit,
};
use more_asserts::assert_le;
#[derive(Debug)]

View File

@@ -1,24 +1,18 @@
use crate::gc::build_dependencies;
use crate::DebugInfoData;
use crate::HashSet;
use crate::{DebugInfoData, HashSet};
use cranelift_codegen::isa::TargetFrontendConfig;
use failure::Error;
use gimli::{
write, DebugAddr, DebugAddrBase, DebugLine, DebugStr, LocationLists, RangeLists,
UnitSectionOffset,
};
use simulate::generate_simulated_dwarf;
use thiserror::Error;
use unit::clone_unit;
use wasmtime_environ::{ModuleAddressMap, ModuleVmctxInfo, ValueLabelsRanges};
use gimli;
use gimli::{
DebugAddr, DebugAddrBase, DebugLine, DebugStr, LocationLists, RangeLists, UnitSectionOffset,
};
use gimli::write;
pub use address_transform::AddressTransform;
use unit::clone_unit;
mod address_transform;
mod attr;
mod expression;

View File

@@ -1,13 +1,10 @@
use super::address_transform::AddressTransform;
use super::DebugInputContext;
use super::Reader;
use super::{DebugInputContext, Reader};
use alloc::vec::Vec;
use cranelift_entity::EntityRef;
use cranelift_wasm::DefinedFuncIndex;
use failure::Error;
use gimli;
use gimli::write;
use gimli::{AttributeValue, DebuggingInformationEntry, RangeListsOffset};
use gimli::{write, AttributeValue, DebuggingInformationEntry, RangeListsOffset};
use more_asserts::assert_lt;
pub(crate) enum RangeInfoBuilder {

View File

@@ -1,20 +1,19 @@
use super::expression::{CompiledExpression, FunctionFrameInfo};
use super::utils::{add_internal_types, append_vmctx_info, get_function_frame_info};
use super::AddressTransform;
use crate::read_debuginfo::WasmFileInfo;
pub use crate::read_debuginfo::{DebugInfoData, FunctionMetadata, WasmType};
use crate::{HashMap, HashSet};
use alloc::string::String;
use alloc::vec::Vec;
use cranelift_entity::EntityRef;
use cranelift_wasm::get_vmctx_value_label;
use failure::Error;
use gimli::write;
use gimli::{self, LineEncoding};
use std::path::PathBuf;
use wasmtime_environ::{ModuleVmctxInfo, ValueLabelsRanges};
use gimli::write;
use gimli::{self, LineEncoding};
use super::expression::{CompiledExpression, FunctionFrameInfo};
use super::utils::{add_internal_types, append_vmctx_info, get_function_frame_info};
use super::AddressTransform;
pub use crate::read_debuginfo::{DebugInfoData, FunctionMetadata, WasmType};
const PRODUCER_NAME: &str = "wasmtime";

View File

@@ -1,16 +1,3 @@
use crate::{HashMap, HashSet};
use alloc::string::String;
use alloc::vec::Vec;
use cranelift_entity::EntityRef;
use failure::Error;
use wasmtime_environ::{ModuleVmctxInfo, ValueLabelsRanges};
use gimli;
use gimli::{AttributeValue, DebuggingInformationEntry, Unit, UnitOffset};
use gimli::write;
use super::address_transform::AddressTransform;
use super::attr::{clone_die_attributes, FileAttributeContext};
use super::expression::compile_expression;
@@ -18,6 +5,13 @@ use super::line_program::clone_line_program;
use super::range_info_builder::RangeInfoBuilder;
use super::utils::{add_internal_types, append_vmctx_info, get_function_frame_info};
use super::{DebugInputContext, Reader, TransformError};
use crate::{HashMap, HashSet};
use alloc::{string::String, vec::Vec};
use cranelift_entity::EntityRef;
use failure::Error;
use gimli::write;
use gimli::{AttributeValue, DebuggingInformationEntry, Unit, UnitOffset};
use wasmtime_environ::{ModuleVmctxInfo, ValueLabelsRanges};
pub(crate) type PendingDieRef = (write::UnitEntryId, gimli::DwAt, UnitOffset);

View File

@@ -1,13 +1,10 @@
use super::address_transform::AddressTransform;
use super::expression::{CompiledExpression, FunctionFrameInfo};
use alloc::vec::Vec;
use cranelift_wasm::DefinedFuncIndex;
use failure::Error;
use wasmtime_environ::{ModuleVmctxInfo, ValueLabelsRanges};
use gimli;
use gimli::write;
use super::address_transform::AddressTransform;
use super::expression::{CompiledExpression, FunctionFrameInfo};
use wasmtime_environ::{ModuleVmctxInfo, ValueLabelsRanges};
pub(crate) fn add_internal_types(
comp_unit: &mut write::Unit,

View File

@@ -1,11 +1,9 @@
use alloc::string::String;
use alloc::vec::Vec;
use gimli::write::{Address, Dwarf, EndianVec, Result, Sections, Writer};
use gimli::{RunTimeEndian, SectionId};
use alloc::{string::String, vec::Vec};
use core::result;
use faerie::artifact::{Decl, SectionKind};
use faerie::*;
use gimli::write::{Address, Dwarf, EndianVec, Result, Sections, Writer};
use gimli::{RunTimeEndian, SectionId};
#[derive(Clone)]
struct DebugReloc {

View File

@@ -7,7 +7,6 @@
#![deny(missing_docs)]
#[macro_use]
extern crate alloc;
use alloc::boxed::Box;

View File

@@ -22,7 +22,6 @@
)
)]
#[macro_use]
extern crate alloc;
#[cfg(not(feature = "std"))]

View File

@@ -1,5 +1,3 @@
extern crate lightbeam;
use lightbeam::translate;
use std::fs::File;
use std::io;

View File

@@ -1,19 +1,6 @@
#![cfg_attr(test, feature(test))]
#![feature(proc_macro_hygiene)]
#[macro_use]
extern crate smallvec;
extern crate capstone;
extern crate either;
pub extern crate wasmparser;
#[macro_use]
extern crate memoffset;
extern crate dynasm;
extern crate dynasmrt;
extern crate itertools;
// Just so we can implement `Signature` for `cranelift_codegen::ir::Signature`
extern crate cranelift_codegen;
extern crate multi_mut;
#[cfg(test)]
extern crate test;

View File

@@ -1,5 +1,5 @@
use crate::module::{ModuleContext, SigType, Signature};
use smallvec::SmallVec;
use smallvec::{smallvec, SmallVec};
use std::{
convert::TryInto,
fmt,

View File

@@ -7,6 +7,7 @@ use cranelift_codegen::{
ir::{self, AbiParam, Signature as CraneliftSignature},
isa,
};
use memoffset::offset_of;
use more_asserts::assert_le;
use wasmparser::{FuncType, MemoryType, ModuleReader, SectionCode, Type};

View File

@@ -2,14 +2,12 @@
extern crate alloc;
use pyo3::prelude::*;
use pyo3::types::PyTuple;
use crate::value::{pyobj_to_value, value_to_pyobj};
use alloc::rc::Rc;
use core::cell::RefCell;
use cranelift_codegen::ir;
use pyo3::prelude::*;
use pyo3::types::PyTuple;
use wasmtime_interface_types::ModuleData;
use wasmtime_jit::{Context, InstanceHandle};
use wasmtime_runtime::Export;

View File

@@ -2,12 +2,12 @@
extern crate alloc;
use pyo3::prelude::*;
use pyo3::types::{PyAny, PyDict, PyTuple};
use crate::function::Function;
use crate::memory::Memory;
use crate::value::{read_value_from, write_value_to};
use alloc::rc::Rc;
use core::cell::RefCell;
use core::cmp;
use cranelift_codegen::ir::types;
use cranelift_codegen::ir::{InstBuilder, StackSlotData, StackSlotKind};
use cranelift_codegen::Context;
@@ -15,16 +15,14 @@ use cranelift_codegen::{binemit, ir, isa};
use cranelift_entity::{EntityRef, PrimaryMap};
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
use cranelift_wasm::{DefinedFuncIndex, FuncIndex};
use pyo3::prelude::*;
use pyo3::types::{PyAny, PyDict, PyTuple};
use std::collections::{HashMap, HashSet};
use target_lexicon::HOST;
use wasmtime_environ::{CompiledFunction, Export, Module};
use wasmtime_jit::CodeMemory;
use wasmtime_runtime::{Imports, InstanceHandle, VMContext, VMFunctionBody};
use alloc::rc::Rc;
use core::cell::RefCell;
use core::cmp;
use std::collections::{HashMap, HashSet};
struct BoundPyFunction {
name: String,
obj: PyObject,

View File

@@ -2,16 +2,13 @@
extern crate alloc;
use pyo3::prelude::*;
use pyo3::types::PyDict;
use crate::function::Function;
use crate::memory::Memory;
use alloc::rc::Rc;
use core::cell::RefCell;
use cranelift_codegen::ir;
use cranelift_codegen::ir::types;
use cranelift_codegen::ir::{self, types};
use pyo3::prelude::*;
use pyo3::types::PyDict;
use wasmtime_environ::Export;
use wasmtime_interface_types::ModuleData;
use wasmtime_jit::{Context, InstanceHandle};

View File

@@ -1,13 +1,12 @@
use pyo3::exceptions::Exception;
use pyo3::prelude::*;
use pyo3::types::{PyBytes, PyDict, PySet};
use pyo3::wrap_pyfunction;
use crate::import::into_instance_from_obj;
use crate::instance::Instance;
use crate::memory::Memory;
use crate::module::Module;
use core::cell::RefCell;
use pyo3::exceptions::Exception;
use pyo3::prelude::*;
use pyo3::types::{PyBytes, PyDict, PySet};
use pyo3::wrap_pyfunction;
use std::rc::Rc;
use wasmtime_interface_types::ModuleData;

View File

@@ -2,17 +2,15 @@
extern crate alloc;
use alloc::rc::Rc;
use core::cell::RefCell;
use core::ptr;
use pyo3::class::PyBufferProtocol;
use pyo3::exceptions::BufferError;
use pyo3::ffi;
use pyo3::prelude::*;
use alloc::rc::Rc;
use core::cell::RefCell;
use core::ptr;
use std::ffi::CStr;
use std::os::raw::{c_int, c_void};
use wasmtime_environ::MemoryPlan;
use wasmtime_jit::{Context, InstanceHandle};
use wasmtime_runtime::{Export, VMMemoryDefinition, VMMemoryImport};

View File

@@ -2,9 +2,8 @@
extern crate alloc;
use pyo3::prelude::*;
use alloc::rc::Rc;
use pyo3::prelude::*;
#[pyclass]
pub struct Module {

View File

@@ -1,11 +1,10 @@
//! Utility functions to handle values conversion between abstractions/targets.
use pyo3::exceptions::Exception;
use pyo3::prelude::*;
use pyo3::types::PyAny;
use core::ptr;
use cranelift_codegen::ir;
use pyo3::exceptions::Exception;
use pyo3::prelude::*;
use pyo3::types::PyAny;
use wasmtime_interface_types::Value;
pub fn pyobj_to_value(_: Python, p: &PyAny) -> PyResult<Value> {

View File

@@ -24,15 +24,13 @@ use core::any::Any;
use core::borrow::Borrow;
use core::cell::RefCell;
use core::convert::TryFrom;
use core::slice;
use core::{mem, ptr};
use cranelift_entity::EntityRef;
use cranelift_entity::{BoxedSlice, PrimaryMap};
use core::{mem, ptr, slice};
use cranelift_entity::{BoxedSlice, EntityRef, PrimaryMap};
use cranelift_wasm::{
DefinedFuncIndex, DefinedGlobalIndex, DefinedMemoryIndex, DefinedTableIndex, FuncIndex,
GlobalIndex, GlobalInit, MemoryIndex, SignatureIndex, TableIndex,
};
use indexmap;
use memoffset::offset_of;
use more_asserts::assert_lt;
use thiserror::Error;
use wasmtime_environ::{DataInitializer, Module, TableElements, VMOffsets};

View File

@@ -23,10 +23,6 @@
)]
#![cfg_attr(not(feature = "std"), no_std)]
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate memoffset;
extern crate alloc;
mod export;

View File

@@ -8,6 +8,7 @@ use crate::vmcontext::VMContext;
use crate::RwLock;
use core::borrow::{Borrow, BorrowMut};
use core::cell::Cell;
use lazy_static::lazy_static;
#[derive(Default)]
struct TrapContext {

View File

@@ -21,6 +21,7 @@ pub struct VMFunctionImport {
mod test_vmfunction_import {
use super::VMFunctionImport;
use core::mem::size_of;
use memoffset::offset_of;
use wasmtime_environ::{Module, VMOffsets};
#[test]
@@ -76,6 +77,7 @@ pub struct VMTableImport {
mod test_vmtable_import {
use super::VMTableImport;
use core::mem::size_of;
use memoffset::offset_of;
use wasmtime_environ::{Module, VMOffsets};
#[test]
@@ -113,6 +115,7 @@ pub struct VMMemoryImport {
mod test_vmmemory_import {
use super::VMMemoryImport;
use core::mem::size_of;
use memoffset::offset_of;
use wasmtime_environ::{Module, VMOffsets};
#[test]
@@ -147,6 +150,7 @@ pub struct VMGlobalImport {
mod test_vmglobal_import {
use super::VMGlobalImport;
use core::mem::size_of;
use memoffset::offset_of;
use wasmtime_environ::{Module, VMOffsets};
#[test]
@@ -181,6 +185,7 @@ pub struct VMMemoryDefinition {
mod test_vmmemory_definition {
use super::VMMemoryDefinition;
use core::mem::size_of;
use memoffset::offset_of;
use wasmtime_environ::{Module, VMOffsets};
#[test]
@@ -224,6 +229,7 @@ pub struct VMTableDefinition {
mod test_vmtable_definition {
use super::VMTableDefinition;
use core::mem::size_of;
use memoffset::offset_of;
use wasmtime_environ::{Module, VMOffsets};
#[test]
@@ -480,6 +486,7 @@ pub struct VMCallerCheckedAnyfunc {
mod test_vmcaller_checked_anyfunc {
use super::VMCallerCheckedAnyfunc;
use core::mem::size_of;
use memoffset::offset_of;
use wasmtime_environ::{Module, VMOffsets};
#[test]

View File

@@ -1,6 +1,3 @@
extern crate bindgen;
extern crate cmake;
use cmake::Config;
use std::env;
use std::path::PathBuf;

View File

@@ -1,5 +1,3 @@
#[macro_use]
extern crate log;
extern crate alloc;
extern crate core;

View File

@@ -1,10 +1,10 @@
use crate::host;
use crate::host::{argv_environ_values, fd_prestats, fd_table};
use crate::instantiate::WASIState;
use crate::translate::*;
use crate::wasm32;
use crate::{host, wasm32};
use core::convert::TryFrom;
use cranelift_codegen::ir::types::{Type, I32, I64};
use log::{log_enabled, trace};
use std::{mem, ptr, slice, str};
use wasmtime_runtime::VMContext;

View File

@@ -1,6 +1,6 @@
use crate::host;
use crate::wasm32;
use crate::{host, wasm32};
use core::convert::TryFrom;
use log::{debug, error};
use more_asserts::assert_le;
use std::mem::{align_of, size_of, zeroed};
use std::slice;

View File

@@ -2,9 +2,8 @@
#![allow(clippy::use_self)]
use crate::wasi;
use std::convert::Infallible;
use std::fmt;
use std::num::TryFromIntError;
use std::str;
use std::{fmt, str};
use thiserror::Error;
#[derive(Clone, Copy, Debug, Error, Eq, PartialEq)]

View File

@@ -2,7 +2,6 @@
use crate::ctx::WasiCtx;
use crate::{wasi, wasi32};
use log::trace;
use wasi_common_cbindgen::wasi_common_cbindgen;
#[wasi_common_cbindgen]

View File

@@ -6,9 +6,8 @@
#![allow(non_snake_case)]
#![allow(dead_code)]
use wig::witx_wasi32_types;
use crate::wasi::*;
use wig::witx_wasi32_types;
pub type uintptr_t = u32;
pub type size_t = u32;

View File

@@ -1,5 +1,3 @@
extern crate wasi_common_cbindgen;
pub use wasi_common_cbindgen::wasi_common_cbindgen;
#[wasi_common_cbindgen]

View File

@@ -1,5 +1,3 @@
extern crate wasi_common_cbindgen;
pub use wasi_common_cbindgen::wasi_common_cbindgen;
#[wasi_common_cbindgen]

View File

@@ -1,5 +1,3 @@
extern crate wasi_common_cbindgen;
pub use wasi_common_cbindgen::wasi_common_cbindgen;
#[wasi_common_cbindgen]

View File

@@ -1,5 +1,3 @@
extern crate wasi_common_cbindgen;
pub use wasi_common_cbindgen::wasi_common_cbindgen;
#[wasi_common_cbindgen]

View File

@@ -1,5 +1,3 @@
extern crate wasi_common_cbindgen;
pub use wasi_common_cbindgen::wasi_common_cbindgen;
#[wasi_common_cbindgen]

View File

@@ -1,7 +1,4 @@
extern crate proc_macro;
extern crate proc_macro2;
extern crate quote;
extern crate witx;
mod raw_types;
mod utils;

View File

@@ -21,9 +21,6 @@
)]
#![cfg(windows)]
#[macro_use]
extern crate bitflags;
pub mod file;
pub mod time;
pub mod winerror;

View File

@@ -9,8 +9,8 @@ publish = false
cargo-fuzz = true
[dependencies]
wasmtime-environ = { path = "../wasmtime-environ" }
wasmtime-jit = { path = "../wasmtime-jit" }
wasmtime-environ = { path = "../crates/environ" }
wasmtime-jit = { path = "../crates/jit" }
cranelift-codegen = { version = "0.49", features = ["enable-serde"] }
cranelift-wasm = { version = "0.49", features = ["enable-serde"] }
cranelift-native = "0.49"

View File

@@ -1,13 +1,13 @@
#![no_main]
#[macro_use]
extern crate libfuzzer_sys;
extern crate alloc;
extern crate core;
extern crate libfuzzer_sys;
use alloc::rc::Rc;
use core::cell::RefCell;
use cranelift_codegen::settings;
use libfuzzer_sys::fuzz_target;
use std::collections::HashMap;
use wasmparser::validate;
use wasmtime_jit::{CompilationStrategy, CompiledModule, Compiler, NullResolver};

View File

@@ -1,14 +1,9 @@
#![no_main]
#[macro_use]
extern crate libfuzzer_sys;
extern crate cranelift_codegen;
extern crate cranelift_native;
extern crate wasmparser;
extern crate wasmtime_environ;
extern crate wasmtime_jit;
use cranelift_codegen::settings;
use libfuzzer_sys::fuzz_target;
use wasmparser::validate;
use wasmtime_jit::{instantiate, CompilationStrategy, Compiler, NullResolver};

View File

@@ -1,14 +1,9 @@
#![no_main]
#[macro_use]
extern crate libfuzzer_sys;
extern crate cranelift_codegen;
extern crate cranelift_native;
extern crate wasmparser;
extern crate wasmtime_environ;
extern crate wasmtime_jit;
use cranelift_codegen::settings;
use libfuzzer_sys::fuzz_target;
use wasmtime_jit::{instantiate, CompilationStrategy, Compiler, NullResolver};
fuzz_target!(|data: &[u8]| {

View File

@@ -29,11 +29,9 @@
)
)]
use cranelift_codegen::isa;
use cranelift_codegen::settings;
use cranelift_codegen::settings::Configurable;
use cranelift_codegen::{isa, settings};
use cranelift_entity::EntityRef;
use cranelift_native;
use cranelift_wasm::DefinedMemoryIndex;
use docopt::Docopt;
use faerie::Artifact;
@@ -41,21 +39,18 @@ use serde::Deserialize;
use std::error::Error;
use std::fmt::format;
use std::fs::File;
use std::io;
use std::io::prelude::*;
use std::path::Path;
use std::path::PathBuf;
use std::process;
use std::str;
use std::path::{Path, PathBuf};
use std::str::FromStr;
use std::{io, process, str};
use target_lexicon::Triple;
use wasmtime_cli::pick_compilation_strategy;
use wasmtime_debug::{emit_debugsections, read_debuginfo};
#[cfg(feature = "lightbeam")]
use wasmtime_environ::Lightbeam;
use wasmtime_environ::{cache_create_new_config, cache_init};
use wasmtime_environ::{
Compiler, Cranelift, ModuleEnvironment, ModuleVmctxInfo, Tunables, VMOffsets,
cache_create_new_config, cache_init, Compiler, Cranelift, ModuleEnvironment, ModuleVmctxInfo,
Tunables, VMOffsets,
};
use wasmtime_jit::CompilationStrategy;
use wasmtime_obj::emit_module;

View File

@@ -34,13 +34,11 @@ use anyhow::{bail, Context as _, Result};
use cranelift_codegen::settings;
use cranelift_codegen::settings::Configurable;
use docopt::Docopt;
use pretty_env_logger;
use serde::Deserialize;
use std::collections::HashMap;
use std::ffi::OsStr;
use std::fs::File;
use std::path::Component;
use std::path::Path;
use std::path::{Component, Path};
use std::process::exit;
use wasi_common::preopen_dir;
use wasmtime_api::{Config, Engine, HostRef, Instance, Module, Store};
@@ -49,10 +47,9 @@ use wasmtime_environ::{cache_create_new_config, cache_init};
use wasmtime_interface_types::ModuleData;
use wasmtime_jit::Features;
use wasmtime_wasi::instantiate_wasi;
use wasmtime_wast::instantiate_spectest;
#[cfg(feature = "wasi-c")]
use wasmtime_wasi_c::instantiate_wasi_c;
use wasmtime_wast::instantiate_spectest;
const USAGE: &str = "
Wasm runner.

View File

@@ -1,8 +1,5 @@
use cranelift_native;
use cranelift_codegen::isa;
use cranelift_codegen::settings;
use cranelift_codegen::settings::Configurable;
use cranelift_codegen::{isa, settings};
use std::path::Path;
use wasmtime_jit::{CompilationStrategy, Compiler, Features};
use wasmtime_wast::WastContext;