Remove unneeded extern crate, macro_use, and tidy uses.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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>>,
|
||||
|
||||
@@ -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>,
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user