@@ -1338,7 +1338,7 @@ dummy_func(
13381338 assert (frame -> owner != FRAME_OWNED_BY_INTERPRETER );
13391339 if ((tstate -> interp -> eval_frame == NULL ) &&
13401340 (Py_TYPE (receiver_o ) == & PyGen_Type || Py_TYPE (receiver_o ) == & PyCoro_Type ) &&
1341- _PyGen_SetExecuting ((PyGenObject * )receiver_o ))
1341+ gen_try_set_executing ((PyGenObject * )receiver_o ))
13421342 {
13431343 PyGenObject * gen = (PyGenObject * )receiver_o ;
13441344 _PyInterpreterFrame * gen_frame = & gen -> gi_iframe ;
@@ -1385,7 +1385,7 @@ dummy_func(
13851385 op (_SEND_GEN_FRAME , (receiver , v -- receiver , gen_frame )) {
13861386 PyGenObject * gen = (PyGenObject * )PyStackRef_AsPyObjectBorrow (receiver );
13871387 DEOPT_IF (Py_TYPE (gen ) != & PyGen_Type && Py_TYPE (gen ) != & PyCoro_Type );
1388- DEOPT_IF (!_PyGen_SetExecuting ((PyGenObject * )gen ));
1388+ DEOPT_IF (!gen_try_set_executing ((PyGenObject * )gen ));
13891389 STAT_INC (SEND , hit );
13901390 _PyInterpreterFrame * pushed_frame = & gen -> gi_iframe ;
13911391 _PyFrame_StackPush (pushed_frame , PyStackRef_MakeHeapSafe (v ));
@@ -1422,10 +1422,7 @@ dummy_func(
14221422 _PyInterpreterFrame * gen_frame = frame ;
14231423 frame = tstate -> current_frame = frame -> previous ;
14241424 gen_frame -> previous = NULL ;
1425- FT_ATOMIC_STORE_INT8_RELEASE (gen -> gi_frame_state , FRAME_SUSPENDED + oparg );
1426- #ifdef Py_GIL_DISABLED
1427- ((_PyThreadStateImpl * )tstate )-> gen_last_frame_state = FRAME_SUSPENDED + oparg ;
1428- #endif
1425+ gen_set_frame_state (gen , tstate , FRAME_SUSPENDED + oparg );
14291426 /* We don't know which of these is relevant here, so keep them equal */
14301427 assert (INLINE_CACHE_ENTRIES_SEND == INLINE_CACHE_ENTRIES_FOR_ITER );
14311428 #if TIER_ONE
@@ -3424,7 +3421,7 @@ dummy_func(
34243421 op (_FOR_ITER_GEN_FRAME , (iter , null -- iter , null , gen_frame )) {
34253422 PyGenObject * gen = (PyGenObject * )PyStackRef_AsPyObjectBorrow (iter );
34263423 DEOPT_IF (Py_TYPE (gen ) != & PyGen_Type );
3427- DEOPT_IF (!_PyGen_SetExecuting ((PyGenObject * )gen ));
3424+ DEOPT_IF (!gen_try_set_executing ((PyGenObject * )gen ));
34283425 STAT_INC (FOR_ITER , hit );
34293426 _PyInterpreterFrame * pushed_frame = & gen -> gi_iframe ;
34303427 _PyFrame_StackPush (pushed_frame , PyStackRef_None );
0 commit comments