Skip to content

Commit

Permalink
Optimize metering flushes (#10)
Browse files Browse the repository at this point in the history
* Remove premature metering flushes

* git workflow
  • Loading branch information
jayz22 authored Nov 29, 2022
1 parent 1a99cdb commit ad705a6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions wasmi_v1/src/engine/exec_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,16 @@ impl<'engine, 'func> FunctionExecutor<'engine, 'func> {
Instr::GetLocal { local_depth } => { exec_ctx.visit_get_local(*local_depth)?; }
Instr::SetLocal { local_depth } => { exec_ctx.visit_set_local(*local_depth)?; }
Instr::TeeLocal { local_depth } => { exec_ctx.visit_tee_local(*local_depth)?; }
Instr::Br(target) => { step_meter.flush()?; exec_ctx.visit_br(*target)?; }
Instr::BrIfEqz(target) => { step_meter.flush()?; exec_ctx.visit_br_if_eqz(*target)?; }
Instr::BrIfNez(target) => { step_meter.flush()?; exec_ctx.visit_br_if_nez(*target)?; }
Instr::Br(target) => { exec_ctx.visit_br(*target)?; }
Instr::BrIfEqz(target) => { exec_ctx.visit_br_if_eqz(*target)?; }
Instr::BrIfNez(target) => { exec_ctx.visit_br_if_nez(*target)?; }
Instr::ReturnIfNez(drop_keep) => {
step_meter.flush()?;
if let MaybeReturn::Return = exec_ctx.visit_return_if_nez(*drop_keep)? {
step_meter.flush()?;
return Ok(CallOutcome::Return)
}
}
Instr::BrTable { len_targets } => {
step_meter.flush()?;
exec_ctx.visit_br_table(*len_targets)?;
}
Instr::Unreachable => { step_meter.flush()?; exec_ctx.visit_unreachable()?; }
Expand Down

0 comments on commit ad705a6

Please sign in to comment.