@@ -941,13 +941,13 @@ dummy_func(
941
941
{
942
942
PyGenObject * gen = (PyGenObject * )receiver ;
943
943
_PyInterpreterFrame * gen_frame = (_PyInterpreterFrame * )gen -> gi_iframe ;
944
- frame -> return_offset = oparg ;
945
944
STACK_SHRINK (1 );
946
945
_PyFrame_StackPush (gen_frame , v );
947
946
gen -> gi_frame_state = FRAME_EXECUTING ;
948
947
gen -> gi_exc_state .previous_item = tstate -> exc_info ;
949
948
tstate -> exc_info = & gen -> gi_exc_state ;
950
949
SKIP_OVER (INLINE_CACHE_ENTRIES_SEND );
950
+ frame -> return_offset = oparg ;
951
951
DISPATCH_INLINED (gen_frame );
952
952
}
953
953
if (Py_IsNone (v ) && PyIter_Check (receiver )) {
@@ -980,13 +980,13 @@ dummy_func(
980
980
DEOPT_IF (gen -> gi_frame_state >= FRAME_EXECUTING , SEND );
981
981
STAT_INC (SEND , hit );
982
982
_PyInterpreterFrame * gen_frame = (_PyInterpreterFrame * )gen -> gi_iframe ;
983
- frame -> return_offset = oparg ;
984
983
STACK_SHRINK (1 );
985
984
_PyFrame_StackPush (gen_frame , v );
986
985
gen -> gi_frame_state = FRAME_EXECUTING ;
987
986
gen -> gi_exc_state .previous_item = tstate -> exc_info ;
988
987
tstate -> exc_info = & gen -> gi_exc_state ;
989
988
SKIP_OVER (INLINE_CACHE_ENTRIES_SEND );
989
+ frame -> return_offset = oparg ;
990
990
DISPATCH_INLINED (gen_frame );
991
991
}
992
992
@@ -2578,14 +2578,14 @@ dummy_func(
2578
2578
DEOPT_IF (gen -> gi_frame_state >= FRAME_EXECUTING , FOR_ITER );
2579
2579
STAT_INC (FOR_ITER , hit );
2580
2580
_PyInterpreterFrame * gen_frame = (_PyInterpreterFrame * )gen -> gi_iframe ;
2581
- frame -> return_offset = oparg ;
2582
2581
_PyFrame_StackPush (gen_frame , Py_None );
2583
2582
gen -> gi_frame_state = FRAME_EXECUTING ;
2584
2583
gen -> gi_exc_state .previous_item = tstate -> exc_info ;
2585
2584
tstate -> exc_info = & gen -> gi_exc_state ;
2586
2585
SKIP_OVER (INLINE_CACHE_ENTRIES_FOR_ITER );
2587
2586
assert (next_instr [oparg ].op .code == END_FOR ||
2588
2587
next_instr [oparg ].op .code == INSTRUMENTED_END_FOR );
2588
+ frame -> return_offset = oparg ;
2589
2589
DISPATCH_INLINED (gen_frame );
2590
2590
}
2591
2591
@@ -2939,14 +2939,13 @@ dummy_func(
2939
2939
GO_TO_INSTRUCTION (CALL_PY_EXACT_ARGS );
2940
2940
}
2941
2941
2942
- inst ( CALL_PY_EXACT_ARGS , (unused / 1 , func_version /2 , method , callable , args [oparg ] -- unused )) {
2942
+ op ( _CHECK_CALL_PY_EXACT_ARGS , (func_version /2 , method , callable , unused [oparg ] -- method , callable , unused [ oparg ] )) {
2943
2943
ASSERT_KWNAMES_IS_NULL ();
2944
2944
DEOPT_IF (tstate -> interp -> eval_frame , CALL );
2945
2945
int is_meth = method != NULL ;
2946
2946
int argcount = oparg ;
2947
2947
if (is_meth ) {
2948
2948
callable = method ;
2949
- args -- ;
2950
2949
argcount ++ ;
2951
2950
}
2952
2951
DEOPT_IF (!PyFunction_Check (callable ), CALL );
@@ -2955,18 +2954,35 @@ dummy_func(
2955
2954
PyCodeObject * code = (PyCodeObject * )func -> func_code ;
2956
2955
DEOPT_IF (code -> co_argcount != argcount , CALL );
2957
2956
DEOPT_IF (!_PyThreadState_HasStackSpace (tstate , code -> co_framesize ), CALL );
2957
+ }
2958
+
2959
+ op (_INIT_CALL_PY_EXACT_ARGS , (method , callable , args [oparg ] -- new_frame : _PyInterpreterFrame * )) {
2960
+ int is_meth = method != NULL ;
2961
+ int argcount = oparg ;
2962
+ if (is_meth ) {
2963
+ callable = method ;
2964
+ args -- ;
2965
+ argcount ++ ;
2966
+ }
2958
2967
STAT_INC (CALL , hit );
2959
- _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , func , argcount );
2968
+ PyFunctionObject * func = (PyFunctionObject * )callable ;
2969
+ new_frame = _PyFrame_PushUnchecked (tstate , func , argcount );
2960
2970
for (int i = 0 ; i < argcount ; i ++ ) {
2961
2971
new_frame -> localsplus [i ] = args [i ];
2962
2972
}
2963
- // Manipulate stack directly since we leave using DISPATCH_INLINED().
2964
- STACK_SHRINK ( oparg + 2 );
2965
- SKIP_OVER ( INLINE_CACHE_ENTRIES_CALL );
2973
+ }
2974
+
2975
+ op ( _PUSH_FRAME , ( new_frame : _PyInterpreterFrame * -- unused )) {
2966
2976
frame -> return_offset = 0 ;
2967
2977
DISPATCH_INLINED (new_frame );
2968
2978
}
2969
2979
2980
+ macro (CALL_PY_EXACT_ARGS ) =
2981
+ unused /1 + // Skip over the counter
2982
+ _CHECK_CALL_PY_EXACT_ARGS +
2983
+ _INIT_CALL_PY_EXACT_ARGS +
2984
+ _PUSH_FRAME ;
2985
+
2970
2986
inst (CALL_PY_WITH_DEFAULTS , (unused /1 , func_version /2 , method , callable , args [oparg ] -- unused )) {
2971
2987
ASSERT_KWNAMES_IS_NULL ();
2972
2988
DEOPT_IF (tstate -> interp -> eval_frame , CALL );
0 commit comments