#[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
impl Opcode
Sourcepub const fn as_instruction(&self) -> Instruction
pub const fn as_instruction(&self) -> Instruction
Converts this opcode to Instruction.
Sourcepub const fn deoptimize(self) -> Opcode
pub const fn deoptimize(self) -> Opcode
Map a specialized or instrumented opcode back to its adaptive (base) variant.
Source§impl Opcode
impl Opcode
pub const fn is_unconditional_jump(&self) -> bool
Sourcepub const fn is_assembler(&self) -> bool
pub const fn is_assembler(&self) -> bool
CPython’s IS_ASSEMBLER_OPCODE.
pub const fn is_scope_exit(&self) -> bool
Sourcepub const fn is_terminator(&self) -> bool
pub const fn is_terminator(&self) -> bool
CPython’s IS_TERMINATOR_OPCODE.
Sourcepub const fn is_no_fallthrough(&self) -> bool
pub const fn is_no_fallthrough(&self) -> bool
CPython’s IS_SCOPE_EXIT_OPCODE || IS_UNCONDITIONAL_JUMP_OPCODE.
Sourcepub const fn has_target(&self) -> bool
pub const fn has_target(&self) -> bool
CPython’s HAS_TARGET.
pub const fn is_block_push(&self) -> bool
Sourcepub fn stack_effect(&self, oparg: u32) -> i32
pub fn stack_effect(&self, oparg: u32) -> i32
Stack effect of Self::stack_effect_info.
Sourcepub fn stack_effect_jump(&self, oparg: u32) -> i32
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
impl Opcode
pub const fn cache_entries(self) -> usize
pub const fn deopt(self) -> Option<Opcode>
Sourcepub const fn has_eval_break(self) -> bool
pub const fn has_eval_break(self) -> bool
Does this opcode have ‘HAS_EVAL_BREAK_FLAG’ set.
pub const fn is_instrumented(self) -> bool
pub fn stack_effect_info(&self, oparg: u32) -> StackEffect
pub const fn to_base(self) -> Option<Opcode>
pub const fn to_instrumented(self) -> Option<Opcode>
pub const fn try_from_u8(value: u8) -> Result<Opcode, MarshalError>
Trait Implementations§
impl Copy for Opcode
impl Eq for Opcode
Source§impl From<Instruction> for Opcode
impl From<Instruction> for Opcode
Source§fn from(instr: Instruction) -> Opcode
fn from(instr: Instruction) -> Opcode
Converts to this type from the input type.
Source§impl From<Opcode> for Instruction
impl From<Opcode> for Instruction
Source§fn from(opcode: Opcode) -> Instruction
fn from(opcode: Opcode) -> Instruction
Converts to this type from the input type.
Source§impl From<Opcode> for AnyInstruction
impl From<Opcode> for AnyInstruction
Source§fn from(value: Opcode) -> AnyInstruction
fn from(value: Opcode) -> AnyInstruction
Converts to this type from the input type.
impl StructuralPartialEq for Opcode
Auto Trait Implementations§
impl Freeze for Opcode
impl RefUnwindSafe for Opcode
impl Send for Opcode
impl Sync for Opcode
impl Unpin for Opcode
impl UnsafeUnpin for Opcode
impl UnwindSafe for Opcode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Helper for T
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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