[−][src]Enum rustpython_vm::bytecode::Instruction
pub enum Instruction { Import { name: Option<String>, symbols: Vec<String>, level: usize, }, ImportStar, ImportFrom { name: String, }, LoadName { name: String, scope: NameScope, }, StoreName { name: String, scope: NameScope, }, DeleteName { name: String, }, Subscript, StoreSubscript, DeleteSubscript, StoreAttr { name: String, }, DeleteAttr { name: String, }, LoadConst { value: Constant, }, UnaryOperation { op: UnaryOperator, }, BinaryOperation { op: BinaryOperator, inplace: bool, }, LoadAttr { name: String, }, CompareOperation { op: ComparisonOperator, }, Pop, Rotate { amount: usize, }, Duplicate, GetIter, Continue, Break, Jump { target: Label, }, JumpIfTrue { target: Label, }, JumpIfFalse { target: Label, }, JumpIfTrueOrPop { target: Label, }, JumpIfFalseOrPop { target: Label, }, MakeFunction, CallFunction { typ: CallType, }, ForIter { target: Label, }, ReturnValue, YieldValue, YieldFrom, SetupLoop { start: Label, end: Label, }, SetupFinally { handler: Label, }, EnterFinally, EndFinally, SetupExcept { handler: Label, }, SetupWith { end: Label, }, WithCleanupStart, WithCleanupFinish, PopBlock, Raise { argc: usize, }, BuildString { size: usize, }, BuildTuple { size: usize, unpack: bool, }, BuildList { size: usize, unpack: bool, }, BuildSet { size: usize, unpack: bool, }, BuildMap { size: usize, unpack: bool, for_call: bool, }, BuildSlice { size: usize, }, ListAppend { i: usize, }, SetAdd { i: usize, }, MapAdd { i: usize, }, PrintExpr, LoadBuildClass, UnpackSequence { size: usize, }, UnpackEx { before: usize, after: usize, }, FormatValue { conversion: Option<ConversionFlag>, }, PopException, Reverse { amount: usize, }, GetAwaitable, BeforeAsyncWith, SetupAsyncWith { end: Label, }, GetAIter, GetANext, }
A Single bytecode instruction.
Variants
Fields of ImportFrom
name: String
Fields of DeleteName
name: String
Fields of StoreAttr
name: String
Fields of DeleteAttr
name: String
Fields of LoadConst
value: Constant
Fields of UnaryOperation
op: UnaryOperator
Fields of BinaryOperation
op: BinaryOperator
inplace: bool
Fields of LoadAttr
name: String
Fields of CompareOperation
Fields of Rotate
amount: usize
Fields of Jump
target: Label
Pop the top of the stack, and jump if this value is true.
Fields of JumpIfTrue
target: Label
Pop the top of the stack, and jump if this value is false.
Fields of JumpIfFalse
target: Label
Peek at the top of the stack, and jump if this value is true. Otherwise, pop top of stack.
Fields of JumpIfTrueOrPop
target: Label
Peek at the top of the stack, and jump if this value is false. Otherwise, pop top of stack.
Fields of JumpIfFalseOrPop
target: Label
Fields of CallFunction
typ: CallType
Fields of ForIter
target: Label
Setup a finally handler, which will be called whenever one of this events occurs:
- the block is popped
- the function returns
- an exception is returned
Fields of SetupFinally
handler: Label
Enter a finally block, without returning, excepting, just because we are there.
Marker bytecode for the end of a finally sequence. When this bytecode is executed, the eval loop does one of those things:
- Continue at a certain bytecode position
- Propagate the exception
- Return from a function
- Do nothing at all, just continue
Fields of SetupExcept
handler: Label
Fields of SetupWith
end: Label
Fields of Raise
argc: usize
Fields of BuildString
size: usize
Fields of BuildSlice
size: usize
Fields of ListAppend
i: usize
Fields of SetAdd
i: usize
Fields of MapAdd
i: usize
Fields of UnpackSequence
size: usize
Fields of FormatValue
conversion: Option<ConversionFlag>
Fields of Reverse
amount: usize
Fields of SetupAsyncWith
end: Label
Trait Implementations
impl Clone for Instruction
[src][+]
impl Debug for Instruction
[src][+]
impl<'de> Deserialize<'de> for Instruction
[src][+]
impl PartialEq<Instruction> for Instruction
[src][+]
impl Serialize for Instruction
[src][+]
impl StructuralPartialEq for Instruction
[src]
Auto Trait Implementations
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[+]
V: MultiLane<T>,