wasmtime: Rip out incomplete/incorrect externref "host info" support

Better to be loud that we don't support attaching arbitrary host info to
`externref`s than to limp along and pretend we do support it. Supporting it
properly won't reuse any of this code anyways.
This commit is contained in:
Nick Fitzgerald
2020-06-25 10:24:40 -07:00
parent 9ce67d8cad
commit e40c039e65
19 changed files with 80 additions and 199 deletions

View File

@@ -1,7 +1,7 @@
use crate::host_ref::HostRef;
use crate::{wasm_frame_vec_t, wasm_instance_t, wasm_name_t, wasm_store_t};
use once_cell::unsync::OnceCell;
use wasmtime::{Store, Trap};
use wasmtime::Trap;
#[repr(C)]
#[derive(Clone)]
@@ -12,9 +12,9 @@ pub struct wasm_trap_t {
wasmtime_c_api_macros::declare_ref!(wasm_trap_t);
impl wasm_trap_t {
pub(crate) fn new(store: &Store, trap: Trap) -> wasm_trap_t {
pub(crate) fn new(trap: Trap) -> wasm_trap_t {
wasm_trap_t {
trap: HostRef::new(store, trap),
trap: HostRef::new(trap),
}
}
@@ -38,7 +38,7 @@ pub type wasm_message_t = wasm_name_t;
#[no_mangle]
pub extern "C" fn wasm_trap_new(
store: &wasm_store_t,
_store: &wasm_store_t,
message: &wasm_message_t,
) -> Box<wasm_trap_t> {
let message = message.as_slice();
@@ -47,7 +47,7 @@ pub extern "C" fn wasm_trap_new(
}
let message = String::from_utf8_lossy(&message[..message.len() - 1]);
Box::new(wasm_trap_t {
trap: HostRef::new(&store.store, Trap::new(message)),
trap: HostRef::new(Trap::new(message)),
})
}