[wasmtime-api] Collect and wrap cranelift dependencies (#623)

* Collect and wrap cranelift dependencies
* rename all _cranelift_ named methods
This commit is contained in:
Yury Delendik
2019-11-25 10:34:28 -06:00
committed by GitHub
parent 6594a3bbe0
commit e9622654c5
15 changed files with 157 additions and 117 deletions

View File

@@ -1,8 +1,8 @@
use crate::data_structures::ir;
use crate::externals::Func;
use crate::r#ref::{AnyRef, HostRef};
use crate::runtime::Store;
use crate::types::ValType;
use cranelift_codegen::ir;
use std::ptr;
use wasmtime_jit::RuntimeValue;
@@ -228,7 +228,7 @@ pub(crate) fn into_checked_anyfunc(
} => (*vmctx, *address, signature),
_ => panic!("expected function export"),
};
let type_index = store.borrow_mut().register_cranelift_signature(signature);
let type_index = store.borrow_mut().register_wasmtime_signature(signature);
wasmtime_runtime::VMCallerCheckedAnyfunc {
func_ptr,
type_index,
@@ -248,7 +248,7 @@ pub(crate) fn from_checked_anyfunc(
}
let signature = store
.borrow()
.lookup_cranelift_signature(item.type_index)
.lookup_wasmtime_signature(item.type_index)
.expect("signature")
.clone();
let instance_handle = unsafe { wasmtime_runtime::InstanceHandle::from_vmctx(item.vmctx) };