Remove unneeded extern crate, macro_use, and tidy uses.
This commit is contained in:
@@ -1,12 +1,10 @@
|
|||||||
use crate::r#ref::HostRef;
|
use crate::r#ref::HostRef;
|
||||||
use crate::runtime::Store;
|
use crate::runtime::Store;
|
||||||
|
use crate::trampoline::generate_func_export;
|
||||||
use crate::trap::Trap;
|
use crate::trap::Trap;
|
||||||
use crate::types::FuncType;
|
use crate::types::FuncType;
|
||||||
use crate::values::Val;
|
use crate::values::Val;
|
||||||
use alloc::rc::Rc;
|
use alloc::{rc::Rc, vec::Vec};
|
||||||
use alloc::vec::Vec;
|
|
||||||
|
|
||||||
use crate::trampoline::generate_func_export;
|
|
||||||
use cranelift_codegen::ir;
|
use cranelift_codegen::ir;
|
||||||
use wasmtime_jit::InstanceHandle;
|
use wasmtime_jit::InstanceHandle;
|
||||||
use wasmtime_runtime::Export;
|
use wasmtime_runtime::Export;
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
use alloc::rc::Rc;
|
use alloc::rc::Rc;
|
||||||
use core::cell::{RefCell, RefMut};
|
use core::cell::{RefCell, RefMut};
|
||||||
use core::hash::{Hash, Hasher};
|
use core::hash::{Hash, Hasher};
|
||||||
|
|
||||||
use wasmtime_jit::{CompilationStrategy, Compiler, Features};
|
|
||||||
|
|
||||||
use cranelift_codegen::settings;
|
use cranelift_codegen::settings;
|
||||||
|
use wasmtime_jit::{CompilationStrategy, Compiler, Features};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Context {
|
pub struct Context {
|
||||||
|
|||||||
@@ -4,14 +4,10 @@ use crate::module::Module;
|
|||||||
use crate::r#ref::HostRef;
|
use crate::r#ref::HostRef;
|
||||||
use crate::runtime::Store;
|
use crate::runtime::Store;
|
||||||
use crate::{HashMap, HashSet};
|
use crate::{HashMap, HashSet};
|
||||||
use alloc::borrow::ToOwned;
|
|
||||||
use alloc::boxed::Box;
|
|
||||||
use alloc::rc::Rc;
|
|
||||||
use alloc::string::{String, ToString};
|
use alloc::string::{String, ToString};
|
||||||
use alloc::vec::Vec;
|
use alloc::{borrow::ToOwned, boxed::Box, rc::Rc, vec::Vec};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use core::cell::RefCell;
|
use core::cell::RefCell;
|
||||||
|
|
||||||
use wasmtime_jit::{instantiate, Resolver};
|
use wasmtime_jit::{instantiate, Resolver};
|
||||||
use wasmtime_runtime::{Export, InstanceHandle};
|
use wasmtime_runtime::{Export, InstanceHandle};
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ mod values;
|
|||||||
|
|
||||||
pub mod wasm;
|
pub mod wasm;
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
pub use crate::callable::Callable;
|
pub use crate::callable::Callable;
|
||||||
|
|||||||
@@ -4,11 +4,8 @@ use crate::types::{
|
|||||||
ExportType, ExternType, FuncType, GlobalType, ImportType, Limits, MemoryType, Mutability,
|
ExportType, ExternType, FuncType, GlobalType, ImportType, Limits, MemoryType, Mutability,
|
||||||
TableType, ValType,
|
TableType, ValType,
|
||||||
};
|
};
|
||||||
use alloc::boxed::Box;
|
use alloc::{boxed::Box, string::String, vec::Vec};
|
||||||
use alloc::string::String;
|
|
||||||
use alloc::vec::Vec;
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
|
||||||
use wasmparser::{validate, ExternalKind, ImportSectionEntryType, ModuleReader, SectionCode};
|
use wasmparser::{validate, ExternalKind, ImportSectionEntryType, ModuleReader, SectionCode};
|
||||||
|
|
||||||
fn into_memory_type(mt: wasmparser::MemoryType) -> MemoryType {
|
fn into_memory_type(mt: wasmparser::MemoryType) -> MemoryType {
|
||||||
|
|||||||
@@ -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::context::{create_compiler, Context};
|
||||||
use crate::r#ref::HostRef;
|
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 cranelift_codegen::{ir, settings};
|
||||||
use wasmtime_jit::{CompilationStrategy, Features};
|
use wasmtime_jit::{CompilationStrategy, Features};
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,18 @@
|
|||||||
//! Support for a calling of an imported function.
|
//! Support for a calling of an imported function.
|
||||||
|
|
||||||
use anyhow::Result;
|
use crate::runtime::Store;
|
||||||
use cranelift_entity::PrimaryMap;
|
|
||||||
use cranelift_wasm::DefinedFuncIndex;
|
|
||||||
//use target_lexicon::HOST;
|
|
||||||
use wasmtime_environ::Module;
|
|
||||||
use wasmtime_runtime::{Imports, InstanceHandle, VMFunctionBody};
|
|
||||||
|
|
||||||
use crate::{HashMap, HashSet};
|
use crate::{HashMap, HashSet};
|
||||||
use alloc::boxed::Box;
|
use alloc::boxed::Box;
|
||||||
use alloc::rc::Rc;
|
use alloc::rc::Rc;
|
||||||
use alloc::string::String;
|
use alloc::string::String;
|
||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
|
use anyhow::Result;
|
||||||
use core::any::Any;
|
use core::any::Any;
|
||||||
use core::cell::{RefCell, RefMut};
|
use core::cell::{RefCell, RefMut};
|
||||||
|
use cranelift_entity::PrimaryMap;
|
||||||
use crate::runtime::Store;
|
use cranelift_wasm::DefinedFuncIndex;
|
||||||
|
use wasmtime_environ::Module;
|
||||||
|
use wasmtime_runtime::{Imports, InstanceHandle, VMFunctionBody};
|
||||||
|
|
||||||
pub(crate) fn create_handle(
|
pub(crate) fn create_handle(
|
||||||
module: Module,
|
module: Module,
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
//! Support for a calling of an imported function.
|
//! Support for a calling of an imported function.
|
||||||
|
|
||||||
|
use super::create_handle::create_handle;
|
||||||
use crate::r#ref::HostRef;
|
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 anyhow::Result;
|
||||||
use cranelift_codegen::ir::types;
|
use core::cmp;
|
||||||
use cranelift_codegen::ir::{InstBuilder, StackSlotData, StackSlotKind, TrapCode};
|
use cranelift_codegen::ir::{types, InstBuilder, StackSlotData, StackSlotKind, TrapCode};
|
||||||
use cranelift_codegen::Context;
|
use cranelift_codegen::{binemit, ir, isa, Context};
|
||||||
use cranelift_codegen::{binemit, ir, isa};
|
|
||||||
use cranelift_entity::{EntityRef, PrimaryMap};
|
use cranelift_entity::{EntityRef, PrimaryMap};
|
||||||
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
|
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
|
||||||
use cranelift_wasm::{DefinedFuncIndex, FuncIndex};
|
use cranelift_wasm::{DefinedFuncIndex, FuncIndex};
|
||||||
@@ -13,16 +15,6 @@ use wasmtime_environ::{CompiledFunction, Export, Module};
|
|||||||
use wasmtime_jit::CodeMemory;
|
use wasmtime_jit::CodeMemory;
|
||||||
use wasmtime_runtime::{InstanceHandle, VMContext, VMFunctionBody};
|
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 {
|
struct TrampolineState {
|
||||||
func: Rc<dyn Callable + 'static>,
|
func: Rc<dyn Callable + 'static>,
|
||||||
trap: Option<HostRef<Trap>>,
|
trap: Option<HostRef<Trap>>,
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
|
use super::create_handle::create_handle;
|
||||||
|
use crate::{GlobalType, Mutability, Val};
|
||||||
use alloc::boxed::Box;
|
use alloc::boxed::Box;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use cranelift_entity::PrimaryMap;
|
use cranelift_entity::PrimaryMap;
|
||||||
use wasmtime_environ::Module;
|
use wasmtime_environ::Module;
|
||||||
use wasmtime_runtime::{InstanceHandle, VMGlobalDefinition};
|
use wasmtime_runtime::{InstanceHandle, VMGlobalDefinition};
|
||||||
|
|
||||||
use super::create_handle::create_handle;
|
|
||||||
use crate::{GlobalType, Mutability, Val};
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub struct GlobalState {
|
pub struct GlobalState {
|
||||||
definition: Box<VMGlobalDefinition>,
|
definition: Box<VMGlobalDefinition>,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
use super::create_handle::create_handle;
|
||||||
|
use crate::MemoryType;
|
||||||
use alloc::boxed::Box;
|
use alloc::boxed::Box;
|
||||||
use alloc::string::ToString;
|
use alloc::string::ToString;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
@@ -5,9 +7,6 @@ use cranelift_entity::PrimaryMap;
|
|||||||
use wasmtime_environ::Module;
|
use wasmtime_environ::Module;
|
||||||
use wasmtime_runtime::InstanceHandle;
|
use wasmtime_runtime::InstanceHandle;
|
||||||
|
|
||||||
use super::create_handle::create_handle;
|
|
||||||
use crate::MemoryType;
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
|
||||||
pub fn create_handle_with_memory(memory: &MemoryType) -> Result<InstanceHandle> {
|
pub fn create_handle_with_memory(memory: &MemoryType) -> Result<InstanceHandle> {
|
||||||
|
|||||||
@@ -6,15 +6,14 @@ mod global;
|
|||||||
mod memory;
|
mod memory;
|
||||||
mod table;
|
mod table;
|
||||||
|
|
||||||
use crate::r#ref::HostRef;
|
|
||||||
use alloc::rc::Rc;
|
|
||||||
use anyhow::Result;
|
|
||||||
|
|
||||||
use self::func::create_handle_with_function;
|
use self::func::create_handle_with_function;
|
||||||
use self::global::create_global;
|
use self::global::create_global;
|
||||||
use self::memory::create_handle_with_memory;
|
use self::memory::create_handle_with_memory;
|
||||||
use self::table::create_handle_with_table;
|
use self::table::create_handle_with_table;
|
||||||
use super::{Callable, FuncType, GlobalType, MemoryType, Store, TableType, Val};
|
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;
|
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::boxed::Box;
|
||||||
use alloc::string::ToString;
|
use alloc::string::ToString;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
@@ -6,9 +8,6 @@ use cranelift_wasm::TableElementType;
|
|||||||
use wasmtime_environ::Module;
|
use wasmtime_environ::Module;
|
||||||
use wasmtime_runtime::InstanceHandle;
|
use wasmtime_runtime::InstanceHandle;
|
||||||
|
|
||||||
use super::create_handle::create_handle;
|
|
||||||
use crate::{TableType, ValType};
|
|
||||||
|
|
||||||
pub fn create_handle_with_table(table: &TableType) -> Result<InstanceHandle> {
|
pub fn create_handle_with_table(table: &TableType) -> Result<InstanceHandle> {
|
||||||
let mut module = Module::new();
|
let mut module = Module::new();
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ use crate::r#ref::{AnyRef, HostRef};
|
|||||||
use crate::runtime::Store;
|
use crate::runtime::Store;
|
||||||
use crate::types::ValType;
|
use crate::types::ValType;
|
||||||
use core::ptr;
|
use core::ptr;
|
||||||
|
|
||||||
use cranelift_codegen::ir;
|
use cranelift_codegen::ir;
|
||||||
use wasmtime_jit::RuntimeValue;
|
use wasmtime_jit::RuntimeValue;
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,7 @@ use super::{
|
|||||||
};
|
};
|
||||||
use alloc::boxed::Box;
|
use alloc::boxed::Box;
|
||||||
use alloc::rc::Rc;
|
use alloc::rc::Rc;
|
||||||
use core::mem;
|
use core::{mem, ptr, slice};
|
||||||
use core::ptr;
|
|
||||||
use core::slice;
|
|
||||||
|
|
||||||
macro_rules! declare_vec {
|
macro_rules! declare_vec {
|
||||||
($name:ident, $elem_ty:path) => {
|
($name:ident, $elem_ty:path) => {
|
||||||
|
|||||||
@@ -1,17 +1,12 @@
|
|||||||
use alloc::boxed::Box;
|
use alloc::{boxed::Box, string::String, vec::Vec};
|
||||||
use alloc::string::String;
|
|
||||||
use alloc::vec::Vec;
|
|
||||||
use std::collections::HashMap;
|
|
||||||
use std::path::PathBuf;
|
|
||||||
use wasmparser::{self, ModuleReader, SectionCode};
|
|
||||||
|
|
||||||
use gimli;
|
|
||||||
|
|
||||||
use gimli::{
|
use gimli::{
|
||||||
DebugAbbrev, DebugAddr, DebugInfo, DebugLine, DebugLineStr, DebugLoc, DebugLocLists,
|
DebugAbbrev, DebugAddr, DebugInfo, DebugLine, DebugLineStr, DebugLoc, DebugLocLists,
|
||||||
DebugRanges, DebugRngLists, DebugStr, DebugStrOffsets, DebugTypes, EndianSlice, LittleEndian,
|
DebugRanges, DebugRngLists, DebugStr, DebugStrOffsets, DebugTypes, EndianSlice, LittleEndian,
|
||||||
LocationLists, RangeLists,
|
LocationLists, RangeLists,
|
||||||
};
|
};
|
||||||
|
use std::collections::HashMap;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use wasmparser::{self, ModuleReader, SectionCode};
|
||||||
|
|
||||||
trait Reader: gimli::Reader<Offset = usize, Endian = LittleEndian> {}
|
trait Reader: gimli::Reader<Offset = usize, Endian = LittleEndian> {}
|
||||||
|
|
||||||
|
|||||||
@@ -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::address_transform::AddressTransform;
|
||||||
use super::expression::{compile_expression, CompiledExpression, FunctionFrameInfo};
|
use super::expression::{compile_expression, CompiledExpression, FunctionFrameInfo};
|
||||||
use super::range_info_builder::RangeInfoBuilder;
|
use super::range_info_builder::RangeInfoBuilder;
|
||||||
use super::unit::PendingDieRef;
|
use super::unit::PendingDieRef;
|
||||||
use super::{DebugInputContext, Reader, TransformError};
|
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> {
|
pub(crate) enum FileAttributeContext<'a> {
|
||||||
Root(Option<DebugLineOffset>),
|
Root(Option<DebugLineOffset>),
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ use cranelift_codegen::ValueLabelsRanges;
|
|||||||
use cranelift_entity::EntityRef;
|
use cranelift_entity::EntityRef;
|
||||||
use cranelift_wasm::{get_vmctx_value_label, DefinedFuncIndex};
|
use cranelift_wasm::{get_vmctx_value_label, DefinedFuncIndex};
|
||||||
use failure::Error;
|
use failure::Error;
|
||||||
use gimli::write;
|
use gimli::{self, write, Expression, Operation, Reader, ReaderOffset, Register, X86_64};
|
||||||
use gimli::{self, Expression, Operation, Reader, ReaderOffset, Register, X86_64};
|
|
||||||
use more_asserts::{assert_le, assert_lt};
|
use more_asserts::{assert_le, assert_lt};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ use alloc::vec::Vec;
|
|||||||
use core::iter::FromIterator;
|
use core::iter::FromIterator;
|
||||||
use cranelift_entity::EntityRef;
|
use cranelift_entity::EntityRef;
|
||||||
use failure::Error;
|
use failure::Error;
|
||||||
use gimli;
|
use gimli::{
|
||||||
use gimli::write;
|
write, DebugLine, DebugLineOffset, DebugStr, DebuggingInformationEntry, LineEncoding, Unit,
|
||||||
use gimli::{DebugLine, DebugLineOffset, DebugStr, DebuggingInformationEntry, LineEncoding, Unit};
|
};
|
||||||
use more_asserts::assert_le;
|
use more_asserts::assert_le;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|||||||
@@ -1,24 +1,18 @@
|
|||||||
use crate::gc::build_dependencies;
|
use crate::gc::build_dependencies;
|
||||||
use crate::DebugInfoData;
|
use crate::{DebugInfoData, HashSet};
|
||||||
use crate::HashSet;
|
|
||||||
use cranelift_codegen::isa::TargetFrontendConfig;
|
use cranelift_codegen::isa::TargetFrontendConfig;
|
||||||
use failure::Error;
|
use failure::Error;
|
||||||
|
use gimli::{
|
||||||
|
write, DebugAddr, DebugAddrBase, DebugLine, DebugStr, LocationLists, RangeLists,
|
||||||
|
UnitSectionOffset,
|
||||||
|
};
|
||||||
use simulate::generate_simulated_dwarf;
|
use simulate::generate_simulated_dwarf;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
use unit::clone_unit;
|
||||||
use wasmtime_environ::{ModuleAddressMap, ModuleVmctxInfo, ValueLabelsRanges};
|
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;
|
pub use address_transform::AddressTransform;
|
||||||
|
|
||||||
use unit::clone_unit;
|
|
||||||
|
|
||||||
mod address_transform;
|
mod address_transform;
|
||||||
mod attr;
|
mod attr;
|
||||||
mod expression;
|
mod expression;
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
use super::address_transform::AddressTransform;
|
use super::address_transform::AddressTransform;
|
||||||
use super::DebugInputContext;
|
use super::{DebugInputContext, Reader};
|
||||||
use super::Reader;
|
|
||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
use cranelift_entity::EntityRef;
|
use cranelift_entity::EntityRef;
|
||||||
use cranelift_wasm::DefinedFuncIndex;
|
use cranelift_wasm::DefinedFuncIndex;
|
||||||
use failure::Error;
|
use failure::Error;
|
||||||
use gimli;
|
use gimli::{write, AttributeValue, DebuggingInformationEntry, RangeListsOffset};
|
||||||
use gimli::write;
|
|
||||||
use gimli::{AttributeValue, DebuggingInformationEntry, RangeListsOffset};
|
|
||||||
use more_asserts::assert_lt;
|
use more_asserts::assert_lt;
|
||||||
|
|
||||||
pub(crate) enum RangeInfoBuilder {
|
pub(crate) enum RangeInfoBuilder {
|
||||||
|
|||||||
@@ -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;
|
use crate::read_debuginfo::WasmFileInfo;
|
||||||
pub use crate::read_debuginfo::{DebugInfoData, FunctionMetadata, WasmType};
|
|
||||||
use crate::{HashMap, HashSet};
|
use crate::{HashMap, HashSet};
|
||||||
use alloc::string::String;
|
use alloc::string::String;
|
||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
use cranelift_entity::EntityRef;
|
use cranelift_entity::EntityRef;
|
||||||
use cranelift_wasm::get_vmctx_value_label;
|
use cranelift_wasm::get_vmctx_value_label;
|
||||||
use failure::Error;
|
use failure::Error;
|
||||||
|
use gimli::write;
|
||||||
|
use gimli::{self, LineEncoding};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use wasmtime_environ::{ModuleVmctxInfo, ValueLabelsRanges};
|
use wasmtime_environ::{ModuleVmctxInfo, ValueLabelsRanges};
|
||||||
|
|
||||||
use gimli::write;
|
pub use crate::read_debuginfo::{DebugInfoData, FunctionMetadata, WasmType};
|
||||||
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;
|
|
||||||
|
|
||||||
const PRODUCER_NAME: &str = "wasmtime";
|
const PRODUCER_NAME: &str = "wasmtime";
|
||||||
|
|
||||||
|
|||||||
@@ -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::address_transform::AddressTransform;
|
||||||
use super::attr::{clone_die_attributes, FileAttributeContext};
|
use super::attr::{clone_die_attributes, FileAttributeContext};
|
||||||
use super::expression::compile_expression;
|
use super::expression::compile_expression;
|
||||||
@@ -18,6 +5,13 @@ use super::line_program::clone_line_program;
|
|||||||
use super::range_info_builder::RangeInfoBuilder;
|
use super::range_info_builder::RangeInfoBuilder;
|
||||||
use super::utils::{add_internal_types, append_vmctx_info, get_function_frame_info};
|
use super::utils::{add_internal_types, append_vmctx_info, get_function_frame_info};
|
||||||
use super::{DebugInputContext, Reader, TransformError};
|
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);
|
pub(crate) type PendingDieRef = (write::UnitEntryId, gimli::DwAt, UnitOffset);
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
|
use super::address_transform::AddressTransform;
|
||||||
|
use super::expression::{CompiledExpression, FunctionFrameInfo};
|
||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
use cranelift_wasm::DefinedFuncIndex;
|
use cranelift_wasm::DefinedFuncIndex;
|
||||||
use failure::Error;
|
use failure::Error;
|
||||||
use wasmtime_environ::{ModuleVmctxInfo, ValueLabelsRanges};
|
|
||||||
|
|
||||||
use gimli;
|
|
||||||
use gimli::write;
|
use gimli::write;
|
||||||
|
use wasmtime_environ::{ModuleVmctxInfo, ValueLabelsRanges};
|
||||||
use super::address_transform::AddressTransform;
|
|
||||||
use super::expression::{CompiledExpression, FunctionFrameInfo};
|
|
||||||
|
|
||||||
pub(crate) fn add_internal_types(
|
pub(crate) fn add_internal_types(
|
||||||
comp_unit: &mut write::Unit,
|
comp_unit: &mut write::Unit,
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
use alloc::string::String;
|
use alloc::{string::String, vec::Vec};
|
||||||
use alloc::vec::Vec;
|
|
||||||
use gimli::write::{Address, Dwarf, EndianVec, Result, Sections, Writer};
|
|
||||||
use gimli::{RunTimeEndian, SectionId};
|
|
||||||
|
|
||||||
use core::result;
|
use core::result;
|
||||||
use faerie::artifact::{Decl, SectionKind};
|
use faerie::artifact::{Decl, SectionKind};
|
||||||
use faerie::*;
|
use faerie::*;
|
||||||
|
use gimli::write::{Address, Dwarf, EndianVec, Result, Sections, Writer};
|
||||||
|
use gimli::{RunTimeEndian, SectionId};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct DebugReloc {
|
struct DebugReloc {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#![deny(missing_docs)]
|
#![deny(missing_docs)]
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
use alloc::boxed::Box;
|
use alloc::boxed::Box;
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
#[cfg(not(feature = "std"))]
|
#[cfg(not(feature = "std"))]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
extern crate lightbeam;
|
|
||||||
|
|
||||||
use lightbeam::translate;
|
use lightbeam::translate;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|||||||
@@ -1,19 +1,6 @@
|
|||||||
#![cfg_attr(test, feature(test))]
|
#![cfg_attr(test, feature(test))]
|
||||||
#![feature(proc_macro_hygiene)]
|
#![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)]
|
#[cfg(test)]
|
||||||
extern crate test;
|
extern crate test;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use crate::module::{ModuleContext, SigType, Signature};
|
use crate::module::{ModuleContext, SigType, Signature};
|
||||||
use smallvec::SmallVec;
|
use smallvec::{smallvec, SmallVec};
|
||||||
use std::{
|
use std::{
|
||||||
convert::TryInto,
|
convert::TryInto,
|
||||||
fmt,
|
fmt,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use cranelift_codegen::{
|
|||||||
ir::{self, AbiParam, Signature as CraneliftSignature},
|
ir::{self, AbiParam, Signature as CraneliftSignature},
|
||||||
isa,
|
isa,
|
||||||
};
|
};
|
||||||
|
use memoffset::offset_of;
|
||||||
use more_asserts::assert_le;
|
use more_asserts::assert_le;
|
||||||
use wasmparser::{FuncType, MemoryType, ModuleReader, SectionCode, Type};
|
use wasmparser::{FuncType, MemoryType, ModuleReader, SectionCode, Type};
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,12 @@
|
|||||||
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
use pyo3::prelude::*;
|
|
||||||
use pyo3::types::PyTuple;
|
|
||||||
|
|
||||||
use crate::value::{pyobj_to_value, value_to_pyobj};
|
use crate::value::{pyobj_to_value, value_to_pyobj};
|
||||||
use alloc::rc::Rc;
|
use alloc::rc::Rc;
|
||||||
use core::cell::RefCell;
|
use core::cell::RefCell;
|
||||||
|
|
||||||
use cranelift_codegen::ir;
|
use cranelift_codegen::ir;
|
||||||
|
use pyo3::prelude::*;
|
||||||
|
use pyo3::types::PyTuple;
|
||||||
use wasmtime_interface_types::ModuleData;
|
use wasmtime_interface_types::ModuleData;
|
||||||
use wasmtime_jit::{Context, InstanceHandle};
|
use wasmtime_jit::{Context, InstanceHandle};
|
||||||
use wasmtime_runtime::Export;
|
use wasmtime_runtime::Export;
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
use pyo3::prelude::*;
|
|
||||||
use pyo3::types::{PyAny, PyDict, PyTuple};
|
|
||||||
|
|
||||||
use crate::function::Function;
|
use crate::function::Function;
|
||||||
use crate::memory::Memory;
|
use crate::memory::Memory;
|
||||||
use crate::value::{read_value_from, write_value_to};
|
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::types;
|
||||||
use cranelift_codegen::ir::{InstBuilder, StackSlotData, StackSlotKind};
|
use cranelift_codegen::ir::{InstBuilder, StackSlotData, StackSlotKind};
|
||||||
use cranelift_codegen::Context;
|
use cranelift_codegen::Context;
|
||||||
@@ -15,16 +15,14 @@ use cranelift_codegen::{binemit, ir, isa};
|
|||||||
use cranelift_entity::{EntityRef, PrimaryMap};
|
use cranelift_entity::{EntityRef, PrimaryMap};
|
||||||
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
|
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
|
||||||
use cranelift_wasm::{DefinedFuncIndex, FuncIndex};
|
use cranelift_wasm::{DefinedFuncIndex, FuncIndex};
|
||||||
|
use pyo3::prelude::*;
|
||||||
|
use pyo3::types::{PyAny, PyDict, PyTuple};
|
||||||
|
use std::collections::{HashMap, HashSet};
|
||||||
use target_lexicon::HOST;
|
use target_lexicon::HOST;
|
||||||
use wasmtime_environ::{CompiledFunction, Export, Module};
|
use wasmtime_environ::{CompiledFunction, Export, Module};
|
||||||
use wasmtime_jit::CodeMemory;
|
use wasmtime_jit::CodeMemory;
|
||||||
use wasmtime_runtime::{Imports, InstanceHandle, VMContext, VMFunctionBody};
|
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 {
|
struct BoundPyFunction {
|
||||||
name: String,
|
name: String,
|
||||||
obj: PyObject,
|
obj: PyObject,
|
||||||
|
|||||||
@@ -2,16 +2,13 @@
|
|||||||
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
use pyo3::prelude::*;
|
|
||||||
use pyo3::types::PyDict;
|
|
||||||
|
|
||||||
use crate::function::Function;
|
use crate::function::Function;
|
||||||
use crate::memory::Memory;
|
use crate::memory::Memory;
|
||||||
use alloc::rc::Rc;
|
use alloc::rc::Rc;
|
||||||
use core::cell::RefCell;
|
use core::cell::RefCell;
|
||||||
|
use cranelift_codegen::ir::{self, types};
|
||||||
use cranelift_codegen::ir;
|
use pyo3::prelude::*;
|
||||||
use cranelift_codegen::ir::types;
|
use pyo3::types::PyDict;
|
||||||
use wasmtime_environ::Export;
|
use wasmtime_environ::Export;
|
||||||
use wasmtime_interface_types::ModuleData;
|
use wasmtime_interface_types::ModuleData;
|
||||||
use wasmtime_jit::{Context, InstanceHandle};
|
use wasmtime_jit::{Context, InstanceHandle};
|
||||||
|
|||||||
@@ -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::import::into_instance_from_obj;
|
||||||
use crate::instance::Instance;
|
use crate::instance::Instance;
|
||||||
use crate::memory::Memory;
|
use crate::memory::Memory;
|
||||||
use crate::module::Module;
|
use crate::module::Module;
|
||||||
use core::cell::RefCell;
|
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 std::rc::Rc;
|
||||||
use wasmtime_interface_types::ModuleData;
|
use wasmtime_interface_types::ModuleData;
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,15 @@
|
|||||||
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
|
use alloc::rc::Rc;
|
||||||
|
use core::cell::RefCell;
|
||||||
|
use core::ptr;
|
||||||
use pyo3::class::PyBufferProtocol;
|
use pyo3::class::PyBufferProtocol;
|
||||||
use pyo3::exceptions::BufferError;
|
use pyo3::exceptions::BufferError;
|
||||||
use pyo3::ffi;
|
use pyo3::ffi;
|
||||||
use pyo3::prelude::*;
|
use pyo3::prelude::*;
|
||||||
|
|
||||||
use alloc::rc::Rc;
|
|
||||||
use core::cell::RefCell;
|
|
||||||
use core::ptr;
|
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
use std::os::raw::{c_int, c_void};
|
use std::os::raw::{c_int, c_void};
|
||||||
|
|
||||||
use wasmtime_environ::MemoryPlan;
|
use wasmtime_environ::MemoryPlan;
|
||||||
use wasmtime_jit::{Context, InstanceHandle};
|
use wasmtime_jit::{Context, InstanceHandle};
|
||||||
use wasmtime_runtime::{Export, VMMemoryDefinition, VMMemoryImport};
|
use wasmtime_runtime::{Export, VMMemoryDefinition, VMMemoryImport};
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
use pyo3::prelude::*;
|
|
||||||
|
|
||||||
use alloc::rc::Rc;
|
use alloc::rc::Rc;
|
||||||
|
use pyo3::prelude::*;
|
||||||
|
|
||||||
#[pyclass]
|
#[pyclass]
|
||||||
pub struct Module {
|
pub struct Module {
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
//! Utility functions to handle values conversion between abstractions/targets.
|
//! Utility functions to handle values conversion between abstractions/targets.
|
||||||
|
|
||||||
use pyo3::exceptions::Exception;
|
|
||||||
use pyo3::prelude::*;
|
|
||||||
use pyo3::types::PyAny;
|
|
||||||
|
|
||||||
use core::ptr;
|
use core::ptr;
|
||||||
use cranelift_codegen::ir;
|
use cranelift_codegen::ir;
|
||||||
|
use pyo3::exceptions::Exception;
|
||||||
|
use pyo3::prelude::*;
|
||||||
|
use pyo3::types::PyAny;
|
||||||
use wasmtime_interface_types::Value;
|
use wasmtime_interface_types::Value;
|
||||||
|
|
||||||
pub fn pyobj_to_value(_: Python, p: &PyAny) -> PyResult<Value> {
|
pub fn pyobj_to_value(_: Python, p: &PyAny) -> PyResult<Value> {
|
||||||
|
|||||||
@@ -24,15 +24,13 @@ use core::any::Any;
|
|||||||
use core::borrow::Borrow;
|
use core::borrow::Borrow;
|
||||||
use core::cell::RefCell;
|
use core::cell::RefCell;
|
||||||
use core::convert::TryFrom;
|
use core::convert::TryFrom;
|
||||||
use core::slice;
|
use core::{mem, ptr, slice};
|
||||||
use core::{mem, ptr};
|
use cranelift_entity::{BoxedSlice, EntityRef, PrimaryMap};
|
||||||
use cranelift_entity::EntityRef;
|
|
||||||
use cranelift_entity::{BoxedSlice, PrimaryMap};
|
|
||||||
use cranelift_wasm::{
|
use cranelift_wasm::{
|
||||||
DefinedFuncIndex, DefinedGlobalIndex, DefinedMemoryIndex, DefinedTableIndex, FuncIndex,
|
DefinedFuncIndex, DefinedGlobalIndex, DefinedMemoryIndex, DefinedTableIndex, FuncIndex,
|
||||||
GlobalIndex, GlobalInit, MemoryIndex, SignatureIndex, TableIndex,
|
GlobalIndex, GlobalInit, MemoryIndex, SignatureIndex, TableIndex,
|
||||||
};
|
};
|
||||||
use indexmap;
|
use memoffset::offset_of;
|
||||||
use more_asserts::assert_lt;
|
use more_asserts::assert_lt;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use wasmtime_environ::{DataInitializer, Module, TableElements, VMOffsets};
|
use wasmtime_environ::{DataInitializer, Module, TableElements, VMOffsets};
|
||||||
|
|||||||
@@ -23,10 +23,6 @@
|
|||||||
)]
|
)]
|
||||||
#![cfg_attr(not(feature = "std"), no_std)]
|
#![cfg_attr(not(feature = "std"), no_std)]
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate lazy_static;
|
|
||||||
#[macro_use]
|
|
||||||
extern crate memoffset;
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
mod export;
|
mod export;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use crate::vmcontext::VMContext;
|
|||||||
use crate::RwLock;
|
use crate::RwLock;
|
||||||
use core::borrow::{Borrow, BorrowMut};
|
use core::borrow::{Borrow, BorrowMut};
|
||||||
use core::cell::Cell;
|
use core::cell::Cell;
|
||||||
|
use lazy_static::lazy_static;
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
struct TrapContext {
|
struct TrapContext {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ pub struct VMFunctionImport {
|
|||||||
mod test_vmfunction_import {
|
mod test_vmfunction_import {
|
||||||
use super::VMFunctionImport;
|
use super::VMFunctionImport;
|
||||||
use core::mem::size_of;
|
use core::mem::size_of;
|
||||||
|
use memoffset::offset_of;
|
||||||
use wasmtime_environ::{Module, VMOffsets};
|
use wasmtime_environ::{Module, VMOffsets};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -76,6 +77,7 @@ pub struct VMTableImport {
|
|||||||
mod test_vmtable_import {
|
mod test_vmtable_import {
|
||||||
use super::VMTableImport;
|
use super::VMTableImport;
|
||||||
use core::mem::size_of;
|
use core::mem::size_of;
|
||||||
|
use memoffset::offset_of;
|
||||||
use wasmtime_environ::{Module, VMOffsets};
|
use wasmtime_environ::{Module, VMOffsets};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -113,6 +115,7 @@ pub struct VMMemoryImport {
|
|||||||
mod test_vmmemory_import {
|
mod test_vmmemory_import {
|
||||||
use super::VMMemoryImport;
|
use super::VMMemoryImport;
|
||||||
use core::mem::size_of;
|
use core::mem::size_of;
|
||||||
|
use memoffset::offset_of;
|
||||||
use wasmtime_environ::{Module, VMOffsets};
|
use wasmtime_environ::{Module, VMOffsets};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -147,6 +150,7 @@ pub struct VMGlobalImport {
|
|||||||
mod test_vmglobal_import {
|
mod test_vmglobal_import {
|
||||||
use super::VMGlobalImport;
|
use super::VMGlobalImport;
|
||||||
use core::mem::size_of;
|
use core::mem::size_of;
|
||||||
|
use memoffset::offset_of;
|
||||||
use wasmtime_environ::{Module, VMOffsets};
|
use wasmtime_environ::{Module, VMOffsets};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -181,6 +185,7 @@ pub struct VMMemoryDefinition {
|
|||||||
mod test_vmmemory_definition {
|
mod test_vmmemory_definition {
|
||||||
use super::VMMemoryDefinition;
|
use super::VMMemoryDefinition;
|
||||||
use core::mem::size_of;
|
use core::mem::size_of;
|
||||||
|
use memoffset::offset_of;
|
||||||
use wasmtime_environ::{Module, VMOffsets};
|
use wasmtime_environ::{Module, VMOffsets};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -224,6 +229,7 @@ pub struct VMTableDefinition {
|
|||||||
mod test_vmtable_definition {
|
mod test_vmtable_definition {
|
||||||
use super::VMTableDefinition;
|
use super::VMTableDefinition;
|
||||||
use core::mem::size_of;
|
use core::mem::size_of;
|
||||||
|
use memoffset::offset_of;
|
||||||
use wasmtime_environ::{Module, VMOffsets};
|
use wasmtime_environ::{Module, VMOffsets};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -480,6 +486,7 @@ pub struct VMCallerCheckedAnyfunc {
|
|||||||
mod test_vmcaller_checked_anyfunc {
|
mod test_vmcaller_checked_anyfunc {
|
||||||
use super::VMCallerCheckedAnyfunc;
|
use super::VMCallerCheckedAnyfunc;
|
||||||
use core::mem::size_of;
|
use core::mem::size_of;
|
||||||
|
use memoffset::offset_of;
|
||||||
use wasmtime_environ::{Module, VMOffsets};
|
use wasmtime_environ::{Module, VMOffsets};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
extern crate bindgen;
|
|
||||||
extern crate cmake;
|
|
||||||
|
|
||||||
use cmake::Config;
|
use cmake::Config;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#[macro_use]
|
|
||||||
extern crate log;
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
extern crate core;
|
extern crate core;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
use crate::host;
|
|
||||||
use crate::host::{argv_environ_values, fd_prestats, fd_table};
|
use crate::host::{argv_environ_values, fd_prestats, fd_table};
|
||||||
use crate::instantiate::WASIState;
|
use crate::instantiate::WASIState;
|
||||||
use crate::translate::*;
|
use crate::translate::*;
|
||||||
use crate::wasm32;
|
use crate::{host, wasm32};
|
||||||
use core::convert::TryFrom;
|
use core::convert::TryFrom;
|
||||||
use cranelift_codegen::ir::types::{Type, I32, I64};
|
use cranelift_codegen::ir::types::{Type, I32, I64};
|
||||||
|
use log::{log_enabled, trace};
|
||||||
use std::{mem, ptr, slice, str};
|
use std::{mem, ptr, slice, str};
|
||||||
use wasmtime_runtime::VMContext;
|
use wasmtime_runtime::VMContext;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use crate::host;
|
use crate::{host, wasm32};
|
||||||
use crate::wasm32;
|
|
||||||
use core::convert::TryFrom;
|
use core::convert::TryFrom;
|
||||||
|
use log::{debug, error};
|
||||||
use more_asserts::assert_le;
|
use more_asserts::assert_le;
|
||||||
use std::mem::{align_of, size_of, zeroed};
|
use std::mem::{align_of, size_of, zeroed};
|
||||||
use std::slice;
|
use std::slice;
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
#![allow(clippy::use_self)]
|
#![allow(clippy::use_self)]
|
||||||
use crate::wasi;
|
use crate::wasi;
|
||||||
use std::convert::Infallible;
|
use std::convert::Infallible;
|
||||||
use std::fmt;
|
|
||||||
use std::num::TryFromIntError;
|
use std::num::TryFromIntError;
|
||||||
use std::str;
|
use std::{fmt, str};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Error, Eq, PartialEq)]
|
#[derive(Clone, Copy, Debug, Error, Eq, PartialEq)]
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
use crate::ctx::WasiCtx;
|
use crate::ctx::WasiCtx;
|
||||||
use crate::{wasi, wasi32};
|
use crate::{wasi, wasi32};
|
||||||
use log::trace;
|
use log::trace;
|
||||||
|
|
||||||
use wasi_common_cbindgen::wasi_common_cbindgen;
|
use wasi_common_cbindgen::wasi_common_cbindgen;
|
||||||
|
|
||||||
#[wasi_common_cbindgen]
|
#[wasi_common_cbindgen]
|
||||||
|
|||||||
@@ -6,9 +6,8 @@
|
|||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use wig::witx_wasi32_types;
|
|
||||||
|
|
||||||
use crate::wasi::*;
|
use crate::wasi::*;
|
||||||
|
use wig::witx_wasi32_types;
|
||||||
|
|
||||||
pub type uintptr_t = u32;
|
pub type uintptr_t = u32;
|
||||||
pub type size_t = u32;
|
pub type size_t = u32;
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
extern crate wasi_common_cbindgen;
|
|
||||||
|
|
||||||
pub use wasi_common_cbindgen::wasi_common_cbindgen;
|
pub use wasi_common_cbindgen::wasi_common_cbindgen;
|
||||||
|
|
||||||
#[wasi_common_cbindgen]
|
#[wasi_common_cbindgen]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
extern crate wasi_common_cbindgen;
|
|
||||||
|
|
||||||
pub use wasi_common_cbindgen::wasi_common_cbindgen;
|
pub use wasi_common_cbindgen::wasi_common_cbindgen;
|
||||||
|
|
||||||
#[wasi_common_cbindgen]
|
#[wasi_common_cbindgen]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
extern crate wasi_common_cbindgen;
|
|
||||||
|
|
||||||
pub use wasi_common_cbindgen::wasi_common_cbindgen;
|
pub use wasi_common_cbindgen::wasi_common_cbindgen;
|
||||||
|
|
||||||
#[wasi_common_cbindgen]
|
#[wasi_common_cbindgen]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
extern crate wasi_common_cbindgen;
|
|
||||||
|
|
||||||
pub use wasi_common_cbindgen::wasi_common_cbindgen;
|
pub use wasi_common_cbindgen::wasi_common_cbindgen;
|
||||||
|
|
||||||
#[wasi_common_cbindgen]
|
#[wasi_common_cbindgen]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
extern crate wasi_common_cbindgen;
|
|
||||||
|
|
||||||
pub use wasi_common_cbindgen::wasi_common_cbindgen;
|
pub use wasi_common_cbindgen::wasi_common_cbindgen;
|
||||||
|
|
||||||
#[wasi_common_cbindgen]
|
#[wasi_common_cbindgen]
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
extern crate proc_macro2;
|
|
||||||
extern crate quote;
|
|
||||||
extern crate witx;
|
|
||||||
|
|
||||||
mod raw_types;
|
mod raw_types;
|
||||||
mod utils;
|
mod utils;
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
)]
|
)]
|
||||||
#![cfg(windows)]
|
#![cfg(windows)]
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate bitflags;
|
|
||||||
|
|
||||||
pub mod file;
|
pub mod file;
|
||||||
pub mod time;
|
pub mod time;
|
||||||
pub mod winerror;
|
pub mod winerror;
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ publish = false
|
|||||||
cargo-fuzz = true
|
cargo-fuzz = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmtime-environ = { path = "../wasmtime-environ" }
|
wasmtime-environ = { path = "../crates/environ" }
|
||||||
wasmtime-jit = { path = "../wasmtime-jit" }
|
wasmtime-jit = { path = "../crates/jit" }
|
||||||
cranelift-codegen = { version = "0.49", features = ["enable-serde"] }
|
cranelift-codegen = { version = "0.49", features = ["enable-serde"] }
|
||||||
cranelift-wasm = { version = "0.49", features = ["enable-serde"] }
|
cranelift-wasm = { version = "0.49", features = ["enable-serde"] }
|
||||||
cranelift-native = "0.49"
|
cranelift-native = "0.49"
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate libfuzzer_sys;
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
extern crate core;
|
extern crate core;
|
||||||
|
extern crate libfuzzer_sys;
|
||||||
|
|
||||||
use alloc::rc::Rc;
|
use alloc::rc::Rc;
|
||||||
use core::cell::RefCell;
|
use core::cell::RefCell;
|
||||||
use cranelift_codegen::settings;
|
use cranelift_codegen::settings;
|
||||||
|
use libfuzzer_sys::fuzz_target;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use wasmparser::validate;
|
use wasmparser::validate;
|
||||||
use wasmtime_jit::{CompilationStrategy, CompiledModule, Compiler, NullResolver};
|
use wasmtime_jit::{CompilationStrategy, CompiledModule, Compiler, NullResolver};
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate libfuzzer_sys;
|
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 cranelift_codegen::settings;
|
||||||
|
use libfuzzer_sys::fuzz_target;
|
||||||
use wasmparser::validate;
|
use wasmparser::validate;
|
||||||
use wasmtime_jit::{instantiate, CompilationStrategy, Compiler, NullResolver};
|
use wasmtime_jit::{instantiate, CompilationStrategy, Compiler, NullResolver};
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate libfuzzer_sys;
|
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 cranelift_codegen::settings;
|
||||||
|
use libfuzzer_sys::fuzz_target;
|
||||||
use wasmtime_jit::{instantiate, CompilationStrategy, Compiler, NullResolver};
|
use wasmtime_jit::{instantiate, CompilationStrategy, Compiler, NullResolver};
|
||||||
|
|
||||||
fuzz_target!(|data: &[u8]| {
|
fuzz_target!(|data: &[u8]| {
|
||||||
|
|||||||
@@ -29,11 +29,9 @@
|
|||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
|
||||||
use cranelift_codegen::isa;
|
|
||||||
use cranelift_codegen::settings;
|
|
||||||
use cranelift_codegen::settings::Configurable;
|
use cranelift_codegen::settings::Configurable;
|
||||||
|
use cranelift_codegen::{isa, settings};
|
||||||
use cranelift_entity::EntityRef;
|
use cranelift_entity::EntityRef;
|
||||||
use cranelift_native;
|
|
||||||
use cranelift_wasm::DefinedMemoryIndex;
|
use cranelift_wasm::DefinedMemoryIndex;
|
||||||
use docopt::Docopt;
|
use docopt::Docopt;
|
||||||
use faerie::Artifact;
|
use faerie::Artifact;
|
||||||
@@ -41,21 +39,18 @@ use serde::Deserialize;
|
|||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fmt::format;
|
use std::fmt::format;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io;
|
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
use std::path::Path;
|
use std::path::{Path, PathBuf};
|
||||||
use std::path::PathBuf;
|
|
||||||
use std::process;
|
|
||||||
use std::str;
|
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
use std::{io, process, str};
|
||||||
use target_lexicon::Triple;
|
use target_lexicon::Triple;
|
||||||
use wasmtime_cli::pick_compilation_strategy;
|
use wasmtime_cli::pick_compilation_strategy;
|
||||||
use wasmtime_debug::{emit_debugsections, read_debuginfo};
|
use wasmtime_debug::{emit_debugsections, read_debuginfo};
|
||||||
#[cfg(feature = "lightbeam")]
|
#[cfg(feature = "lightbeam")]
|
||||||
use wasmtime_environ::Lightbeam;
|
use wasmtime_environ::Lightbeam;
|
||||||
use wasmtime_environ::{cache_create_new_config, cache_init};
|
|
||||||
use wasmtime_environ::{
|
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_jit::CompilationStrategy;
|
||||||
use wasmtime_obj::emit_module;
|
use wasmtime_obj::emit_module;
|
||||||
|
|||||||
@@ -34,13 +34,11 @@ use anyhow::{bail, Context as _, Result};
|
|||||||
use cranelift_codegen::settings;
|
use cranelift_codegen::settings;
|
||||||
use cranelift_codegen::settings::Configurable;
|
use cranelift_codegen::settings::Configurable;
|
||||||
use docopt::Docopt;
|
use docopt::Docopt;
|
||||||
use pretty_env_logger;
|
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::path::Component;
|
use std::path::{Component, Path};
|
||||||
use std::path::Path;
|
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
use wasi_common::preopen_dir;
|
use wasi_common::preopen_dir;
|
||||||
use wasmtime_api::{Config, Engine, HostRef, Instance, Module, Store};
|
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_interface_types::ModuleData;
|
||||||
use wasmtime_jit::Features;
|
use wasmtime_jit::Features;
|
||||||
use wasmtime_wasi::instantiate_wasi;
|
use wasmtime_wasi::instantiate_wasi;
|
||||||
use wasmtime_wast::instantiate_spectest;
|
|
||||||
|
|
||||||
#[cfg(feature = "wasi-c")]
|
#[cfg(feature = "wasi-c")]
|
||||||
use wasmtime_wasi_c::instantiate_wasi_c;
|
use wasmtime_wasi_c::instantiate_wasi_c;
|
||||||
|
use wasmtime_wast::instantiate_spectest;
|
||||||
|
|
||||||
const USAGE: &str = "
|
const USAGE: &str = "
|
||||||
Wasm runner.
|
Wasm runner.
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
use cranelift_native;
|
|
||||||
|
|
||||||
use cranelift_codegen::isa;
|
|
||||||
use cranelift_codegen::settings;
|
|
||||||
use cranelift_codegen::settings::Configurable;
|
use cranelift_codegen::settings::Configurable;
|
||||||
|
use cranelift_codegen::{isa, settings};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use wasmtime_jit::{CompilationStrategy, Compiler, Features};
|
use wasmtime_jit::{CompilationStrategy, Compiler, Features};
|
||||||
use wasmtime_wast::WastContext;
|
use wasmtime_wast::WastContext;
|
||||||
|
|||||||
Reference in New Issue
Block a user