Skip to content

Commit 866496a

Browse files
committed
use Inst instead of Instance in WasmFuncCall
1 parent b61cb1c commit 866496a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

crates/wasmi/src/engine/executor/handler/dispatch.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub struct WasmFuncCall<'a, T, State> {
4646
code: &'a CodeMap,
4747
callee_ip: Ip,
4848
callee_sp: Sp,
49-
instance: Instance,
49+
instance: Inst,
5050
state: State,
5151
}
5252

@@ -101,17 +101,16 @@ impl<'a, T> WasmFuncCall<'a, T, state::Init> {
101101
}
102102

103103
fn execute_until_done(&mut self) -> Result<Sp, ExecutionOutcome> {
104-
let instance = resolve_instance(self.store.prune(), &self.instance).into();
105104
let store = self.store.prune();
106-
let (mem0, mem0_len) = utils::extract_mem0(store, instance);
105+
let (mem0, mem0_len) = utils::extract_mem0(store, self.instance);
107106
let state = VmState::new(store, self.stack, self.code);
108107
execute_until_done(
109108
state,
110109
self.callee_ip,
111110
self.callee_sp,
112111
mem0,
113112
mem0_len,
114-
instance,
113+
self.instance,
115114
)
116115
}
117116
}
@@ -136,13 +135,13 @@ pub fn init_wasm_func_call<'a, T>(
136135
let callee_ip = Ip::from(compiled_func.ops());
137136
let frame_size = compiled_func.len_stack_slots();
138137
let callee_params = BoundedSlotSpan::new(SlotSpan::new(Slot::from(0)), frame_size);
139-
let instance_ref = resolve_instance(store.prune(), &instance);
138+
let instance = resolve_instance(store.prune(), &instance).into();
140139
let callee_sp = stack.push_frame(
141140
None,
142141
callee_ip,
143142
callee_params,
144143
usize::from(frame_size),
145-
Some(instance_ref.into()),
144+
Some(instance),
146145
)?;
147146
Ok(WasmFuncCall {
148147
store,

0 commit comments

Comments
 (0)