Skip to content

Commit

Permalink
Get rid of actually-unused GPut/GPush opcodes
Browse files Browse the repository at this point in the history
* These came over from LambdaMOO opcodes list, but aren't even really
  used there.
* They're redundant and just the same as PUT/PUSH
* At some point we'll introduce more sophisticated scoping constructs
  and these will just get in the way
  • Loading branch information
rdaum committed Jul 5, 2024
1 parent a29009b commit 119cb60
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
11 changes: 0 additions & 11 deletions crates/compiler/src/decompile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,17 +794,6 @@ impl Decompile {
let e = Expr::List(vec![Arg::Splice(sp_expr)]);
self.push_expr(e);
}
Op::GPut { id } => {
let e = Expr::Assign {
left: Box::new(Expr::Id(id)),
right: Box::new(self.pop_expr()?),
};
self.push_expr(e);
}
Op::GPush { id } => {
let e = Expr::Id(id);
self.push_expr(e)
}
Op::PutProp => {
let rvalue = self.pop_expr()?;
let propname = self.pop_expr()?;
Expand Down
2 changes: 0 additions & 2 deletions crates/compiler/src/opcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ pub enum Op {
ForRange { id: Name, end_label: Label },
Fork { fv_offset: Offset, id: Option<Name> },
FuncCall { id: Name },
GPush { id: Name },
GPut { id: Name },
Ge,
GetProp,
Gt,
Expand Down
9 changes: 0 additions & 9 deletions crates/kernel/src/vm/moo_execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,15 +479,6 @@ pub fn moo_frame_execute(
}
}
}
Op::GPut { id } => {
f.set_env(id, f.peek_top().clone());
}
Op::GPush { id } => {
let Some(v) = f.get_env(id) else {
return state.push_error(E_VARNF);
};
f.push(v.clone());
}
Op::Length(offset) => {
let v = f.peek_abs(offset.0 as usize);
match v.len() {
Expand Down

0 comments on commit 119cb60

Please sign in to comment.