pub enum Op {
}Expand description
Operations supported by the virtual machine
Variants§
Return
Print the top value of the stack.
Call(usize)
Call function stored in the top of the stack.
ConstFloat(f64)
Pushes floating-point constant on the stack.
ConstBool(bool)
Pushes boolean constant on the stack.
Const(usize)
Pushes constant from the constant pool on the stack.
LoadIndex
Loads indexed element from the array and pushes it on the stack.
StoreIndex
Add
Add two top elements of the stack.
Sub
Mul
Div
Cmp
Compares top values of the stack. Puts comparison result on top of the stack.
Not
Inverts boolean value on top of the stack.
Le
Pushes true on the stack if the first value is less or equal to the second.
Ge
Pushes true on the stack if the first value is greater or equal to the second.
Prints value on top of the stack.
StoreGlobal(String)
Takes the value from the top of the stack and stores it in the global variable.
LoadGlobal(String)
Load global variable value onto the stack.
StoreLocal(usize)
Takes the value from the top of the stack and stores it in the local variable.
LoadLocal(usize)
Load local variable value onto the stack.
Pop
Pops value from the top of the stack.
Nil
Pushes nil on the stack.
Jump(i32)
Unconditional jump to the given offset.
JumpIfFalse(i32)
Jump to the given offset if the top value of the stack is false.