Skip to main content

Opcode

Enum Opcode 

Source
#[repr(u8)]
pub enum Opcode {
Show 227 variants Cache = 0, BinarySlice = 1, BuildTemplate = 2, BinaryOpInplaceAddUnicode = 3, CallFunctionEx = 4, CheckEgMatch = 5, CheckExcMatch = 6, CleanupThrow = 7, DeleteSubscr = 8, EndFor = 9, EndSend = 10, ExitInitCheck = 11, FormatSimple = 12, FormatWithSpec = 13, GetAiter = 14, GetAnext = 15, GetIter = 16, Reserved = 17, GetLen = 18, GetYieldFromIter = 19, InterpreterExit = 20, LoadBuildClass = 21, LoadLocals = 22, MakeFunction = 23, MatchKeys = 24, MatchMapping = 25, MatchSequence = 26, Nop = 27, NotTaken = 28, PopExcept = 29, PopIter = 30, PopTop = 31, PushExcInfo = 32, PushNull = 33, ReturnGenerator = 34, ReturnValue = 35, SetupAnnotations = 36, StoreSlice = 37, StoreSubscr = 38, ToBool = 39, UnaryInvert = 40, UnaryNegative = 41, UnaryNot = 42, WithExceptStart = 43, BinaryOp = 44, BuildInterpolation = 45, BuildList = 46, BuildMap = 47, BuildSet = 48, BuildSlice = 49, BuildString = 50, BuildTuple = 51, Call = 52, CallIntrinsic1 = 53, CallIntrinsic2 = 54, CallKw = 55, CompareOp = 56, ContainsOp = 57, ConvertValue = 58, Copy = 59, CopyFreeVars = 60, DeleteAttr = 61, DeleteDeref = 62, DeleteFast = 63, DeleteGlobal = 64, DeleteName = 65, DictMerge = 66, DictUpdate = 67, EndAsyncFor = 68, ExtendedArg = 69, ForIter = 70, GetAwaitable = 71, ImportFrom = 72, ImportName = 73, IsOp = 74, JumpBackward = 75, JumpBackwardNoInterrupt = 76, JumpForward = 77, ListAppend = 78, ListExtend = 79, LoadAttr = 80, LoadCommonConstant = 81, LoadConst = 82, LoadDeref = 83, LoadFast = 84, LoadFastAndClear = 85, LoadFastBorrow = 86, LoadFastBorrowLoadFastBorrow = 87, LoadFastCheck = 88, LoadFastLoadFast = 89, LoadFromDictOrDeref = 90, LoadFromDictOrGlobals = 91, LoadGlobal = 92, LoadName = 93, LoadSmallInt = 94, LoadSpecial = 95, LoadSuperAttr = 96, MakeCell = 97, MapAdd = 98, MatchClass = 99, PopJumpIfFalse = 100, PopJumpIfNone = 101, PopJumpIfNotNone = 102, PopJumpIfTrue = 103, RaiseVarargs = 104, Reraise = 105, Send = 106, SetAdd = 107, SetFunctionAttribute = 108, SetUpdate = 109, StoreAttr = 110, StoreDeref = 111, StoreFast = 112, StoreFastLoadFast = 113, StoreFastStoreFast = 114, StoreGlobal = 115, StoreName = 116, Swap = 117, UnpackEx = 118, UnpackSequence = 119, YieldValue = 120, Resume = 128, BinaryOpAddFloat = 129, BinaryOpAddInt = 130, BinaryOpAddUnicode = 131, BinaryOpExtend = 132, BinaryOpMultiplyFloat = 133, BinaryOpMultiplyInt = 134, BinaryOpSubscrDict = 135, BinaryOpSubscrGetitem = 136, BinaryOpSubscrListInt = 137, BinaryOpSubscrListSlice = 138, BinaryOpSubscrStrInt = 139, BinaryOpSubscrTupleInt = 140, BinaryOpSubtractFloat = 141, BinaryOpSubtractInt = 142, CallAllocAndEnterInit = 143, CallBoundMethodExactArgs = 144, CallBoundMethodGeneral = 145, CallBuiltinClass = 146, CallBuiltinFast = 147, CallBuiltinFastWithKeywords = 148, CallBuiltinO = 149, CallIsinstance = 150, CallKwBoundMethod = 151, CallKwNonPy = 152, CallKwPy = 153, CallLen = 154, CallListAppend = 155, CallMethodDescriptorFast = 156, CallMethodDescriptorFastWithKeywords = 157, CallMethodDescriptorNoargs = 158, CallMethodDescriptorO = 159, CallNonPyGeneral = 160, CallPyExactArgs = 161, CallPyGeneral = 162, CallStr1 = 163, CallTuple1 = 164, CallType1 = 165, CompareOpFloat = 166, CompareOpInt = 167, CompareOpStr = 168, ContainsOpDict = 169, ContainsOpSet = 170, ForIterGen = 171, ForIterList = 172, ForIterRange = 173, ForIterTuple = 174, JumpBackwardJit = 175, JumpBackwardNoJit = 176, LoadAttrClass = 177, LoadAttrClassWithMetaclassCheck = 178, LoadAttrGetattributeOverridden = 179, LoadAttrInstanceValue = 180, LoadAttrMethodLazyDict = 181, LoadAttrMethodNoDict = 182, LoadAttrMethodWithValues = 183, LoadAttrModule = 184, LoadAttrNondescriptorNoDict = 185, LoadAttrNondescriptorWithValues = 186, LoadAttrProperty = 187, LoadAttrSlot = 188, LoadAttrWithHint = 189, LoadConstImmortal = 190, LoadConstMortal = 191, LoadGlobalBuiltin = 192, LoadGlobalModule = 193, LoadSuperAttrAttr = 194, LoadSuperAttrMethod = 195, ResumeCheck = 196, SendGen = 197, StoreAttrInstanceValue = 198, StoreAttrSlot = 199, StoreAttrWithHint = 200, StoreSubscrDict = 201, StoreSubscrListInt = 202, ToBoolAlwaysTrue = 203, ToBoolBool = 204, ToBoolInt = 205, ToBoolList = 206, ToBoolNone = 207, ToBoolStr = 208, UnpackSequenceList = 209, UnpackSequenceTuple = 210, UnpackSequenceTwoTuple = 211, InstrumentedEndFor = 234, InstrumentedPopIter = 235, InstrumentedEndSend = 236, InstrumentedForIter = 237, InstrumentedInstruction = 238, InstrumentedJumpForward = 239, InstrumentedNotTaken = 240, InstrumentedPopJumpIfTrue = 241, InstrumentedPopJumpIfFalse = 242, InstrumentedPopJumpIfNone = 243, InstrumentedPopJumpIfNotNone = 244, InstrumentedResume = 245, InstrumentedReturnValue = 246, InstrumentedYieldValue = 247, InstrumentedEndAsyncFor = 248, InstrumentedLoadSuperAttr = 249, InstrumentedCall = 250, InstrumentedCallKw = 251, InstrumentedCallFunctionEx = 252, InstrumentedJumpBackward = 253, InstrumentedLine = 254, EnterExecutor = 255,
}

Variants§

§

Cache = 0

§

BinarySlice = 1

§

BuildTemplate = 2

§

BinaryOpInplaceAddUnicode = 3

§

CallFunctionEx = 4

§

CheckEgMatch = 5

§

CheckExcMatch = 6

§

CleanupThrow = 7

§

DeleteSubscr = 8

§

EndFor = 9

§

EndSend = 10

§

ExitInitCheck = 11

§

FormatSimple = 12

§

FormatWithSpec = 13

§

GetAiter = 14

§

GetAnext = 15

§

GetIter = 16

§

Reserved = 17

§

GetLen = 18

§

GetYieldFromIter = 19

§

InterpreterExit = 20

§

LoadBuildClass = 21

§

LoadLocals = 22

§

MakeFunction = 23

§

MatchKeys = 24

§

MatchMapping = 25

§

MatchSequence = 26

§

Nop = 27

§

NotTaken = 28

§

PopExcept = 29

§

PopIter = 30

§

PopTop = 31

§

PushExcInfo = 32

§

PushNull = 33

§

ReturnGenerator = 34

§

ReturnValue = 35

§

SetupAnnotations = 36

§

StoreSlice = 37

§

StoreSubscr = 38

§

ToBool = 39

§

UnaryInvert = 40

§

UnaryNegative = 41

§

UnaryNot = 42

§

WithExceptStart = 43

§

BinaryOp = 44

§

BuildInterpolation = 45

§

BuildList = 46

§

BuildMap = 47

§

BuildSet = 48

§

BuildSlice = 49

§

BuildString = 50

§

BuildTuple = 51

§

Call = 52

§

CallIntrinsic1 = 53

§

CallIntrinsic2 = 54

§

CallKw = 55

§

CompareOp = 56

§

ContainsOp = 57

§

ConvertValue = 58

§

Copy = 59

§

CopyFreeVars = 60

§

DeleteAttr = 61

§

DeleteDeref = 62

§

DeleteFast = 63

§

DeleteGlobal = 64

§

DeleteName = 65

§

DictMerge = 66

§

DictUpdate = 67

§

EndAsyncFor = 68

§

ExtendedArg = 69

§

ForIter = 70

§

GetAwaitable = 71

§

ImportFrom = 72

§

ImportName = 73

§

IsOp = 74

§

JumpBackward = 75

§

JumpBackwardNoInterrupt = 76

§

JumpForward = 77

§

ListAppend = 78

§

ListExtend = 79

§

LoadAttr = 80

§

LoadCommonConstant = 81

§

LoadConst = 82

§

LoadDeref = 83

§

LoadFast = 84

§

LoadFastAndClear = 85

§

LoadFastBorrow = 86

§

LoadFastBorrowLoadFastBorrow = 87

§

LoadFastCheck = 88

§

LoadFastLoadFast = 89

§

LoadFromDictOrDeref = 90

§

LoadFromDictOrGlobals = 91

§

LoadGlobal = 92

§

LoadName = 93

§

LoadSmallInt = 94

§

LoadSpecial = 95

§

LoadSuperAttr = 96

§

MakeCell = 97

§

MapAdd = 98

§

MatchClass = 99

§

PopJumpIfFalse = 100

§

PopJumpIfNone = 101

§

PopJumpIfNotNone = 102

§

PopJumpIfTrue = 103

§

RaiseVarargs = 104

§

Reraise = 105

§

Send = 106

§

SetAdd = 107

§

SetFunctionAttribute = 108

§

SetUpdate = 109

§

StoreAttr = 110

§

StoreDeref = 111

§

StoreFast = 112

§

StoreFastLoadFast = 113

§

StoreFastStoreFast = 114

§

StoreGlobal = 115

§

StoreName = 116

§

Swap = 117

§

UnpackEx = 118

§

UnpackSequence = 119

§

YieldValue = 120

§

Resume = 128

§

BinaryOpAddFloat = 129

§

BinaryOpAddInt = 130

§

BinaryOpAddUnicode = 131

§

BinaryOpExtend = 132

§

BinaryOpMultiplyFloat = 133

§

BinaryOpMultiplyInt = 134

§

BinaryOpSubscrDict = 135

§

BinaryOpSubscrGetitem = 136

§

BinaryOpSubscrListInt = 137

§

BinaryOpSubscrListSlice = 138

§

BinaryOpSubscrStrInt = 139

§

BinaryOpSubscrTupleInt = 140

§

BinaryOpSubtractFloat = 141

§

BinaryOpSubtractInt = 142

§

CallAllocAndEnterInit = 143

§

CallBoundMethodExactArgs = 144

§

CallBoundMethodGeneral = 145

§

CallBuiltinClass = 146

§

CallBuiltinFast = 147

§

CallBuiltinFastWithKeywords = 148

§

CallBuiltinO = 149

§

CallIsinstance = 150

§

CallKwBoundMethod = 151

§

CallKwNonPy = 152

§

CallKwPy = 153

§

CallLen = 154

§

CallListAppend = 155

§

CallMethodDescriptorFast = 156

§

CallMethodDescriptorFastWithKeywords = 157

§

CallMethodDescriptorNoargs = 158

§

CallMethodDescriptorO = 159

§

CallNonPyGeneral = 160

§

CallPyExactArgs = 161

§

CallPyGeneral = 162

§

CallStr1 = 163

§

CallTuple1 = 164

§

CallType1 = 165

§

CompareOpFloat = 166

§

CompareOpInt = 167

§

CompareOpStr = 168

§

ContainsOpDict = 169

§

ContainsOpSet = 170

§

ForIterGen = 171

§

ForIterList = 172

§

ForIterRange = 173

§

ForIterTuple = 174

§

JumpBackwardJit = 175

§

JumpBackwardNoJit = 176

§

LoadAttrClass = 177

§

LoadAttrClassWithMetaclassCheck = 178

§

LoadAttrGetattributeOverridden = 179

§

LoadAttrInstanceValue = 180

§

LoadAttrMethodLazyDict = 181

§

LoadAttrMethodNoDict = 182

§

LoadAttrMethodWithValues = 183

§

LoadAttrModule = 184

§

LoadAttrNondescriptorNoDict = 185

§

LoadAttrNondescriptorWithValues = 186

§

LoadAttrProperty = 187

§

LoadAttrSlot = 188

§

LoadAttrWithHint = 189

§

LoadConstImmortal = 190

§

LoadConstMortal = 191

§

LoadGlobalBuiltin = 192

§

LoadGlobalModule = 193

§

LoadSuperAttrAttr = 194

§

LoadSuperAttrMethod = 195

§

ResumeCheck = 196

§

SendGen = 197

§

StoreAttrInstanceValue = 198

§

StoreAttrSlot = 199

§

StoreAttrWithHint = 200

§

StoreSubscrDict = 201

§

StoreSubscrListInt = 202

§

ToBoolAlwaysTrue = 203

§

ToBoolBool = 204

§

ToBoolInt = 205

§

ToBoolList = 206

§

ToBoolNone = 207

§

ToBoolStr = 208

§

UnpackSequenceList = 209

§

UnpackSequenceTuple = 210

§

UnpackSequenceTwoTuple = 211

§

InstrumentedEndFor = 234

§

InstrumentedPopIter = 235

§

InstrumentedEndSend = 236

§

InstrumentedForIter = 237

§

InstrumentedInstruction = 238

§

InstrumentedJumpForward = 239

§

InstrumentedNotTaken = 240

§

InstrumentedPopJumpIfTrue = 241

§

InstrumentedPopJumpIfFalse = 242

§

InstrumentedPopJumpIfNone = 243

§

InstrumentedPopJumpIfNotNone = 244

§

InstrumentedResume = 245

§

InstrumentedReturnValue = 246

§

InstrumentedYieldValue = 247

§

InstrumentedEndAsyncFor = 248

§

InstrumentedLoadSuperAttr = 249

§

InstrumentedCall = 250

§

InstrumentedCallKw = 251

§

InstrumentedCallFunctionEx = 252

§

InstrumentedJumpBackward = 253

§

InstrumentedLine = 254

§

EnterExecutor = 255

Implementations§

Source§

impl Opcode

Source

pub const fn as_instruction(&self) -> Instruction

Converts this opcode to Instruction.

Source

pub const fn deoptimize(self) -> Opcode

Map a specialized or instrumented opcode back to its adaptive (base) variant.

Source§

impl Opcode

Source

pub const fn is_unconditional_jump(&self) -> bool

Source

pub const fn is_assembler(&self) -> bool

CPython’s IS_ASSEMBLER_OPCODE.

Source

pub const fn is_scope_exit(&self) -> bool

Source

pub const fn is_terminator(&self) -> bool

CPython’s IS_TERMINATOR_OPCODE.

Source

pub const fn is_no_fallthrough(&self) -> bool

CPython’s IS_SCOPE_EXIT_OPCODE || IS_UNCONDITIONAL_JUMP_OPCODE.

Source

pub const fn has_target(&self) -> bool

CPython’s HAS_TARGET.

Source

pub const fn is_block_push(&self) -> bool

Source

pub fn stack_effect(&self, oparg: u32) -> i32

Stack effect of Self::stack_effect_info.

Source

pub fn stack_effect_jump(&self, oparg: u32) -> i32

Stack effect when the instruction takes its branch (jump=true).

CPython equivalent: stack_effect(opcode, oparg, jump=True). Current opcode metadata has the same real-opcode stack effect for jump and fallthrough stack-depth calculation.

Source§

impl Opcode

Source

pub const fn as_u8(self) -> u8

Returns Self as u8.

Source

pub const fn cache_entries(self) -> usize

Source

pub const fn deopt(self) -> Option<Opcode>

Source

pub const fn has_arg(self) -> bool

Does this opcode have ‘HAS_ARG_FLAG’ set.

Source

pub const fn has_const(self) -> bool

Does this opcode have ‘HAS_CONST_FLAG’ set.

Source

pub const fn has_eval_break(self) -> bool

Does this opcode have ‘HAS_EVAL_BREAK_FLAG’ set.

Source

pub const fn has_free(self) -> bool

Does this opcode have ‘HAS_FREE_FLAG’ set.

Source

pub const fn has_jump(self) -> bool

Does this opcode have ‘HAS_JUMP_FLAG’ set.

Source

pub const fn has_local(self) -> bool

Does this opcode have ‘HAS_LOCAL_FLAG’ set.

Source

pub const fn has_name(self) -> bool

Does this opcode have ‘HAS_NAME_FLAG’ set.

Source

pub const fn is_instrumented(self) -> bool

Source

pub fn stack_effect_info(&self, oparg: u32) -> StackEffect

Source

pub const fn to_base(self) -> Option<Opcode>

Source

pub const fn to_instrumented(self) -> Option<Opcode>

Source

pub const fn try_from_u8(value: u8) -> Result<Opcode, MarshalError>

Trait Implementations§

Source§

impl Clone for Opcode

Source§

fn clone(&self) -> Opcode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Opcode

Source§

impl Debug for Opcode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for Opcode

Source§

impl From<Instruction> for Opcode

Source§

fn from(instr: Instruction) -> Opcode

Converts to this type from the input type.
Source§

impl From<Opcode> for Instruction

Source§

fn from(opcode: Opcode) -> Instruction

Converts to this type from the input type.
Source§

impl From<Opcode> for AnyInstruction

Source§

fn from(value: Opcode) -> AnyInstruction

Converts to this type from the input type.
Source§

impl From<Opcode> for AnyOpcode

Source§

fn from(value: Opcode) -> AnyOpcode

Converts to this type from the input type.
Source§

impl PartialEq for Opcode

Source§

fn eq(&self, other: &Opcode) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Opcode

Source§

impl TryFrom<u8> for Opcode

Source§

type Error = MarshalError

The type returned in the event of a conversion error.
Source§

fn try_from(value: u8) -> Result<Opcode, <Opcode as TryFrom<u8>>::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T, U> ExactFrom<T> for U
where U: TryFrom<T>,

Source§

fn exact_from(value: T) -> U

Source§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

Source§

fn exact_into(self) -> U

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Helper for T

Source§

impl<T, U> ImaginaryInto<U> for T
where U: ImaginaryFrom<T>,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

Source§

impl<T> PrimitiveIntRandomBounds for T

Source§

impl<T> PrimitiveSignedRandomBounds for T

Source§

impl<T> PyThreadingConstraint for T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

Source§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

Source§

impl<T> ToDebugString for T
where T: Debug,

Source§

fn to_debug_string(&self) -> String

Returns the String produced by Ts Debug implementation.

§Examples
use malachite_base::strings::ToDebugString;

assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
    [vec![2, 3], vec![], vec![4]].to_debug_string(),
    "[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

Source§

fn wrapping_into(self) -> U