Skip to content

Commit 65aa34a

Browse files
committed
Remove CALL_PY_WITH_DEFAULTS specialization
1 parent 738d7d2 commit 65aa34a

9 files changed

+90
-185
lines changed

Include/internal/pycore_opcode_metadata.h

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_uop_ids.h

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/opcode_ids.h

Lines changed: 44 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/_opcode_metadata.py

Lines changed: 44 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/bytecodes.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3016,7 +3016,6 @@ dummy_func(
30163016
family(CALL, INLINE_CACHE_ENTRIES_CALL) = {
30173017
CALL_BOUND_METHOD_EXACT_ARGS,
30183018
CALL_PY_EXACT_ARGS,
3019-
CALL_PY_WITH_DEFAULTS,
30203019
CALL_TYPE_1,
30213020
CALL_STR_1,
30223021
CALL_TUPLE_1,
@@ -3301,40 +3300,6 @@ dummy_func(
33013300
_SAVE_RETURN_OFFSET +
33023301
_PUSH_FRAME;
33033302

3304-
inst(CALL_PY_WITH_DEFAULTS, (unused/1, func_version/2, callable, self_or_null, args[oparg] -- unused)) {
3305-
DEOPT_IF(tstate->interp->eval_frame);
3306-
int argcount = oparg;
3307-
if (self_or_null != NULL) {
3308-
args--;
3309-
argcount++;
3310-
}
3311-
DEOPT_IF(!PyFunction_Check(callable));
3312-
PyFunctionObject *func = (PyFunctionObject *)callable;
3313-
DEOPT_IF(func->func_version != func_version);
3314-
PyCodeObject *code = (PyCodeObject *)func->func_code;
3315-
assert(func->func_defaults);
3316-
assert(PyTuple_CheckExact(func->func_defaults));
3317-
int defcount = (int)PyTuple_GET_SIZE(func->func_defaults);
3318-
assert(defcount <= code->co_argcount);
3319-
int min_args = code->co_argcount - defcount;
3320-
DEOPT_IF(argcount > code->co_argcount);
3321-
DEOPT_IF(argcount < min_args);
3322-
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize));
3323-
STAT_INC(CALL, hit);
3324-
_PyInterpreterFrame *new_frame = _PyFrame_PushUnchecked(tstate, func, code->co_argcount);
3325-
for (int i = 0; i < argcount; i++) {
3326-
new_frame->localsplus[i] = args[i];
3327-
}
3328-
for (int i = argcount; i < code->co_argcount; i++) {
3329-
PyObject *def = PyTuple_GET_ITEM(func->func_defaults, i - min_args);
3330-
new_frame->localsplus[i] = Py_NewRef(def);
3331-
}
3332-
// Manipulate stack and cache directly since we leave using DISPATCH_INLINED().
3333-
STACK_SHRINK(oparg + 2);
3334-
frame->return_offset = (uint16_t)(next_instr - this_instr);
3335-
DISPATCH_INLINED(new_frame);
3336-
}
3337-
33383303
inst(CALL_TYPE_1, (unused/1, unused/2, callable, null, arg -- res)) {
33393304
assert(oparg == 1);
33403305
DEOPT_IF(null != NULL);

Python/executor_cases.c.h

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 0 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/opcode_targets.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/optimizer_cases.c.h

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)