Remove old single-purpose instructions

These instructions were used because it was more painful to implement
lookups and function calls for operators with the AST body compiler.

This is less of a hurdle now with the list compiler, and since these
instructions are extensive and involve a lot of copy-paste, they have
been removed to help with code bloat.

They may be reintroduced in the future for optimization purposes.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-11-10 19:14:56 -08:00
parent 6ec14e3ffa
commit 53feed7eab
2 changed files with 0 additions and 190 deletions

View File

@@ -63,60 +63,6 @@ pub enum Inst {
/// Pops the top value from the stack, and returns from the function, using the popped value as
/// a return value.
Return,
/// Replaces the top stack value with its negation applied.
UnNeg,
/// Replaces the top stack value with its absolute value applied.
UnPos,
/// Pops the top two items off of the stack, and applies the binary addition operator to them,
/// pushing the result to the stack.
BinPlus,
/// Pops the top two items off of the stack, and applies the binary subtraction operator to
/// them, pushing the result to the stack.
BinMinus,
/// Pops the top two items off of the stack, and applies the binary multiplication operator to
/// them, pushing the result to the stack.
BinMul,
/// Pops the top two items off of the stack, and applies the binary division operator to them,
/// pushing the result to the stack.
BinDiv,
/// Pops the top two items off of the stack, and applies the boolean equality operator to them,
/// pushing the result to the stack.
BinEq,
/// Pops the top two items off of the stack, and applies the boolean inequality operator to
/// them, pushing the result to the stack.
BinNeq,
/// Pops the top two items off of the stack, and applies the boolean less-than operator to
/// them, pushing the result to the stack.
BinLt,
/// Pops the top two items off of the stack, and applies the binary less-than or equals
/// operator to them, pushing the result to the stack.
BinLe,
/// Pops the top two items off of the stack, and applies the boolean greater-than operator to
/// them, pushing the result to the stack.
BinGt,
/// Pops the top two items off of the stack, and applies the binary greater-than or equals
/// operator to them, pushing the result to the stack.
BinGe,
/// Pops the top two items off of the stack, and applies the boolean and operator to them,
/// pushing the result to the stack.
BinAnd,
/// Pops the top two items off of the stack, and applies the boolean or operator to them,
/// pushing the result to the stack.
BinOr,
}
//
@@ -139,20 +85,6 @@ impl Inst {
Inst::Call(_) => "CALL",
Inst::Index => "INDEX",
Inst::Return => "RETURN",
Inst::UnNeg => "UN_NEG",
Inst::UnPos => "UN_POS",
Inst::BinPlus => "BIN_PLUS",
Inst::BinMinus => "BIN_MINUS",
Inst::BinMul => "BIN_MUL",
Inst::BinDiv => "BIN_DIV",
Inst::BinEq => "BIN_EQ",
Inst::BinNeq => "BIN_NEQ",
Inst::BinLt => "BIN_LT",
Inst::BinLe => "BIN_LE",
Inst::BinGt => "BIN_GT",
Inst::BinGe => "BIN_GE",
Inst::BinAnd => "BIN_AND",
Inst::BinOr => "BIN_OR",
}
}
}