@@ -1051,7 +1051,7 @@ struct ExecutingFrame<'a> {
10511051}
10521052
10531053#[ inline]
1054- fn specialization_compact_int_value ( i : & PyInt , vm : & VirtualMachine ) -> Option < isize > {
1054+ fn cpython_compact_int_value ( i : & PyInt , vm : & VirtualMachine ) -> Option < isize > {
10551055 // _PyLong_IsCompact(): a one-digit PyLong (base 2^30),
10561056 // i.e. abs(value) <= 2^30 - 1.
10571057 const CPYTHON_COMPACT_LONG_ABS_MAX : i64 = ( 1i64 << 30 ) - 1 ;
@@ -1066,7 +1066,7 @@ fn specialization_compact_int_value(i: &PyInt, vm: &VirtualMachine) -> Option<is
10661066#[ inline]
10671067fn compact_int_from_obj ( obj : & PyObject , vm : & VirtualMachine ) -> Option < isize > {
10681068 obj. downcast_ref_if_exact :: < PyInt > ( vm)
1069- . and_then ( |i| specialization_compact_int_value ( i, vm) )
1069+ . and_then ( |i| cpython_compact_int_value ( i, vm) )
10701070}
10711071
10721072#[ inline]
@@ -1075,7 +1075,7 @@ fn exact_float_from_obj(obj: &PyObject, vm: &VirtualMachine) -> Option<f64> {
10751075}
10761076
10771077#[ inline]
1078- fn specialization_nonnegative_compact_index ( i : & PyInt , vm : & VirtualMachine ) -> Option < usize > {
1078+ fn cpython_nonnegative_compact_index ( i : & PyInt , vm : & VirtualMachine ) -> Option < usize > {
10791079 // _PyLong_IsNonNegativeCompact(): a single base-2^30 digit.
10801080 const CPYTHON_COMPACT_LONG_MAX : u64 = ( 1u64 << 30 ) - 1 ;
10811081 let v = i. try_to_primitive :: < u64 > ( vm) . ok ( ) ?;
@@ -1176,7 +1176,7 @@ long_float_action!(compactlong_float_subtract, -);
11761176long_float_action ! ( compactlong_float_multiply, * ) ;
11771177long_float_action ! ( compactlong_float_true_div, /) ;
11781178
1179- static BINARY_OP_EXTEND_DESCRIPTORS : & [ BinaryOpExtendSpecializationDescr ] = & [
1179+ static BINARY_OP_EXTEND_DESCRS : & [ BinaryOpExtendSpecializationDescr ] = & [
11801180 // long-long arithmetic
11811181 BinaryOpExtendSpecializationDescr {
11821182 oparg : bytecode:: BinaryOperator :: Or ,
@@ -3999,7 +3999,7 @@ impl ExecutingFrame<'_> {
39993999 let value = self . pop_value ( ) ;
40004000 if let Some ( list) = obj. downcast_ref_if_exact :: < PyList > ( vm)
40014001 && let Some ( int_idx) = idx. downcast_ref_if_exact :: < PyInt > ( vm)
4002- && let Some ( i) = specialization_nonnegative_compact_index ( int_idx, vm)
4002+ && let Some ( i) = cpython_nonnegative_compact_index ( int_idx, vm)
40034003 {
40044004 let mut vec = list. borrow_vec_mut ( ) ;
40054005 if i < vec. len ( ) {
@@ -4099,7 +4099,7 @@ impl ExecutingFrame<'_> {
40994099 if let ( Some ( list) , Some ( idx) ) = (
41004100 a. downcast_ref_if_exact :: < PyList > ( vm) ,
41014101 b. downcast_ref_if_exact :: < PyInt > ( vm) ,
4102- ) && let Some ( i) = specialization_nonnegative_compact_index ( idx, vm)
4102+ ) && let Some ( i) = cpython_nonnegative_compact_index ( idx, vm)
41034103 {
41044104 let vec = list. borrow_vec ( ) ;
41054105 if i < vec. len ( ) {
@@ -4119,7 +4119,7 @@ impl ExecutingFrame<'_> {
41194119 if let ( Some ( tuple) , Some ( idx) ) = (
41204120 a. downcast_ref_if_exact :: < PyTuple > ( vm) ,
41214121 b. downcast_ref_if_exact :: < PyInt > ( vm) ,
4122- ) && let Some ( i) = specialization_nonnegative_compact_index ( idx, vm)
4122+ ) && let Some ( i) = cpython_nonnegative_compact_index ( idx, vm)
41234123 {
41244124 let elements = tuple. as_slice ( ) ;
41254125 if i < elements. len ( ) {
@@ -4161,7 +4161,7 @@ impl ExecutingFrame<'_> {
41614161 if let ( Some ( a_str) , Some ( b_int) ) = (
41624162 a. downcast_ref_if_exact :: < PyStr > ( vm) ,
41634163 b. downcast_ref_if_exact :: < PyInt > ( vm) ,
4164- ) && let Some ( i) = specialization_nonnegative_compact_index ( b_int, vm)
4164+ ) && let Some ( i) = cpython_nonnegative_compact_index ( b_int, vm)
41654165 && let Ok ( ch) = a_str. getitem_by_index ( vm, i as isize )
41664166 && ch. is_ascii ( )
41674167 {
@@ -5191,8 +5191,8 @@ impl ExecutingFrame<'_> {
51915191 a. downcast_ref_if_exact :: < PyInt > ( vm) ,
51925192 b. downcast_ref_if_exact :: < PyInt > ( vm) ,
51935193 ) && let ( Some ( a_val) , Some ( b_val) ) = (
5194- specialization_compact_int_value ( a_int, vm) ,
5195- specialization_compact_int_value ( b_int, vm) ,
5194+ cpython_compact_int_value ( a_int, vm) ,
5195+ cpython_compact_int_value ( b_int, vm) ,
51965196 ) {
51975197 let op = self . compare_op_from_arg ( arg) ;
51985198 let result = op. eval_ord ( a_val. cmp ( & b_val) ) ;
@@ -7268,7 +7268,7 @@ impl ExecutingFrame<'_> {
72687268 if ptr == 0 {
72697269 return None ;
72707270 }
7271- // SAFETY: We only store pointers to entries in `BINARY_OP_EXTEND_DESCRIPTORS `.
7271+ // SAFETY: We only store pointers to entries in `BINARY_OP_EXTEND_DESCRS `.
72727272 Some ( unsafe { & * ( ptr as * const BinaryOpExtendSpecializationDescr ) } )
72737273 }
72747274
@@ -7280,7 +7280,7 @@ impl ExecutingFrame<'_> {
72807280 rhs : & PyObject ,
72817281 vm : & VirtualMachine ,
72827282 ) -> Option < & ' static BinaryOpExtendSpecializationDescr > {
7283- BINARY_OP_EXTEND_DESCRIPTORS
7283+ BINARY_OP_EXTEND_DESCRS
72847284 . iter ( )
72857285 . find ( |d| d. oparg == op && ( d. guard ) ( lhs, rhs, vm) )
72867286 }
@@ -7797,7 +7797,7 @@ impl ExecutingFrame<'_> {
77977797 bytecode:: BinaryOperator :: Subscr => {
77987798 let b_is_nonnegative_int = b
77997799 . downcast_ref_if_exact :: < PyInt > ( vm)
7800- . is_some_and ( |i| specialization_nonnegative_compact_index ( i, vm) . is_some ( ) ) ;
7800+ . is_some_and ( |i| cpython_nonnegative_compact_index ( i, vm) . is_some ( ) ) ;
78017801 if a. downcast_ref_if_exact :: < PyList > ( vm) . is_some ( ) && b_is_nonnegative_int {
78027802 Some ( Instruction :: BinaryOpSubscrListInt )
78037803 } else if a. downcast_ref_if_exact :: < PyTuple > ( vm) . is_some ( ) && b_is_nonnegative_int {
@@ -8620,8 +8620,8 @@ impl ExecutingFrame<'_> {
86208620 a. downcast_ref_if_exact :: < PyInt > ( vm) ,
86218621 b. downcast_ref_if_exact :: < PyInt > ( vm) ,
86228622 ) {
8623- if specialization_compact_int_value ( a_int, vm) . is_some ( )
8624- && specialization_compact_int_value ( b_int, vm) . is_some ( )
8623+ if cpython_compact_int_value ( a_int, vm) . is_some ( )
8624+ && cpython_compact_int_value ( b_int, vm) . is_some ( )
86258625 {
86268626 Some ( Instruction :: CompareOpInt )
86278627 } else {
@@ -8919,7 +8919,7 @@ impl ExecutingFrame<'_> {
89198919 idx. downcast_ref_if_exact :: < PyInt > ( vm) ,
89208920 ) {
89218921 let list_len = list. borrow_vec ( ) . len ( ) ;
8922- if specialization_nonnegative_compact_index ( int_idx, vm) . is_some_and ( |i| i < list_len) {
8922+ if cpython_nonnegative_compact_index ( int_idx, vm) . is_some_and ( |i| i < list_len) {
89238923 Some ( Instruction :: StoreSubscrListInt )
89248924 } else {
89258925 None
0 commit comments