@@ -1828,32 +1828,6 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code,
1828
1828
return f ;
1829
1829
}
1830
1830
1831
- static int
1832
- _PyFrame_OpAlreadyRan (_PyInterpreterFrame * frame , int opcode , int oparg )
1833
- {
1834
- // This only works when opcode is a non-quickened form:
1835
- assert (_PyOpcode_Deopt [opcode ] == opcode );
1836
- int check_oparg = 0 ;
1837
- for (_Py_CODEUNIT * instruction = _PyCode_CODE (_PyFrame_GetCode (frame ));
1838
- instruction < frame -> instr_ptr ; instruction ++ )
1839
- {
1840
- int check_opcode = _PyOpcode_Deopt [instruction -> op .code ];
1841
- check_oparg |= instruction -> op .arg ;
1842
- if (check_opcode == opcode && check_oparg == oparg ) {
1843
- return 1 ;
1844
- }
1845
- if (check_opcode == EXTENDED_ARG ) {
1846
- check_oparg <<= 8 ;
1847
- }
1848
- else {
1849
- check_oparg = 0 ;
1850
- }
1851
- instruction += _PyOpcode_Caches [check_opcode ];
1852
- }
1853
- return 0 ;
1854
- }
1855
-
1856
-
1857
1831
// Initialize frame free variables if needed
1858
1832
static void
1859
1833
frame_init_get_vars (_PyInterpreterFrame * frame )
@@ -1907,14 +1881,9 @@ frame_get_var(_PyInterpreterFrame *frame, PyCodeObject *co, int i,
1907
1881
value = PyCell_GET (value );
1908
1882
}
1909
1883
else if (kind & CO_FAST_CELL ) {
1910
- // Note that no *_DEREF ops can happen before MAKE_CELL
1911
- // executes. So there's no need to duplicate the work
1912
- // that MAKE_CELL would otherwise do later, if it hasn't
1913
- // run yet.
1914
1884
if (value != NULL ) {
1915
- if (PyCell_Check (value ) &&
1916
- _PyFrame_OpAlreadyRan (frame , MAKE_CELL , i )) {
1917
- // (likely) MAKE_CELL must have executed already.
1885
+ if (PyCell_Check (value )) {
1886
+ assert (!_PyFrame_IsIncomplete (frame ));
1918
1887
value = PyCell_GET (value );
1919
1888
}
1920
1889
// (likely) Otherwise it is an arg (kind & CO_FAST_LOCAL),
0 commit comments