@@ -2370,7 +2370,7 @@ dummy_func(
23702370 CALL ,
23712371 CALL_BOUND_METHOD_EXACT_ARGS ,
23722372 CALL_PY_EXACT_ARGS ,
2373- // CALL_PY_WITH_DEFAULTS,
2373+ CALL_PY_WITH_DEFAULTS ,
23742374 // CALL_NO_KW_TYPE_1,
23752375 // CALL_NO_KW_STR_1,
23762376 // CALL_NO_KW_TUPLE_1,
@@ -2517,34 +2517,31 @@ dummy_func(
25172517 DISPATCH_INLINED (new_frame );
25182518 }
25192519
2520- // stack effect: (__0, __array[oparg] -- )
2521- inst (CALL_PY_WITH_DEFAULTS ) {
2520+ inst (CALL_PY_WITH_DEFAULTS , (unused /1 , func_version /2 , min_args /1 , thing1 , thing2 , unused [oparg ] -- unused )) {
25222521 assert (kwnames == NULL );
25232522 DEOPT_IF (tstate -> interp -> eval_frame , CALL );
2524- _PyCallCache * cache = (_PyCallCache * )next_instr ;
2525- int is_meth = is_method (stack_pointer , oparg );
2523+ int is_meth = thing1 != NULL ;
25262524 int argcount = oparg + is_meth ;
2527- PyObject * callable = PEEK ( argcount + 1 ) ;
2525+ PyObject * callable = is_meth ? thing1 : thing2 ;
25282526 DEOPT_IF (!PyFunction_Check (callable ), CALL );
25292527 PyFunctionObject * func = (PyFunctionObject * )callable ;
2530- DEOPT_IF (func -> func_version != read_u32 ( cache -> func_version ) , CALL );
2528+ DEOPT_IF (func -> func_version != func_version , CALL );
25312529 PyCodeObject * code = (PyCodeObject * )func -> func_code ;
25322530 DEOPT_IF (argcount > code -> co_argcount , CALL );
2533- int minargs = cache -> min_args ;
2534- DEOPT_IF (argcount < minargs , CALL );
2531+ DEOPT_IF (argcount < min_args , CALL );
25352532 DEOPT_IF (!_PyThreadState_HasStackSpace (tstate , code -> co_framesize ), CALL );
25362533 STAT_INC (CALL , hit );
25372534 _PyInterpreterFrame * new_frame = _PyFrame_PushUnchecked (tstate , func , code -> co_argcount );
2535+ // Manipulate stack directly since we leave using DISPATCH_INLINED().
25382536 STACK_SHRINK (argcount );
25392537 for (int i = 0 ; i < argcount ; i ++ ) {
25402538 new_frame -> localsplus [i ] = stack_pointer [i ];
25412539 }
25422540 for (int i = argcount ; i < code -> co_argcount ; i ++ ) {
2543- PyObject * def = PyTuple_GET_ITEM (func -> func_defaults ,
2544- i - minargs );
2541+ PyObject * def = PyTuple_GET_ITEM (func -> func_defaults , i - min_args );
25452542 new_frame -> localsplus [i ] = Py_NewRef (def );
25462543 }
2547- STACK_SHRINK (2 - is_meth );
2544+ STACK_SHRINK (2 - is_meth );
25482545 JUMPBY (INLINE_CACHE_ENTRIES_CALL );
25492546 DISPATCH_INLINED (new_frame );
25502547 }
0 commit comments