Skip to content

Commit

Permalink
move StoreInner conversion a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbepop committed Jan 14, 2023
1 parent 08a4303 commit c12b003
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
11 changes: 2 additions & 9 deletions crates/wasmi/src/engine/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use super::{
cache::InstanceCache,
code_map::InstructionPtr,
stack::ValueStackRef,
AsContextMut,
CallOutcome,
DropKeep,
FuncFrame,
Expand All @@ -26,18 +25,12 @@ use wasmi_core::{Pages, UntypedValue};
/// - If the execution of the function `frame` trapped.
#[inline(always)]
pub fn execute_frame<'engine>(
mut ctx: impl AsContextMut,
ctx: &mut StoreInner,
value_stack: &'engine mut ValueStack,
cache: &'engine mut InstanceCache,
frame: &mut FuncFrame,
) -> Result<CallOutcome, TrapCode> {
Executor::new(
value_stack,
&mut ctx.as_context_mut().store.inner,
cache,
frame,
)
.execute()
Executor::new(value_stack, ctx, cache, frame).execute()
}

/// The function signature of Wasm load operations.
Expand Down
10 changes: 8 additions & 2 deletions crates/wasmi/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ impl<'engine> EngineExecutor<'engine> {
#[inline(always)]
fn execute_frame(
&mut self,
ctx: impl AsContextMut,
mut ctx: impl AsContextMut,
frame: &mut FuncFrame,
cache: &mut InstanceCache,
) -> Result<CallOutcome, Trap> {
Expand All @@ -729,6 +729,12 @@ impl<'engine> EngineExecutor<'engine> {
}

let value_stack = &mut self.stack.values;
execute_frame(ctx, value_stack, cache, frame).map_err(make_trap)
execute_frame(
&mut ctx.as_context_mut().store.inner,
value_stack,
cache,
frame,
)
.map_err(make_trap)
}
}

0 comments on commit c12b003

Please sign in to comment.