@@ -2437,7 +2437,7 @@ impl ExecutingFrame<'_> {
24372437 }
24382438 Instruction :: ForIter { .. } => {
24392439 // Relative forward jump: target = lasti + caches + delta
2440- let target = bytecode:: Label :: new ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
2440+ let target = bytecode:: Label :: from_u32 ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
24412441 self . adaptive ( |s, ii, cb| s. specialize_for_iter ( vm, u32:: from ( arg) , ii, cb) ) ;
24422442 self . execute_for_iter ( vm, target) ?;
24432443 Ok ( None )
@@ -3571,7 +3571,7 @@ impl ExecutingFrame<'_> {
35713571 Instruction :: Send { .. } => {
35723572 // (receiver, v -- receiver, retval)
35733573 self . adaptive ( |s, ii, cb| s. specialize_send ( vm, ii, cb) ) ;
3574- let exit_label = bytecode:: Label :: new ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
3574+ let exit_label = bytecode:: Label :: from_u32 ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
35753575 let receiver = self . nth_value ( 1 ) ;
35763576 let can_fast_send = !self . specialization_eval_frame_active ( vm)
35773577 && ( receiver. downcast_ref_if_exact :: < PyGenerator > ( vm) . is_some ( )
@@ -3609,7 +3609,7 @@ impl ExecutingFrame<'_> {
36093609 }
36103610 }
36113611 Instruction :: SendGen => {
3612- let exit_label = bytecode:: Label :: new ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
3612+ let exit_label = bytecode:: Label :: from_u32 ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
36133613 // Stack: [receiver, val] — peek receiver before popping
36143614 let receiver = self . nth_value ( 1 ) ;
36153615 let can_fast_send = !self . specialization_eval_frame_active ( vm)
@@ -3740,7 +3740,7 @@ impl ExecutingFrame<'_> {
37403740 }
37413741 // Specialized LOAD_ATTR opcodes
37423742 Instruction :: LoadAttrMethodNoDict => {
3743- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
3743+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
37443744 let cache_base = self . lasti ( ) as usize ;
37453745
37463746 let owner = self . top_value ( ) ;
@@ -3759,7 +3759,7 @@ impl ExecutingFrame<'_> {
37593759 }
37603760 }
37613761 Instruction :: LoadAttrMethodLazyDict => {
3762- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
3762+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
37633763 let cache_base = self . lasti ( ) as usize ;
37643764
37653765 let owner = self . top_value ( ) ;
@@ -3779,7 +3779,7 @@ impl ExecutingFrame<'_> {
37793779 }
37803780 }
37813781 Instruction :: LoadAttrMethodWithValues => {
3782- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
3782+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
37833783 let cache_base = self . lasti ( ) as usize ;
37843784 let attr_name = self . code . names [ oparg. name_idx ( ) as usize ] ;
37853785
@@ -3814,7 +3814,7 @@ impl ExecutingFrame<'_> {
38143814 self . load_attr_slow ( vm, oparg)
38153815 }
38163816 Instruction :: LoadAttrInstanceValue => {
3817- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
3817+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
38183818 let cache_base = self . lasti ( ) as usize ;
38193819 let attr_name = self . code . names [ oparg. name_idx ( ) as usize ] ;
38203820
@@ -3836,7 +3836,7 @@ impl ExecutingFrame<'_> {
38363836 self . load_attr_slow ( vm, oparg)
38373837 }
38383838 Instruction :: LoadAttrWithHint => {
3839- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
3839+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
38403840 let cache_base = self . lasti ( ) as usize ;
38413841 let attr_name = self . code . names [ oparg. name_idx ( ) as usize ] ;
38423842
@@ -3861,7 +3861,7 @@ impl ExecutingFrame<'_> {
38613861 self . load_attr_slow ( vm, oparg)
38623862 }
38633863 Instruction :: LoadAttrModule => {
3864- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
3864+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
38653865 let cache_base = self . lasti ( ) as usize ;
38663866 let attr_name = self . code . names [ oparg. name_idx ( ) as usize ] ;
38673867
@@ -3885,7 +3885,7 @@ impl ExecutingFrame<'_> {
38853885 self . load_attr_slow ( vm, oparg)
38863886 }
38873887 Instruction :: LoadAttrNondescriptorNoDict => {
3888- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
3888+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
38893889 let cache_base = self . lasti ( ) as usize ;
38903890
38913891 let owner = self . top_value ( ) ;
@@ -3907,7 +3907,7 @@ impl ExecutingFrame<'_> {
39073907 self . load_attr_slow ( vm, oparg)
39083908 }
39093909 Instruction :: LoadAttrNondescriptorWithValues => {
3910- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
3910+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
39113911 let cache_base = self . lasti ( ) as usize ;
39123912 let attr_name = self . code . names [ oparg. name_idx ( ) as usize ] ;
39133913
@@ -3945,7 +3945,7 @@ impl ExecutingFrame<'_> {
39453945 self . load_attr_slow ( vm, oparg)
39463946 }
39473947 Instruction :: LoadAttrClass => {
3948- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
3948+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
39493949 let cache_base = self . lasti ( ) as usize ;
39503950
39513951 let owner = self . top_value ( ) ;
@@ -3968,7 +3968,7 @@ impl ExecutingFrame<'_> {
39683968 self . load_attr_slow ( vm, oparg)
39693969 }
39703970 Instruction :: LoadAttrClassWithMetaclassCheck => {
3971- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
3971+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
39723972 let cache_base = self . lasti ( ) as usize ;
39733973
39743974 let owner = self . top_value ( ) ;
@@ -3994,7 +3994,7 @@ impl ExecutingFrame<'_> {
39943994 self . load_attr_slow ( vm, oparg)
39953995 }
39963996 Instruction :: LoadAttrGetattributeOverridden => {
3997- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
3997+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
39983998 let cache_base = self . lasti ( ) as usize ;
39993999 let owner = self . top_value ( ) ;
40004000 let type_version = self . code . instructions . read_cache_u32 ( cache_base + 1 ) ;
@@ -4021,7 +4021,7 @@ impl ExecutingFrame<'_> {
40214021 self . load_attr_slow ( vm, oparg)
40224022 }
40234023 Instruction :: LoadAttrSlot => {
4024- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
4024+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
40254025 let cache_base = self . lasti ( ) as usize ;
40264026
40274027 let owner = self . top_value ( ) ;
@@ -4045,7 +4045,7 @@ impl ExecutingFrame<'_> {
40454045 self . load_attr_slow ( vm, oparg)
40464046 }
40474047 Instruction :: LoadAttrProperty => {
4048- let oparg = LoadAttr :: new ( u32:: from ( arg) ) ;
4048+ let oparg = LoadAttr :: from_u32 ( u32:: from ( arg) ) ;
40494049 let cache_base = self . lasti ( ) as usize ;
40504050
40514051 let owner = self . top_value ( ) ;
@@ -5247,7 +5247,7 @@ impl ExecutingFrame<'_> {
52475247 return Ok ( None ) ;
52485248 }
52495249 }
5250- let oparg = LoadSuperAttr :: new ( oparg) ;
5250+ let oparg = LoadSuperAttr :: from_u32 ( oparg) ;
52515251 self . load_super_attr ( vm, oparg)
52525252 }
52535253 Instruction :: LoadSuperAttrMethod => {
@@ -5314,7 +5314,7 @@ impl ExecutingFrame<'_> {
53145314 return Ok ( None ) ;
53155315 }
53165316 }
5317- let oparg = LoadSuperAttr :: new ( oparg) ;
5317+ let oparg = LoadSuperAttr :: from_u32 ( oparg) ;
53185318 self . load_super_attr ( vm, oparg)
53195319 }
53205320 Instruction :: CompareOpInt => {
@@ -5581,7 +5581,7 @@ impl ExecutingFrame<'_> {
55815581 self . unpack_sequence ( size as u32 , vm)
55825582 }
55835583 Instruction :: ForIterRange => {
5584- let target = bytecode:: Label :: new ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
5584+ let target = bytecode:: Label :: from_u32 ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
55855585 let iter = self . top_value ( ) ;
55865586 if let Some ( range_iter) = iter. downcast_ref_if_exact :: < PyRangeIterator > ( vm) {
55875587 if let Some ( value) = range_iter. fast_next ( ) {
@@ -5596,7 +5596,7 @@ impl ExecutingFrame<'_> {
55965596 }
55975597 }
55985598 Instruction :: ForIterList => {
5599- let target = bytecode:: Label :: new ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
5599+ let target = bytecode:: Label :: from_u32 ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
56005600 let iter = self . top_value ( ) ;
56015601 if let Some ( list_iter) = iter. downcast_ref_if_exact :: < PyListIterator > ( vm) {
56025602 if let Some ( value) = list_iter. fast_next ( ) {
@@ -5611,7 +5611,7 @@ impl ExecutingFrame<'_> {
56115611 }
56125612 }
56135613 Instruction :: ForIterTuple => {
5614- let target = bytecode:: Label :: new ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
5614+ let target = bytecode:: Label :: from_u32 ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
56155615 let iter = self . top_value ( ) ;
56165616 if let Some ( tuple_iter) = iter. downcast_ref_if_exact :: < PyTupleIterator > ( vm) {
56175617 if let Some ( value) = tuple_iter. fast_next ( ) {
@@ -5626,7 +5626,7 @@ impl ExecutingFrame<'_> {
56265626 }
56275627 }
56285628 Instruction :: ForIterGen => {
5629- let target = bytecode:: Label :: new ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
5629+ let target = bytecode:: Label :: from_u32 ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
56305630 let iter = self . top_value ( ) ;
56315631 if self . specialization_eval_frame_active ( vm) {
56325632 self . execute_for_iter ( vm, target) ?;
@@ -5868,7 +5868,7 @@ impl ExecutingFrame<'_> {
58685868 Instruction :: InstrumentedJumpForward => {
58695869 let src_offset = ( self . lasti ( ) - 1 ) * 2 ;
58705870 let target_idx = self . lasti ( ) + u32:: from ( arg) ;
5871- let target = bytecode:: Label :: new ( target_idx) ;
5871+ let target = bytecode:: Label :: from_u32 ( target_idx) ;
58725872 self . jump ( target) ;
58735873 if self . monitoring_mask & monitoring:: EVENT_JUMP != 0 {
58745874 monitoring:: fire_jump ( vm, self . code , src_offset, target. as_u32 ( ) * 2 ) ?;
@@ -5878,7 +5878,7 @@ impl ExecutingFrame<'_> {
58785878 Instruction :: InstrumentedJumpBackward => {
58795879 let src_offset = ( self . lasti ( ) - 1 ) * 2 ;
58805880 let target_idx = self . lasti ( ) + 1 - u32:: from ( arg) ;
5881- let target = bytecode:: Label :: new ( target_idx) ;
5881+ let target = bytecode:: Label :: from_u32 ( target_idx) ;
58825882 self . jump ( target) ;
58835883 if self . monitoring_mask & monitoring:: EVENT_JUMP != 0 {
58845884 monitoring:: fire_jump ( vm, self . code , src_offset, target. as_u32 ( ) * 2 ) ?;
@@ -5887,7 +5887,7 @@ impl ExecutingFrame<'_> {
58875887 }
58885888 Instruction :: InstrumentedForIter => {
58895889 let src_offset = ( self . lasti ( ) - 1 ) * 2 ;
5890- let target = bytecode:: Label :: new ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
5890+ let target = bytecode:: Label :: from_u32 ( self . lasti ( ) + 1 + u32:: from ( arg) ) ;
58915891 let continued = self . execute_for_iter ( vm, target) ?;
58925892 if continued {
58935893 if self . monitoring_mask & monitoring:: EVENT_BRANCH_LEFT != 0 {
@@ -5937,7 +5937,7 @@ impl ExecutingFrame<'_> {
59375937 let obj = self . pop_value ( ) ;
59385938 let value = obj. try_to_bool ( vm) ?;
59395939 if value {
5940- self . jump ( bytecode:: Label :: new ( target_idx) ) ;
5940+ self . jump ( bytecode:: Label :: from_u32 ( target_idx) ) ;
59415941 if self . monitoring_mask & monitoring:: EVENT_BRANCH_RIGHT != 0 {
59425942 monitoring:: fire_branch_right ( vm, self . code , src_offset, target_idx * 2 ) ?;
59435943 }
@@ -5950,7 +5950,7 @@ impl ExecutingFrame<'_> {
59505950 let obj = self . pop_value ( ) ;
59515951 let value = obj. try_to_bool ( vm) ?;
59525952 if !value {
5953- self . jump ( bytecode:: Label :: new ( target_idx) ) ;
5953+ self . jump ( bytecode:: Label :: from_u32 ( target_idx) ) ;
59545954 if self . monitoring_mask & monitoring:: EVENT_BRANCH_RIGHT != 0 {
59555955 monitoring:: fire_branch_right ( vm, self . code , src_offset, target_idx * 2 ) ?;
59565956 }
@@ -5962,7 +5962,7 @@ impl ExecutingFrame<'_> {
59625962 let target_idx = self . lasti ( ) + 1 + u32:: from ( arg) ;
59635963 let value = self . pop_value ( ) ;
59645964 if vm. is_none ( & value) {
5965- self . jump ( bytecode:: Label :: new ( target_idx) ) ;
5965+ self . jump ( bytecode:: Label :: from_u32 ( target_idx) ) ;
59665966 if self . monitoring_mask & monitoring:: EVENT_BRANCH_RIGHT != 0 {
59675967 monitoring:: fire_branch_right ( vm, self . code , src_offset, target_idx * 2 ) ?;
59685968 }
@@ -5974,7 +5974,7 @@ impl ExecutingFrame<'_> {
59745974 let target_idx = self . lasti ( ) + 1 + u32:: from ( arg) ;
59755975 let value = self . pop_value ( ) ;
59765976 if !vm. is_none ( & value) {
5977- self . jump ( bytecode:: Label :: new ( target_idx) ) ;
5977+ self . jump ( bytecode:: Label :: from_u32 ( target_idx) ) ;
59785978 if self . monitoring_mask & monitoring:: EVENT_BRANCH_RIGHT != 0 {
59795979 monitoring:: fire_branch_right ( vm, self . code , src_offset, target_idx * 2 ) ?;
59805980 }
@@ -6366,7 +6366,7 @@ impl ExecutingFrame<'_> {
63666366 self . push_value ( exception. into ( ) ) ;
63676367
63686368 // 4. Jump to handler
6369- self . jump ( bytecode:: Label :: new ( entry. target ) ) ;
6369+ self . jump ( bytecode:: Label :: from_u32 ( entry. target ) ) ;
63706370
63716371 Ok ( None )
63726372 } else {
@@ -6971,7 +6971,7 @@ impl ExecutingFrame<'_> {
69716971 bytecode:: Instruction :: EndFor | bytecode:: Instruction :: InstrumentedEndFor
69726972 )
69736973 {
6974- return bytecode:: Label :: new ( target. as_u32 ( ) + 1 ) ;
6974+ return bytecode:: Label :: from_u32 ( target. as_u32 ( ) + 1 ) ;
69756975 }
69766976 target
69776977 }
@@ -8952,7 +8952,7 @@ impl ExecutingFrame<'_> {
89528952 unit. op,
89538953 bytecode:: Instruction :: EndFor | bytecode:: Instruction :: InstrumentedEndFor
89548954 ) {
8955- bytecode:: Label :: new ( target. as_u32 ( ) + 1 )
8955+ bytecode:: Label :: from_u32 ( target. as_u32 ( ) + 1 )
89568956 } else {
89578957 target
89588958 }
0 commit comments