Skip to content

Commit

Permalink
avoid unnecessary stack push/pop in specialized iltconst32
Browse files Browse the repository at this point in the history
  • Loading branch information
y21 committed Dec 29, 2023
1 parent 46445ac commit e891408
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/dash_vm/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ mod handlers {

macro_rules! bin_op_numl_constr_n {
($op:tt, $ty:ty) => {{
let left = match cx.pop_stack_rooted() {
let left = match cx.stack.last().unwrap() {
Value::Number(n) => n.0,
_ => unreachable!(),
};
Expand All @@ -1721,7 +1721,7 @@ mod handlers {
*byte = cx.fetch_and_inc_ip();
}
let right = <$ty>::from_ne_bytes(right_bytes) as f64;
cx.stack.push(Value::Boolean(left $op right));
*cx.stack.last_mut().unwrap() = Value::Boolean(left $op right);
}};
}

Expand Down

0 comments on commit e891408

Please sign in to comment.