Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dd5433b

Browse files
committed
Remove CALL_PY_WITH_DEFAULTS specialization
1 parent d346c32 commit dd5433b

9 files changed

Lines changed: 90 additions & 185 deletions

File tree

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
@@ -3020,7 +3020,6 @@ dummy_func(
30203020
family(CALL, INLINE_CACHE_ENTRIES_CALL) = {
30213021
CALL_BOUND_METHOD_EXACT_ARGS,
30223022
CALL_PY_EXACT_ARGS,
3023-
CALL_PY_WITH_DEFAULTS,
30243023
CALL_TYPE_1,
30253024
CALL_STR_1,
30263025
CALL_TUPLE_1,
@@ -3302,40 +3301,6 @@ dummy_func(
33023301
_SAVE_RETURN_OFFSET +
33033302
_PUSH_FRAME;
33043303

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