@@ -2928,32 +2928,55 @@ dummy_func(
2928
2928
GO_TO_INSTRUCTION (CALL_PY_EXACT_ARGS );
2929
2929
}
2930
2930
2931
- inst ( CALL_PY_EXACT_ARGS , ( unused / 1 , func_version / 2 , callable , self_or_null , args [ oparg ] -- unused )) {
2932
- ASSERT_KWNAMES_IS_NULL ();
2931
+
2932
+ op ( _CHECK_PEP523 , ( -- )) {
2933
2933
DEOPT_IF (tstate -> interp -> eval_frame , CALL );
2934
- int argcount = oparg ;
2935
- if (self_or_null ) {
2936
- args -- ;
2937
- argcount ++ ;
2938
- }
2934
+ }
2935
+
2936
+ op (_CHECK_FUNCTION , (func_version /2 , callable , self_or_null , unused [oparg ] -- callable , self_or_null , unused [oparg ])) {
2939
2937
DEOPT_IF (!PyFunction_Check (callable ), CALL );
2940
2938
PyFunctionObject * func = (PyFunctionObject * )callable ;
2941
2939
DEOPT_IF (func -> func_version != func_version , CALL );
2942
2940
PyCodeObject * code = (PyCodeObject * )func -> func_code ;
2941
+ int argcount = oparg + (self_or_null != NULL );
2943
2942
DEOPT_IF (code -> co_argcount != argcount , CALL );
2944
2943
DEOPT_IF (!_PyThreadState_HasStackSpace (tstate , code -> co_framesize ), CALL );
2945
2944
STAT_INC (CALL , hit );
2946
- _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , func , argcount );
2945
+ }
2946
+
2947
+ op (_MAKE_FRAME , (callable , self_or_null , args [oparg ] -- new_frame : _PyInterpreterFrame * )) {
2948
+ int argcount = oparg ;
2949
+ if (self_or_null ) {
2950
+ args -- ;
2951
+ argcount ++ ;
2952
+ }
2953
+ PyFunctionObject * func = (PyFunctionObject * )callable ;
2954
+ new_frame = _PyFrame_PushUnchecked (tstate , func , argcount );
2947
2955
for (int i = 0 ; i < argcount ; i ++ ) {
2948
2956
new_frame -> localsplus [i ] = args [i ];
2949
2957
}
2950
- // Manipulate stack directly since we leave using DISPATCH_INLINED().
2951
- STACK_SHRINK (oparg + 2 );
2952
- SKIP_OVER (INLINE_CACHE_ENTRIES_CALL );
2958
+ SAVE_FRAME_STATE (); /* Special macro */
2959
+ }
2960
+
2961
+ op (_PUSH_FRAME , (new_frame : _PyInterpreterFrame * -- unused )) {
2953
2962
frame -> return_offset = 0 ;
2954
- DISPATCH_INLINED (new_frame );
2963
+ /* Link in new frame */
2964
+ new_frame -> previous = frame ;
2965
+ frame = cframe .current_frame = new_frame ;
2966
+ CALL_STAT_INC (inlined_py_calls );
2967
+ if (_Py_EnterRecursivePy (tstate )) {
2968
+ goto exit_unwind ;
2969
+ }
2970
+ START_FRAME (); /* Special macro */
2955
2971
}
2956
2972
2973
+ macro (CALL_PY_EXACT_ARGS ) =
2974
+ unused /1 + // Skip over the counter
2975
+ _CHECK_PEP523 +
2976
+ _CHECK_FUNCTION +
2977
+ _MAKE_FRAME +
2978
+ _PUSH_FRAME ;
2979
+
2957
2980
inst (CALL_PY_WITH_DEFAULTS , (unused /1 , func_version /2 , callable , self_or_null , args [oparg ] -- unused )) {
2958
2981
ASSERT_KWNAMES_IS_NULL ();
2959
2982
DEOPT_IF (tstate -> interp -> eval_frame , CALL );
0 commit comments