@@ -448,13 +448,10 @@ dummy_func(
448448 DEOPT_IF (!_PyThreadState_HasStackSpace (tstate , code -> co_framesize ), BINARY_SUBSCR );
449449 STAT_INC (BINARY_SUBSCR , hit );
450450 Py_INCREF (getitem );
451- _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , getitem );
451+ _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , getitem , 2 );
452452 STACK_SHRINK (2 );
453453 new_frame -> localsplus [0 ] = container ;
454454 new_frame -> localsplus [1 ] = sub ;
455- for (int i = 2 ; i < code -> co_nlocalsplus ; i ++ ) {
456- new_frame -> localsplus [i ] = NULL ;
457- }
458455 JUMPBY (INLINE_CACHE_ENTRIES_BINARY_SUBSCR );
459456 DISPATCH_INLINED (new_frame );
460457 }
@@ -1714,14 +1711,11 @@ dummy_func(
17141711 DEOPT_IF (!_PyThreadState_HasStackSpace (tstate , code -> co_framesize ), LOAD_ATTR );
17151712 STAT_INC (LOAD_ATTR , hit );
17161713 Py_INCREF (fget );
1717- _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , f );
1714+ _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , f , 1 );
17181715 SET_TOP (NULL );
17191716 int shrink_stack = !(oparg & 1 );
17201717 STACK_SHRINK (shrink_stack );
17211718 new_frame -> localsplus [0 ] = owner ;
1722- for (int i = 1 ; i < code -> co_nlocalsplus ; i ++ ) {
1723- new_frame -> localsplus [i ] = NULL ;
1724- }
17251719 JUMPBY (INLINE_CACHE_ENTRIES_LOAD_ATTR );
17261720 DISPATCH_INLINED (new_frame );
17271721 }
@@ -1749,15 +1743,12 @@ dummy_func(
17491743
17501744 PyObject * name = GETITEM (names , oparg >> 1 );
17511745 Py_INCREF (f );
1752- _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , f );
1746+ _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , f , 2 );
17531747 SET_TOP (NULL );
17541748 int shrink_stack = !(oparg & 1 );
17551749 STACK_SHRINK (shrink_stack );
17561750 new_frame -> localsplus [0 ] = owner ;
17571751 new_frame -> localsplus [1 ] = Py_NewRef (name );
1758- for (int i = 2 ; i < code -> co_nlocalsplus ; i ++ ) {
1759- new_frame -> localsplus [i ] = NULL ;
1760- }
17611752 JUMPBY (INLINE_CACHE_ENTRIES_LOAD_ATTR );
17621753 DISPATCH_INLINED (new_frame );
17631754 }
@@ -2672,14 +2663,11 @@ dummy_func(
26722663 DEOPT_IF (code -> co_argcount != argcount , CALL );
26732664 DEOPT_IF (!_PyThreadState_HasStackSpace (tstate , code -> co_framesize ), CALL );
26742665 STAT_INC (CALL , hit );
2675- _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , func );
2666+ _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , func , argcount );
26762667 STACK_SHRINK (argcount );
26772668 for (int i = 0 ; i < argcount ; i ++ ) {
26782669 new_frame -> localsplus [i ] = stack_pointer [i ];
26792670 }
2680- for (int i = argcount ; i < code -> co_nlocalsplus ; i ++ ) {
2681- new_frame -> localsplus [i ] = NULL ;
2682- }
26832671 STACK_SHRINK (2 - is_meth );
26842672 JUMPBY (INLINE_CACHE_ENTRIES_CALL );
26852673 DISPATCH_INLINED (new_frame );
@@ -2702,7 +2690,7 @@ dummy_func(
27022690 DEOPT_IF (argcount < minargs , CALL );
27032691 DEOPT_IF (!_PyThreadState_HasStackSpace (tstate , code -> co_framesize ), CALL );
27042692 STAT_INC (CALL , hit );
2705- _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , func );
2693+ _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , func , code -> co_argcount );
27062694 STACK_SHRINK (argcount );
27072695 for (int i = 0 ; i < argcount ; i ++ ) {
27082696 new_frame -> localsplus [i ] = stack_pointer [i ];
@@ -2712,9 +2700,6 @@ dummy_func(
27122700 i - minargs );
27132701 new_frame -> localsplus [i ] = Py_NewRef (def );
27142702 }
2715- for (int i = code -> co_argcount ; i < code -> co_nlocalsplus ; i ++ ) {
2716- new_frame -> localsplus [i ] = NULL ;
2717- }
27182703 STACK_SHRINK (2 - is_meth );
27192704 JUMPBY (INLINE_CACHE_ENTRIES_CALL );
27202705 DISPATCH_INLINED (new_frame );
0 commit comments