@@ -1022,98 +1022,88 @@ pub enum Instruction {
10221022 YieldValue {
10231023 arg : Arg < u32 > ,
10241024 } ,
1025- // ==================== RustPython-only instructions (119-145 ) ====================
1026- // 119: BREAK (RustPython-only)
1025+ // ==================== RustPython-only instructions (119+ ) ====================
1026+ // 119: BREAK
10271027 Break {
10281028 target : Arg < Label > ,
10291029 } ,
1030- // 120: BUILD_LIST_FROM_TUPLES (RustPython-only)
1030+ // 120: BUILD_LIST_FROM_TUPLES
10311031 BuildListFromTuples {
10321032 size : Arg < u32 > ,
10331033 } ,
1034- // 121: BUILD_MAP_FOR_CALL (RustPython-only)
1034+ // 121: BUILD_MAP_FOR_CALL
10351035 BuildMapForCall {
10361036 size : Arg < u32 > ,
10371037 } ,
1038- // 122: BUILD_SET_FROM_TUPLES (RustPython-only)
1038+ // 122: BUILD_SET_FROM_TUPLES
10391039 BuildSetFromTuples {
10401040 size : Arg < u32 > ,
10411041 } ,
1042- // 123: BUILD_TUPLE_FROM_ITER (RustPython-only)
1042+ // 123: BUILD_TUPLE_FROM_ITER
10431043 BuildTupleFromIter ,
1044- // 124: BUILD_TUPLE_FROM_TUPLES (RustPython-only)
1044+ // 124: BUILD_TUPLE_FROM_TUPLES
10451045 BuildTupleFromTuples {
10461046 size : Arg < u32 > ,
10471047 } ,
1048- // 125: CALL_METHOD (RustPython-only)
1048+ // 125: CALL_METHOD
10491049 CallMethodPositional {
10501050 nargs : Arg < u32 > ,
10511051 } ,
1052- // 126: CALL_METHOD_KW (RustPython-only)
1052+ // 126: CALL_METHOD_KW
10531053 CallMethodKeyword {
10541054 nargs : Arg < u32 > ,
10551055 } ,
1056- // 127: CALL_METHOD_EX (RustPython-only)
1056+ // 127: CALL_METHOD_EX
10571057 CallMethodEx {
10581058 has_kwargs : Arg < bool > ,
10591059 } ,
1060- // 128: CONTINUE (RustPython-only)
1060+ // 128: CONTINUE
10611061 Continue {
10621062 target : Arg < Label > ,
10631063 } ,
1064- // 129: END_FINALLY (RustPython-only)
1065- EndFinally ,
1066- // 130: ENTER_FINALLY (RustPython-only)
1067- EnterFinally ,
1068- // 131: JUMP (RustPython-only, CPython uses pseudo-op 256)
1064+ // 129: JUMP (CPython uses pseudo-op 256)
10691065 Jump {
10701066 target : Arg < Label > ,
10711067 } ,
1072- // 132 : JUMP_IF_FALSE_OR_POP (RustPython-only)
1068+ // 130 : JUMP_IF_FALSE_OR_POP
10731069 JumpIfFalseOrPop {
10741070 target : Arg < Label > ,
10751071 } ,
1076- // 133 : JUMP_IF_TRUE_OR_POP (RustPython-only)
1072+ // 131 : JUMP_IF_TRUE_OR_POP
10771073 JumpIfTrueOrPop {
10781074 target : Arg < Label > ,
10791075 } ,
1080- // 134 : JUMP_IF_NOT_EXC_MATCH (RustPython-only)
1076+ // 132 : JUMP_IF_NOT_EXC_MATCH
10811077 JumpIfNotExcMatch ( Arg < Label > ) ,
1082- // 135 : LOAD_CLASSDEREF (RustPython-only)
1078+ // 133 : LOAD_CLASSDEREF
10831079 LoadClassDeref ( Arg < NameIdx > ) ,
1084- // 136 : LOAD_CLOSURE (RustPython-only, CPython uses pseudo-op 258)
1080+ // 134 : LOAD_CLOSURE (CPython uses pseudo-op 258)
10851081 LoadClosure ( Arg < NameIdx > ) ,
1086- // 137 : LOAD_METHOD (RustPython-only, CPython uses pseudo-op 259)
1082+ // 135 : LOAD_METHOD (CPython uses pseudo-op 259)
10871083 LoadMethod {
10881084 idx : Arg < NameIdx > ,
10891085 } ,
1090- // 138 : POP_BLOCK (RustPython-only, CPython uses pseudo-op 263)
1086+ // 136 : POP_BLOCK (CPython uses pseudo-op 263)
10911087 PopBlock ,
1092- // 139 : REVERSE (RustPython-only)
1088+ // 137 : REVERSE
10931089 Reverse {
10941090 amount : Arg < u32 > ,
10951091 } ,
1096- // 140 : SET_EXC_INFO (RustPython-only)
1092+ // 138 : SET_EXC_INFO
10971093 SetExcInfo ,
1098- // 141: SETUP_EXCEPT (RustPython-only)
1099- SetupExcept {
1100- handler : Arg < Label > ,
1101- } ,
1102- // 142: SETUP_FINALLY (RustPython-only, CPython uses pseudo-op 265)
1103- SetupFinally {
1104- handler : Arg < Label > ,
1105- } ,
1106- // 143: SETUP_LOOP (RustPython-only)
1107- SetupLoop ,
1108- // 144: SUBSCRIPT (RustPython-only)
1094+ // 139: SUBSCRIPT
11091095 Subscript ,
1110- // 145 : UNARY_OP (RustPython-only, combines UNARY_*)
1096+ // 140 : UNARY_OP (combines UNARY_*)
11111097 UnaryOperation {
11121098 op : Arg < UnaryOperator > ,
11131099 } ,
1114- // 146: YIELD_FROM (RustPython-only)
1115- YieldFrom ,
1116- // 147-148: Reserved for future RustPython-only opcodes
1100+ // 141-148: Reserved (padding to keep RESUME at 149)
1101+ Reserved141 ,
1102+ Reserved142 ,
1103+ Reserved143 ,
1104+ Reserved144 ,
1105+ Reserved145 ,
1106+ Reserved146 ,
11171107 Reserved147 ,
11181108 Reserved148 ,
11191109 // 149: RESUME
@@ -1882,8 +1872,6 @@ impl Instruction {
18821872 | JumpIfTrueOrPop { target : l }
18831873 | JumpIfFalseOrPop { target : l }
18841874 | ForIter { target : l }
1885- | SetupFinally { handler : l }
1886- | SetupExcept { handler : l }
18871875 | Break { target : l }
18881876 | Continue { target : l }
18891877 | Send { target : l }
@@ -1936,7 +1924,8 @@ impl Instruction {
19361924 pub fn stack_effect ( & self , arg : OpArg , jump : bool ) -> i32 {
19371925 match self {
19381926 // Dummy/placeholder instructions (never executed)
1939- Cache | Reserved3 | Reserved17 | Reserved147 | Reserved148 => 0 ,
1927+ Cache | Reserved3 | Reserved17 | Reserved141 | Reserved142 | Reserved143
1928+ | Reserved144 | Reserved145 | Reserved146 | Reserved147 | Reserved148 => 0 ,
19401929 BinarySlice | EndFor | ExitInitCheck | GetYieldFromIter | InterpreterExit
19411930 | LoadAssertionError | LoadLocals | PushNull | ReturnGenerator | StoreSlice
19421931 | UnaryInvert | UnaryNegative | UnaryNot => 0 ,
@@ -2026,7 +2015,6 @@ impl Instruction {
20262015 ReturnConst { .. } => 0 ,
20272016 Resume { .. } => 0 ,
20282017 YieldValue { .. } => 0 ,
2029- YieldFrom => -1 ,
20302018 // SEND: (receiver, val) -> (receiver, retval) - no change, both paths keep same depth
20312019 Send { .. } => 0 ,
20322020 // END_SEND: (receiver, value) -> (value)
@@ -2037,8 +2025,7 @@ impl Instruction {
20372025 PushExcInfo => 1 , // [exc] -> [prev_exc, exc]
20382026 CheckExcMatch => 0 , // [exc, type] -> [exc, bool] (pops type, pushes bool)
20392027 Reraise { .. } => 0 , // Exception raised, stack effect doesn't matter
2040- SetupAnnotation | SetupLoop | SetupFinally { .. } | EnterFinally | EndFinally => 0 ,
2041- SetupExcept { .. } => jump as i32 ,
2028+ SetupAnnotation => 0 ,
20422029 BeforeWith => 1 , // push __exit__, then replace ctx_mgr with __enter__ result
20432030 WithExceptStart => 1 , // push __exit__ result
20442031 PopBlock => 0 ,
@@ -2174,10 +2161,8 @@ impl Instruction {
21742161 match self {
21752162 // Dummy/placeholder instructions
21762163 Cache => w ! ( CACHE ) ,
2177- Reserved3 => w ! ( RESERVED ) ,
2178- Reserved17 => w ! ( RESERVED ) ,
2179- Reserved147 => w ! ( RESERVED ) ,
2180- Reserved148 => w ! ( RESERVED ) ,
2164+ Reserved3 | Reserved17 | Reserved141 | Reserved142 | Reserved143 | Reserved144
2165+ | Reserved145 | Reserved146 | Reserved147 | Reserved148 => w ! ( RESERVED ) ,
21812166 BinarySlice => w ! ( BINARY_SLICE ) ,
21822167 EndFor => w ! ( END_FOR ) ,
21832168 ExitInitCheck => w ! ( EXIT_INIT_CHECK ) ,
@@ -2251,9 +2236,7 @@ impl Instruction {
22512236 DeleteSubscript => w ! ( DELETE_SUBSCR ) ,
22522237 DictUpdate { index } => w ! ( DICT_UPDATE , index) ,
22532238 EndAsyncFor => w ! ( END_ASYNC_FOR ) ,
2254- EndFinally => w ! ( END_FINALLY ) ,
22552239 EndSend => w ! ( END_SEND ) ,
2256- EnterFinally => w ! ( ENTER_FINALLY ) ,
22572240 ExtendedArg => w ! ( EXTENDED_ARG , Arg :: <u32 >:: marker( ) ) ,
22582241 ForIter { target } => w ! ( FOR_ITER , target) ,
22592242 FormatSimple => w ! ( FORMAT_SIMPLE ) ,
@@ -2306,9 +2289,6 @@ impl Instruction {
23062289 SetExcInfo => w ! ( SET_EXC_INFO ) ,
23072290 SetFunctionAttribute { attr } => w ! ( SET_FUNCTION_ATTRIBUTE , ?attr) ,
23082291 SetupAnnotation => w ! ( SETUP_ANNOTATIONS ) ,
2309- SetupExcept { handler } => w ! ( SETUP_EXCEPT , handler) ,
2310- SetupFinally { handler } => w ! ( SETUP_FINALLY , handler) ,
2311- SetupLoop => w ! ( SETUP_LOOP ) ,
23122292 StoreAttr { idx } => w ! ( STORE_ATTR , name = idx) ,
23132293 StoreDeref ( idx) => w ! ( STORE_DEREF , cell_name = idx) ,
23142294 StoreFast ( idx) => w ! ( STORE_FAST , varname = idx) ,
@@ -2329,7 +2309,6 @@ impl Instruction {
23292309 UnpackEx { args } => w ! ( UNPACK_EX , args) ,
23302310 UnpackSequence { size } => w ! ( UNPACK_SEQUENCE , size) ,
23312311 WithExceptStart => w ! ( WITH_EXCEPT_START ) ,
2332- YieldFrom => w ! ( YIELD_FROM ) ,
23332312 YieldValue { arg } => w ! ( YIELD_VALUE , arg) ,
23342313 }
23352314 }
0 commit comments