Enum erg_common::opcode::Opcode
source · [−]#[repr(u8)]
pub enum Opcode {
Show 127 variants
POP_TOP,
ROT_TWO,
ROT_THREE,
DUP_TOP,
DUP_TOP2,
ROT_FOUR,
NOP,
UNARY_POSITIVE,
UNARY_NEGATIVE,
UNARY_NOT,
UNARY_INVERT,
BINARY_MATRIX_MULTIPLY,
INPLACE_MATRIX_MULTIPLY,
BINARY_POWER,
BINARY_MULTIPLY,
BINARY_MODULO,
BINARY_ADD,
BINARY_SUBTRACT,
BINARY_SUBSCR,
BINARY_TRUE_DIVIDE,
INPLACE_FLOOR_DIVIDE,
INPLACE_TRUE_DIVIDE,
GET_LEN,
MATCH_MAPPING,
MATCH_SEQUENCE,
MATCH_KEYS,
PUSH_EXC_INFO,
CHECK_EXC_MATCH,
CHECK_EG_MATCH,
WITH_EXCEPT_START,
GET_AITER,
GET_ANEXT,
BEFORE_ASYNC_WITH,
BEFORE_WITH,
END_ASYNC_FOR,
INPLACE_ADD,
INPLACE_SUBTRACT,
INPLACE_MULTIPLY,
INPLACE_MODULO,
STORE_SUBSCR,
BINARY_AND,
BINARY_XOR,
BINARY_OR,
GET_ITER,
GET_YIELD_FROM_ITER,
PRINT_EXPR,
LOAD_BUILD_CLASS,
LOAD_ASSERTION_ERROR,
LIST_TO_TUPLE,
RETURN_VALUE,
STORE_NAME,
DELETE_NAME,
UNPACK_SEQUENCE,
FOR_ITER,
UNPACK_EX,
STORE_ATTR,
STORE_GLOBAL,
LOAD_CONST,
LOAD_NAME,
BUILD_TUPLE,
BUILD_LIST,
BUILD_SET,
BUILD_MAP,
LOAD_ATTR,
COMPARE_OP,
IMPORT_NAME,
IMPORT_FROM,
JUMP_FORWARD,
JUMP_IF_FALSE_OR_POP,
JUMP_IF_TRUE_OR_POP,
JUMP_ABSOLUTE,
POP_JUMP_IF_FALSE,
POP_JUMP_IF_TRUE,
LOAD_GLOBAL,
IS_OP,
CONTAINS_OP,
LOAD_FAST,
STORE_FAST,
DELETE_FAST,
RAISE_VARARGS,
CALL_FUNCTION,
MAKE_FUNCTION,
LOAD_CLOSURE,
LOAD_DEREF,
STORE_DEREF,
CALL_FUNCTION_KW,
CALL_FUNCTION_EX,
LOAD_METHOD,
CALL_METHOD,
LIST_EXTEND,
ERG_POP_NTH,
ERG_PEEK_NTH,
ERG_INC,
ERG_DEC,
ERG_LOAD_FAST_IMMUT,
ERG_STORE_FAST_IMMUT,
ERG_MOVE_FAST,
ERG_CLONE_FAST,
ERG_COPY_FAST,
ERG_REF_FAST,
ERG_REF_MUT_FAST,
ERG_MOVE_OUTER,
ERG_CLONE_OUTER,
ERG_COPY_OUTER,
ERG_REF_OUTER,
ERG_REF_MUT_OUTER,
ERG_LESS_THAN,
ERG_LESS_EQUAL,
ERG_EQUAL,
ERG_NOT_EQUAL,
ERG_MAKE_SLOT,
ERG_MAKE_TYPE,
ERG_MAKE_PURE_FUNCTION,
ERG_CALL_PURE_FUNCTION,
ERG_LOAD_EMPTY_SLOT,
ERG_LOAD_EMPTY_STR,
ERG_LOAD_1_NAT,
ERG_LOAD_1_INT,
ERG_LOAD_1_REAL,
ERG_LOAD_NONE,
ERG_MUTATE,
ERG_STORE_SUBSCR,
ERG_BINARY_SUBSCR,
ERG_BINARY_RANGE,
ERG_TRY_BINARY_DIVIDE,
ERG_BINARY_TRUE_DIVIDE,
NOT_IMPLEMENTED,
}
Expand description
Based on Python opcodes. This is represented by u8.
TODO: implement all opcodes
Variants
POP_TOP
ROT_TWO
ROT_THREE
DUP_TOP
DUP_TOP2
ROT_FOUR
NOP
UNARY_POSITIVE
UNARY_NEGATIVE
UNARY_NOT
UNARY_INVERT
BINARY_MATRIX_MULTIPLY
INPLACE_MATRIX_MULTIPLY
BINARY_POWER
BINARY_MULTIPLY
BINARY_MODULO
BINARY_ADD
BINARY_SUBTRACT
BINARY_SUBSCR
BINARY_TRUE_DIVIDE
INPLACE_FLOOR_DIVIDE
INPLACE_TRUE_DIVIDE
GET_LEN
MATCH_MAPPING
MATCH_SEQUENCE
MATCH_KEYS
PUSH_EXC_INFO
CHECK_EXC_MATCH
CHECK_EG_MATCH
WITH_EXCEPT_START
GET_AITER
GET_ANEXT
BEFORE_ASYNC_WITH
BEFORE_WITH
END_ASYNC_FOR
INPLACE_ADD
INPLACE_SUBTRACT
INPLACE_MULTIPLY
INPLACE_MODULO
STORE_SUBSCR
BINARY_AND
BINARY_XOR
BINARY_OR
GET_ITER
GET_YIELD_FROM_ITER
PRINT_EXPR
LOAD_BUILD_CLASS
LOAD_ASSERTION_ERROR
LIST_TO_TUPLE
RETURN_VALUE
STORE_NAME
DELETE_NAME
UNPACK_SEQUENCE
FOR_ITER
UNPACK_EX
STORE_ATTR
STORE_GLOBAL
LOAD_CONST
LOAD_NAME
BUILD_TUPLE
BUILD_LIST
BUILD_SET
BUILD_MAP
LOAD_ATTR
COMPARE_OP
IMPORT_NAME
IMPORT_FROM
JUMP_FORWARD
JUMP_IF_FALSE_OR_POP
JUMP_IF_TRUE_OR_POP
JUMP_ABSOLUTE
POP_JUMP_IF_FALSE
POP_JUMP_IF_TRUE
LOAD_GLOBAL
IS_OP
CONTAINS_OP
LOAD_FAST
STORE_FAST
DELETE_FAST
RAISE_VARARGS
CALL_FUNCTION
MAKE_FUNCTION
LOAD_CLOSURE
LOAD_DEREF
STORE_DEREF
CALL_FUNCTION_KW
CALL_FUNCTION_EX
LOAD_METHOD
CALL_METHOD
LIST_EXTEND
ERG_POP_NTH
ERG_PEEK_NTH
ERG_INC
ERG_DEC
ERG_LOAD_FAST_IMMUT
ERG_STORE_FAST_IMMUT
ERG_MOVE_FAST
ERG_CLONE_FAST
ERG_COPY_FAST
ERG_REF_FAST
ERG_REF_MUT_FAST
ERG_MOVE_OUTER
ERG_CLONE_OUTER
ERG_COPY_OUTER
ERG_REF_OUTER
ERG_REF_MUT_OUTER
ERG_LESS_THAN
ERG_LESS_EQUAL
ERG_EQUAL
ERG_NOT_EQUAL
ERG_MAKE_SLOT
ERG_MAKE_TYPE
ERG_MAKE_PURE_FUNCTION
ERG_CALL_PURE_FUNCTION
ERG_LOAD_EMPTY_SLOT
ERG_LOAD_EMPTY_STR
ERG_LOAD_1_NAT
ERG_LOAD_1_INT
ERG_LOAD_1_REAL
ERG_LOAD_NONE
ERG_MUTATE
ERG_STORE_SUBSCR
[] =
(it doesn’t cause any exceptions)
ERG_BINARY_SUBSCR
= []
(it doesn’t cause any exceptions)
ERG_BINARY_RANGE
ERG_TRY_BINARY_DIVIDE
/?
(rhs may be 0, it may cause a runtime panic)
ERG_BINARY_TRUE_DIVIDE
/
(rhs could not be 0, it doesn’t cause any exceptions)
NOT_IMPLEMENTED
Implementations
Trait Implementations
sourceimpl Ord for Opcode
impl Ord for Opcode
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Opcode> for Opcode
impl PartialOrd<Opcode> for Opcode
sourcefn partial_cmp(&self, other: &Opcode) -> Option<Ordering>
fn partial_cmp(&self, other: &Opcode) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Opcode
impl Eq for Opcode
impl StructuralEq for Opcode
impl StructuralPartialEq for Opcode
Auto Trait Implementations
impl RefUnwindSafe for Opcode
impl Send for Opcode
impl Sync for Opcode
impl Unpin for Opcode
impl UnwindSafe for Opcode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more