@@ -70,8 +70,6 @@ dummy_func(
70
70
unsigned int oparg ,
71
71
_Py_atomic_int * const eval_breaker ,
72
72
_PyCFrame cframe ,
73
- PyObject * names ,
74
- PyObject * consts ,
75
73
_Py_CODEUNIT * next_instr ,
76
74
PyObject * * stack_pointer ,
77
75
PyObject * kwnames ,
@@ -115,7 +113,7 @@ dummy_func(
115
113
}
116
114
117
115
inst (LOAD_CONST , (-- value )) {
118
- value = GETITEM (consts , oparg );
116
+ value = GETITEM (frame -> f_code -> co_consts , oparg );
119
117
Py_INCREF (value );
120
118
}
121
119
@@ -554,7 +552,7 @@ dummy_func(
554
552
}
555
553
556
554
inst (RETURN_CONST , (-- )) {
557
- PyObject * retval = GETITEM (consts , oparg );
555
+ PyObject * retval = GETITEM (frame -> f_code -> co_consts , oparg );
558
556
Py_INCREF (retval );
559
557
assert (EMPTY ());
560
558
_PyFrame_SetStackPointer (frame , stack_pointer );
@@ -844,7 +842,7 @@ dummy_func(
844
842
}
845
843
846
844
inst (STORE_NAME , (v -- )) {
847
- PyObject * name = GETITEM (names , oparg );
845
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg );
848
846
PyObject * ns = LOCALS ();
849
847
int err ;
850
848
if (ns == NULL ) {
@@ -862,7 +860,7 @@ dummy_func(
862
860
}
863
861
864
862
inst (DELETE_NAME , (-- )) {
865
- PyObject * name = GETITEM (names , oparg );
863
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg );
866
864
PyObject * ns = LOCALS ();
867
865
int err ;
868
866
if (ns == NULL ) {
@@ -956,7 +954,7 @@ dummy_func(
956
954
#if ENABLE_SPECIALIZATION
957
955
if (ADAPTIVE_COUNTER_IS_ZERO (counter )) {
958
956
assert (cframe .use_tracing == 0 );
959
- PyObject * name = GETITEM (names , oparg );
957
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg );
960
958
next_instr -- ;
961
959
_Py_Specialize_StoreAttr (owner , next_instr , name );
962
960
DISPATCH_SAME_OPARG ();
@@ -967,29 +965,29 @@ dummy_func(
967
965
#else
968
966
(void )counter ; // Unused.
969
967
#endif /* ENABLE_SPECIALIZATION */
970
- PyObject * name = GETITEM (names , oparg );
968
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg );
971
969
int err = PyObject_SetAttr (owner , name , v );
972
970
Py_DECREF (v );
973
971
Py_DECREF (owner );
974
972
ERROR_IF (err , error );
975
973
}
976
974
977
975
inst (DELETE_ATTR , (owner -- )) {
978
- PyObject * name = GETITEM (names , oparg );
976
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg );
979
977
int err = PyObject_SetAttr (owner , name , (PyObject * )NULL );
980
978
Py_DECREF (owner );
981
979
ERROR_IF (err , error );
982
980
}
983
981
984
982
inst (STORE_GLOBAL , (v -- )) {
985
- PyObject * name = GETITEM (names , oparg );
983
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg );
986
984
int err = PyDict_SetItem (GLOBALS (), name , v );
987
985
Py_DECREF (v );
988
986
ERROR_IF (err , error );
989
987
}
990
988
991
989
inst (DELETE_GLOBAL , (-- )) {
992
- PyObject * name = GETITEM (names , oparg );
990
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg );
993
991
int err ;
994
992
err = PyDict_DelItem (GLOBALS (), name );
995
993
// Can't use ERROR_IF here.
@@ -1003,7 +1001,7 @@ dummy_func(
1003
1001
}
1004
1002
1005
1003
inst (LOAD_NAME , ( -- v )) {
1006
- PyObject * name = GETITEM (names , oparg );
1004
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg );
1007
1005
PyObject * locals = LOCALS ();
1008
1006
if (locals == NULL ) {
1009
1007
_PyErr_Format (tstate , PyExc_SystemError ,
@@ -1074,15 +1072,15 @@ dummy_func(
1074
1072
_PyLoadGlobalCache * cache = (_PyLoadGlobalCache * )next_instr ;
1075
1073
if (ADAPTIVE_COUNTER_IS_ZERO (cache -> counter )) {
1076
1074
assert (cframe .use_tracing == 0 );
1077
- PyObject * name = GETITEM (names , oparg >>1 );
1075
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg >>1 );
1078
1076
next_instr -- ;
1079
1077
_Py_Specialize_LoadGlobal (GLOBALS (), BUILTINS (), next_instr , name );
1080
1078
DISPATCH_SAME_OPARG ();
1081
1079
}
1082
1080
STAT_INC (LOAD_GLOBAL , deferred );
1083
1081
DECREMENT_ADAPTIVE_COUNTER (cache -> counter );
1084
1082
#endif /* ENABLE_SPECIALIZATION */
1085
- PyObject * name = GETITEM (names , oparg >>1 );
1083
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg >>1 );
1086
1084
if (PyDict_CheckExact (GLOBALS ())
1087
1085
&& PyDict_CheckExact (BUILTINS ()))
1088
1086
{
@@ -1436,15 +1434,15 @@ dummy_func(
1436
1434
_PyAttrCache * cache = (_PyAttrCache * )next_instr ;
1437
1435
if (ADAPTIVE_COUNTER_IS_ZERO (cache -> counter )) {
1438
1436
assert (cframe .use_tracing == 0 );
1439
- PyObject * name = GETITEM (names , oparg >>1 );
1437
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg >>1 );
1440
1438
next_instr -- ;
1441
1439
_Py_Specialize_LoadAttr (owner , next_instr , name );
1442
1440
DISPATCH_SAME_OPARG ();
1443
1441
}
1444
1442
STAT_INC (LOAD_ATTR , deferred );
1445
1443
DECREMENT_ADAPTIVE_COUNTER (cache -> counter );
1446
1444
#endif /* ENABLE_SPECIALIZATION */
1447
- PyObject * name = GETITEM (names , oparg >> 1 );
1445
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg >> 1 );
1448
1446
if (oparg & 1 ) {
1449
1447
/* Designed to work in tandem with CALL, pushes two values. */
1450
1448
PyObject * meth = NULL ;
@@ -1525,7 +1523,7 @@ dummy_func(
1525
1523
PyDictObject * dict = (PyDictObject * )_PyDictOrValues_GetDict (dorv );
1526
1524
DEOPT_IF (dict == NULL , LOAD_ATTR );
1527
1525
assert (PyDict_CheckExact ((PyObject * )dict ));
1528
- PyObject * name = GETITEM (names , oparg >>1 );
1526
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg >>1 );
1529
1527
uint16_t hint = index ;
1530
1528
DEOPT_IF (hint >= (size_t )dict -> ma_keys -> dk_nentries , LOAD_ATTR );
1531
1529
if (DK_IS_UNICODE (dict -> ma_keys )) {
@@ -1616,7 +1614,7 @@ dummy_func(
1616
1614
DEOPT_IF (!_PyThreadState_HasStackSpace (tstate , code -> co_framesize ), LOAD_ATTR );
1617
1615
STAT_INC (LOAD_ATTR , hit );
1618
1616
1619
- PyObject * name = GETITEM (names , oparg >> 1 );
1617
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg >> 1 );
1620
1618
Py_INCREF (f );
1621
1619
_PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , f , 2 );
1622
1620
// Manipulate stack directly because we exit with DISPATCH_INLINED().
@@ -1661,7 +1659,7 @@ dummy_func(
1661
1659
PyDictObject * dict = (PyDictObject * )_PyDictOrValues_GetDict (dorv );
1662
1660
DEOPT_IF (dict == NULL , STORE_ATTR );
1663
1661
assert (PyDict_CheckExact ((PyObject * )dict ));
1664
- PyObject * name = GETITEM (names , oparg );
1662
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg );
1665
1663
DEOPT_IF (hint >= (size_t )dict -> ma_keys -> dk_nentries , STORE_ATTR );
1666
1664
PyObject * old_value ;
1667
1665
uint64_t new_version ;
@@ -1855,14 +1853,14 @@ dummy_func(
1855
1853
}
1856
1854
1857
1855
inst (IMPORT_NAME , (level , fromlist -- res )) {
1858
- PyObject * name = GETITEM (names , oparg );
1856
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg );
1859
1857
res = import_name (tstate , frame , name , fromlist , level );
1860
1858
DECREF_INPUTS ();
1861
1859
ERROR_IF (res == NULL , error );
1862
1860
}
1863
1861
1864
1862
inst (IMPORT_FROM , (from -- from , res )) {
1865
- PyObject * name = GETITEM (names , oparg );
1863
+ PyObject * name = GETITEM (frame -> f_code -> co_names , oparg );
1866
1864
res = import_from (tstate , from , name );
1867
1865
ERROR_IF (res == NULL , error );
1868
1866
}
@@ -2360,8 +2358,8 @@ dummy_func(
2360
2358
2361
2359
inst (KW_NAMES , (-- )) {
2362
2360
assert (kwnames == NULL );
2363
- assert (oparg < PyTuple_GET_SIZE (consts ));
2364
- kwnames = GETITEM (consts , oparg );
2361
+ assert (oparg < PyTuple_GET_SIZE (frame -> f_code -> co_consts ));
2362
+ kwnames = GETITEM (frame -> f_code -> co_consts , oparg );
2365
2363
}
2366
2364
2367
2365
// Cache layout: counter/1, func_version/2, min_args/1
0 commit comments