Move cranelift dependencies to wasmtime-environ (#669)

Groups all CL data structures into single dependency to be used accross wasmtime project.
This commit is contained in:
Yury Delendik
2019-12-05 16:07:34 -06:00
committed by GitHub
parent 8a1b7965d8
commit cc6e8e1af2
65 changed files with 223 additions and 233 deletions

View File

@@ -1,8 +1,8 @@
use crate::vmcontext::{
VMContext, VMFunctionBody, VMGlobalDefinition, VMMemoryDefinition, VMTableDefinition,
};
use cranelift_codegen::ir;
use cranelift_wasm::Global;
use wasmtime_environ::ir;
use wasmtime_environ::wasm::Global;
use wasmtime_environ::{MemoryPlan, TablePlan};
/// The value of an export passed from one instance to another.

View File

@@ -1,8 +1,8 @@
use crate::instance::InstanceHandle;
use crate::vmcontext::{VMFunctionImport, VMGlobalImport, VMMemoryImport, VMTableImport};
use cranelift_entity::{BoxedSlice, PrimaryMap};
use cranelift_wasm::{FuncIndex, GlobalIndex, MemoryIndex, TableIndex};
use std::collections::HashSet;
use wasmtime_environ::entity::{BoxedSlice, PrimaryMap};
use wasmtime_environ::wasm::{FuncIndex, GlobalIndex, MemoryIndex, TableIndex};
/// Resolved import pointers.
#[derive(Clone)]

View File

@@ -15,11 +15,6 @@ use crate::vmcontext::{
VMGlobalDefinition, VMGlobalImport, VMMemoryDefinition, VMMemoryImport, VMSharedSignatureIndex,
VMTableDefinition, VMTableImport,
};
use cranelift_entity::{BoxedSlice, EntityRef, PrimaryMap};
use cranelift_wasm::{
DefinedFuncIndex, DefinedGlobalIndex, DefinedMemoryIndex, DefinedTableIndex, FuncIndex,
GlobalIndex, GlobalInit, MemoryIndex, SignatureIndex, TableIndex,
};
use memoffset::offset_of;
use more_asserts::assert_lt;
use std::any::Any;
@@ -30,6 +25,11 @@ use std::convert::TryFrom;
use std::rc::Rc;
use std::{mem, ptr, slice};
use thiserror::Error;
use wasmtime_environ::entity::{BoxedSlice, EntityRef, PrimaryMap};
use wasmtime_environ::wasm::{
DefinedFuncIndex, DefinedGlobalIndex, DefinedMemoryIndex, DefinedTableIndex, FuncIndex,
GlobalIndex, GlobalInit, MemoryIndex, SignatureIndex, TableIndex,
};
use wasmtime_environ::{DataInitializer, Module, TableElements, VMOffsets};
fn signature_id(

View File

@@ -3,7 +3,7 @@
//! instructions which compute them directly.
use crate::vmcontext::VMContext;
use cranelift_wasm::{DefinedMemoryIndex, MemoryIndex};
use wasmtime_environ::wasm::{DefinedMemoryIndex, MemoryIndex};
/// Implementation of f32.ceil
pub extern "C" fn wasmtime_f32_ceil(x: f32) -> f32 {

View File

@@ -2,10 +2,10 @@
//! signature checking.
use crate::vmcontext::VMSharedSignatureIndex;
use cranelift_codegen::ir;
use more_asserts::{assert_lt, debug_assert_lt};
use std::collections::{hash_map, HashMap};
use std::convert::TryFrom;
use wasmtime_environ::ir;
/// WebAssembly requires that the caller and callee signatures in an indirect
/// call must match. To implement this efficiently, keep a registry of all

View File

@@ -3,8 +3,8 @@
//! `Table` is to WebAssembly tables what `LinearMemory` is to WebAssembly linear memories.
use crate::vmcontext::{VMCallerCheckedAnyfunc, VMTableDefinition};
use cranelift_wasm::TableElementType;
use std::convert::{TryFrom, TryInto};
use wasmtime_environ::wasm::TableElementType;
use wasmtime_environ::{TablePlan, TableStyle};
/// A table instance.

View File

@@ -1,7 +1,7 @@
use cranelift_codegen::ir;
use lazy_static::lazy_static;
use std::collections::HashMap;
use std::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard};
use wasmtime_environ::ir;
lazy_static! {
static ref REGISTRY: RwLock<TrapRegistry> = RwLock::new(TrapRegistry::default());

View File

@@ -4,9 +4,9 @@
use crate::trap_registry::get_trap_registry;
use crate::trap_registry::TrapDescription;
use crate::vmcontext::{VMContext, VMFunctionBody};
use cranelift_codegen::ir;
use std::cell::Cell;
use std::ptr;
use wasmtime_environ::ir;
extern "C" {
fn WasmtimeCallTrampoline(