@@ -1598,8 +1598,7 @@ dummy_func(
1598
1598
ERROR_IF (map == NULL , error );
1599
1599
}
1600
1600
1601
- inst (DICT_UPDATE , (update -- )) {
1602
- PyObject * dict = PEEK (oparg + 1 ); // update is still on the stack
1601
+ inst (DICT_UPDATE , (dict , unused [oparg - 1 ], update -- dict , unused [oparg - 1 ])) {
1603
1602
if (PyDict_Update (dict , update ) < 0 ) {
1604
1603
if (_PyErr_ExceptionMatches (tstate , PyExc_AttributeError )) {
1605
1604
_PyErr_Format (tstate , PyExc_TypeError ,
@@ -1612,19 +1611,16 @@ dummy_func(
1612
1611
DECREF_INPUTS ();
1613
1612
}
1614
1613
1615
- inst (DICT_MERGE , (update -- )) {
1616
- PyObject * dict = PEEK (oparg + 1 ); // update is still on the stack
1617
-
1614
+ inst (DICT_MERGE , (callable , unused , unused , dict , unused [oparg - 1 ], update -- callable , unused , unused , dict , unused [oparg - 1 ])) {
1618
1615
if (_PyDict_MergeEx (dict , update , 2 ) < 0 ) {
1619
- _PyEval_FormatKwargsError (tstate , PEEK ( 4 + oparg ) , update );
1616
+ _PyEval_FormatKwargsError (tstate , callable , update );
1620
1617
DECREF_INPUTS ();
1621
1618
ERROR_IF (true, error );
1622
1619
}
1623
1620
DECREF_INPUTS ();
1624
1621
}
1625
1622
1626
- inst (MAP_ADD , (key , value -- )) {
1627
- PyObject * dict = PEEK (oparg + 2 ); // key, value are still on the stack
1623
+ inst (MAP_ADD , (dict , unused [oparg - 1 ], key , value -- dict , unused [oparg - 1 ])) {
1628
1624
assert (PyDict_CheckExact (dict ));
1629
1625
/* dict[key] = value */
1630
1626
// Do not DECREF INPUTS because the function steals the references
@@ -1644,7 +1640,7 @@ dummy_func(
1644
1640
LOAD_SUPER_ATTR_METHOD ,
1645
1641
};
1646
1642
1647
- inst (LOAD_SUPER_ATTR , (unused /1 , global_super , class , self -- attr , self_or_null if (oparg & 1 ))) {
1643
+ inst (LOAD_SUPER_ATTR , (unused /1 , global_super , class , self -- attr , null if (oparg & 1 ))) {
1648
1644
PyObject * name = GETITEM (FRAME_CO_NAMES , oparg >> 2 );
1649
1645
int load_method = oparg & 1 ;
1650
1646
#if ENABLE_SPECIALIZATION
@@ -1691,6 +1687,7 @@ dummy_func(
1691
1687
attr = PyObject_GetAttr (super , name );
1692
1688
Py_DECREF (super );
1693
1689
ERROR_IF (attr == NULL , error );
1690
+ null = NULL ;
1694
1691
}
1695
1692
1696
1693
pseudo (LOAD_SUPER_METHOD ) = {
@@ -1705,7 +1702,7 @@ dummy_func(
1705
1702
LOAD_SUPER_ATTR ,
1706
1703
};
1707
1704
1708
- inst (LOAD_SUPER_ATTR_ATTR , (unused /1 , global_super , class , self -- attr , self_or_null if (oparg & 1 ))) {
1705
+ inst (LOAD_SUPER_ATTR_ATTR , (unused /1 , global_super , class , self -- attr , unused if (oparg & 1 ))) {
1709
1706
assert (!(oparg & 1 ));
1710
1707
DEOPT_IF (global_super != (PyObject * )& PySuper_Type , LOAD_SUPER_ATTR );
1711
1708
DEOPT_IF (!PyType_Check (class ), LOAD_SUPER_ATTR );
@@ -1770,15 +1767,14 @@ dummy_func(
1770
1767
PyObject * name = GETITEM (FRAME_CO_NAMES , oparg >> 1 );
1771
1768
if (oparg & 1 ) {
1772
1769
/* Designed to work in tandem with CALL, pushes two values. */
1773
- PyObject * meth = NULL ;
1774
- if (_PyObject_GetMethod (owner , name , & meth )) {
1770
+ attr = NULL ;
1771
+ if (_PyObject_GetMethod (owner , name , & attr )) {
1775
1772
/* We can bypass temporary bound method object.
1776
1773
meth is unbound method and obj is self.
1777
1774
1778
1775
meth | self | arg1 | ... | argN
1779
1776
*/
1780
- assert (meth != NULL ); // No errors on this branch
1781
- attr = meth ;
1777
+ assert (attr != NULL ); // No errors on this branch
1782
1778
self_or_null = owner ; // Transfer ownership
1783
1779
}
1784
1780
else {
@@ -1790,8 +1786,7 @@ dummy_func(
1790
1786
NULL | meth | arg1 | ... | argN
1791
1787
*/
1792
1788
DECREF_INPUTS ();
1793
- ERROR_IF (meth == NULL , error );
1794
- attr = meth ;
1789
+ ERROR_IF (attr == NULL , error );
1795
1790
self_or_null = NULL ;
1796
1791
}
1797
1792
}
@@ -1820,13 +1815,13 @@ dummy_func(
1820
1815
DEOPT_IF (!_PyDictOrValues_IsValues (dorv ), LOAD_ATTR );
1821
1816
}
1822
1817
1823
- op (_LOAD_ATTR_INSTANCE_VALUE , (index /1 , owner -- attr , self_or_null if (oparg & 1 ))) {
1818
+ op (_LOAD_ATTR_INSTANCE_VALUE , (index /1 , owner -- attr , null if (oparg & 1 ))) {
1824
1819
PyDictOrValues dorv = * _PyObject_DictOrValuesPointer (owner );
1825
1820
attr = _PyDictOrValues_GetValues (dorv )-> values [index ];
1826
1821
DEOPT_IF (attr == NULL , LOAD_ATTR );
1827
1822
STAT_INC (LOAD_ATTR , hit );
1828
1823
Py_INCREF (attr );
1829
- self_or_null = NULL ;
1824
+ null = NULL ;
1830
1825
DECREF_INPUTS ();
1831
1826
}
1832
1827
@@ -1837,7 +1832,7 @@ dummy_func(
1837
1832
_LOAD_ATTR_INSTANCE_VALUE +
1838
1833
unused /5 ; // Skip over rest of cache
1839
1834
1840
- inst (LOAD_ATTR_MODULE , (unused /1 , type_version /2 , index /1 , unused /5 , owner -- attr , self_or_null if (oparg & 1 ))) {
1835
+ inst (LOAD_ATTR_MODULE , (unused /1 , type_version /2 , index /1 , unused /5 , owner -- attr , null if (oparg & 1 ))) {
1841
1836
DEOPT_IF (!PyModule_CheckExact (owner ), LOAD_ATTR );
1842
1837
PyDictObject * dict = (PyDictObject * )((PyModuleObject * )owner )-> md_dict ;
1843
1838
assert (dict != NULL );
@@ -1849,11 +1844,11 @@ dummy_func(
1849
1844
DEOPT_IF (attr == NULL , LOAD_ATTR );
1850
1845
STAT_INC (LOAD_ATTR , hit );
1851
1846
Py_INCREF (attr );
1852
- self_or_null = NULL ;
1847
+ null = NULL ;
1853
1848
DECREF_INPUTS ();
1854
1849
}
1855
1850
1856
- inst (LOAD_ATTR_WITH_HINT , (unused /1 , type_version /2 , index /1 , unused /5 , owner -- attr , self_or_null if (oparg & 1 ))) {
1851
+ inst (LOAD_ATTR_WITH_HINT , (unused /1 , type_version /2 , index /1 , unused /5 , owner -- attr , null if (oparg & 1 ))) {
1857
1852
PyTypeObject * tp = Py_TYPE (owner );
1858
1853
assert (type_version != 0 );
1859
1854
DEOPT_IF (tp -> tp_version_tag != type_version , LOAD_ATTR );
@@ -1879,11 +1874,11 @@ dummy_func(
1879
1874
DEOPT_IF (attr == NULL , LOAD_ATTR );
1880
1875
STAT_INC (LOAD_ATTR , hit );
1881
1876
Py_INCREF (attr );
1882
- self_or_null = NULL ;
1877
+ null = NULL ;
1883
1878
DECREF_INPUTS ();
1884
1879
}
1885
1880
1886
- inst (LOAD_ATTR_SLOT , (unused /1 , type_version /2 , index /1 , unused /5 , owner -- attr , self_or_null if (oparg & 1 ))) {
1881
+ inst (LOAD_ATTR_SLOT , (unused /1 , type_version /2 , index /1 , unused /5 , owner -- attr , null if (oparg & 1 ))) {
1887
1882
PyTypeObject * tp = Py_TYPE (owner );
1888
1883
assert (type_version != 0 );
1889
1884
DEOPT_IF (tp -> tp_version_tag != type_version , LOAD_ATTR );
@@ -1892,19 +1887,19 @@ dummy_func(
1892
1887
DEOPT_IF (attr == NULL , LOAD_ATTR );
1893
1888
STAT_INC (LOAD_ATTR , hit );
1894
1889
Py_INCREF (attr );
1895
- self_or_null = NULL ;
1890
+ null = NULL ;
1896
1891
DECREF_INPUTS ();
1897
1892
}
1898
1893
1899
- inst (LOAD_ATTR_CLASS , (unused /1 , type_version /2 , unused /2 , descr /4 , cls -- attr , self_or_null if (oparg & 1 ))) {
1894
+ inst (LOAD_ATTR_CLASS , (unused /1 , type_version /2 , unused /2 , descr /4 , cls -- attr , null if (oparg & 1 ))) {
1900
1895
1901
1896
DEOPT_IF (!PyType_Check (cls ), LOAD_ATTR );
1902
1897
DEOPT_IF (((PyTypeObject * )cls )-> tp_version_tag != type_version ,
1903
1898
LOAD_ATTR );
1904
1899
assert (type_version != 0 );
1905
1900
1906
1901
STAT_INC (LOAD_ATTR , hit );
1907
- self_or_null = NULL ;
1902
+ null = NULL ;
1908
1903
attr = descr ;
1909
1904
assert (attr != NULL );
1910
1905
Py_INCREF (attr );
@@ -2740,7 +2735,7 @@ dummy_func(
2740
2735
self_or_null = self ;
2741
2736
}
2742
2737
2743
- inst (LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES , (unused /1 , type_version /2 , keys_version /2 , descr /4 , self -- attr , self_or_null if (0 ))) {
2738
+ inst (LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES , (unused /1 , type_version /2 , keys_version /2 , descr /4 , self -- attr , unused if (0 ))) {
2744
2739
assert ((oparg & 1 ) == 0 );
2745
2740
PyTypeObject * self_cls = Py_TYPE (self );
2746
2741
assert (type_version != 0 );
@@ -2757,7 +2752,7 @@ dummy_func(
2757
2752
attr = Py_NewRef (descr );
2758
2753
}
2759
2754
2760
- inst (LOAD_ATTR_NONDESCRIPTOR_NO_DICT , (unused /1 , type_version /2 , unused /2 , descr /4 , self -- attr , self_or_null if (0 ))) {
2755
+ inst (LOAD_ATTR_NONDESCRIPTOR_NO_DICT , (unused /1 , type_version /2 , unused /2 , descr /4 , self -- attr , unused if (0 ))) {
2761
2756
assert ((oparg & 1 ) == 0 );
2762
2757
PyTypeObject * self_cls = Py_TYPE (self );
2763
2758
assert (type_version != 0 );
@@ -2893,7 +2888,7 @@ dummy_func(
2893
2888
kwnames );
2894
2889
if (opcode == INSTRUMENTED_CALL ) {
2895
2890
PyObject * arg = total_args == 0 ?
2896
- & _PyInstrumentation_MISSING : PEEK ( total_args ) ;
2891
+ & _PyInstrumentation_MISSING : args [ 0 ] ;
2897
2892
if (res == NULL ) {
2898
2893
_Py_call_instrumentation_exc2 (
2899
2894
tstate , PY_MONITORING_EVENT_C_RAISE ,
@@ -2921,8 +2916,8 @@ dummy_func(
2921
2916
// Start out with [NULL, bound_method, arg1, arg2, ...]
2922
2917
// Transform to [callable, self, arg1, arg2, ...]
2923
2918
// Then fall through to CALL_PY_EXACT_ARGS
2924
- inst (CALL_BOUND_METHOD_EXACT_ARGS , (unused /1 , unused /2 , callable , self_or_null , unused [oparg ] -- unused )) {
2925
- DEOPT_IF (self_or_null != NULL , CALL );
2919
+ inst (CALL_BOUND_METHOD_EXACT_ARGS , (unused /1 , unused /2 , callable , null , unused [oparg ] -- unused )) {
2920
+ DEOPT_IF (null != NULL , CALL );
2926
2921
DEOPT_IF (Py_TYPE (callable ) != & PyMethod_Type , CALL );
2927
2922
STAT_INC (CALL , hit );
2928
2923
PyObject * self = ((PyMethodObject * )callable )-> im_self ;
@@ -2995,10 +2990,10 @@ dummy_func(
2995
2990
DISPATCH_INLINED (new_frame );
2996
2991
}
2997
2992
2998
- inst (CALL_NO_KW_TYPE_1 , (unused /1 , unused /2 , callable , self_or_null , args [oparg ] -- res )) {
2993
+ inst (CALL_NO_KW_TYPE_1 , (unused /1 , unused /2 , callable , null , args [oparg ] -- res )) {
2999
2994
ASSERT_KWNAMES_IS_NULL ();
3000
2995
assert (oparg == 1 );
3001
- DEOPT_IF (self_or_null != NULL , CALL );
2996
+ DEOPT_IF (null != NULL , CALL );
3002
2997
PyObject * obj = args [0 ];
3003
2998
DEOPT_IF (callable != (PyObject * )& PyType_Type , CALL );
3004
2999
STAT_INC (CALL , hit );
@@ -3007,10 +3002,10 @@ dummy_func(
3007
3002
Py_DECREF (& PyType_Type ); // I.e., callable
3008
3003
}
3009
3004
3010
- inst (CALL_NO_KW_STR_1 , (unused /1 , unused /2 , callable , self_or_null , args [oparg ] -- res )) {
3005
+ inst (CALL_NO_KW_STR_1 , (unused /1 , unused /2 , callable , null , args [oparg ] -- res )) {
3011
3006
ASSERT_KWNAMES_IS_NULL ();
3012
3007
assert (oparg == 1 );
3013
- DEOPT_IF (self_or_null != NULL , CALL );
3008
+ DEOPT_IF (null != NULL , CALL );
3014
3009
DEOPT_IF (callable != (PyObject * )& PyUnicode_Type , CALL );
3015
3010
STAT_INC (CALL , hit );
3016
3011
PyObject * arg = args [0 ];
@@ -3021,10 +3016,10 @@ dummy_func(
3021
3016
CHECK_EVAL_BREAKER ();
3022
3017
}
3023
3018
3024
- inst (CALL_NO_KW_TUPLE_1 , (unused /1 , unused /2 , callable , self_or_null , args [oparg ] -- res )) {
3019
+ inst (CALL_NO_KW_TUPLE_1 , (unused /1 , unused /2 , callable , null , args [oparg ] -- res )) {
3025
3020
ASSERT_KWNAMES_IS_NULL ();
3026
3021
assert (oparg == 1 );
3027
- DEOPT_IF (self_or_null != NULL , CALL );
3022
+ DEOPT_IF (null != NULL , CALL );
3028
3023
DEOPT_IF (callable != (PyObject * )& PyTuple_Type , CALL );
3029
3024
STAT_INC (CALL , hit );
3030
3025
PyObject * arg = args [0 ];
@@ -3035,15 +3030,15 @@ dummy_func(
3035
3030
CHECK_EVAL_BREAKER ();
3036
3031
}
3037
3032
3038
- inst (CALL_NO_KW_ALLOC_AND_ENTER_INIT , (unused /1 , unused /2 , callable , self_or_null , args [oparg ] -- unused )) {
3033
+ inst (CALL_NO_KW_ALLOC_AND_ENTER_INIT , (unused /1 , unused /2 , callable , null , args [oparg ] -- unused )) {
3039
3034
/* This instruction does the following:
3040
3035
* 1. Creates the object (by calling ``object.__new__``)
3041
3036
* 2. Pushes a shim frame to the frame stack (to cleanup after ``__init__``)
3042
3037
* 3. Pushes the frame for ``__init__`` to the frame stack
3043
3038
* */
3044
3039
ASSERT_KWNAMES_IS_NULL ();
3045
3040
_PyCallCache * cache = (_PyCallCache * )next_instr ;
3046
- DEOPT_IF (self_or_null != NULL , CALL );
3041
+ DEOPT_IF (null != NULL , CALL );
3047
3042
DEOPT_IF (!PyType_Check (callable ), CALL );
3048
3043
PyTypeObject * tp = (PyTypeObject * )callable ;
3049
3044
DEOPT_IF (tp -> tp_version_tag != read_u32 (cache -> func_version ), CALL );
@@ -3269,18 +3264,18 @@ dummy_func(
3269
3264
}
3270
3265
3271
3266
// This is secretly a super-instruction
3272
- inst (CALL_NO_KW_LIST_APPEND , (unused /1 , unused /2 , callable , self_or_null , args [oparg ] -- unused )) {
3267
+ inst (CALL_NO_KW_LIST_APPEND , (unused /1 , unused /2 , callable , self , args [oparg ] -- unused )) {
3273
3268
ASSERT_KWNAMES_IS_NULL ();
3274
3269
assert (oparg == 1 );
3275
- assert (self_or_null != NULL );
3270
+ assert (self != NULL );
3276
3271
PyInterpreterState * interp = tstate -> interp ;
3277
3272
DEOPT_IF (callable != interp -> callable_cache .list_append , CALL );
3278
- DEOPT_IF (!PyList_Check (self_or_null ), CALL );
3273
+ DEOPT_IF (!PyList_Check (self ), CALL );
3279
3274
STAT_INC (CALL , hit );
3280
- if (_PyList_AppendTakeRef ((PyListObject * )self_or_null , args [0 ]) < 0 ) {
3275
+ if (_PyList_AppendTakeRef ((PyListObject * )self , args [0 ]) < 0 ) {
3281
3276
goto pop_1_error ; // Since arg is DECREF'ed already
3282
3277
}
3283
- Py_DECREF (self_or_null );
3278
+ Py_DECREF (self );
3284
3279
Py_DECREF (callable );
3285
3280
STACK_SHRINK (3 );
3286
3281
// CALL + POP_TOP
0 commit comments