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

Skip to content

Commit 4af43c2

Browse files
committed
Remove CALL_PY_WITH_DEFAULTS specialization
1 parent 2262f98 commit 4af43c2

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
@@ -3041,7 +3041,6 @@ dummy_func(
30413041
family(CALL, INLINE_CACHE_ENTRIES_CALL) = {
30423042
CALL_BOUND_METHOD_EXACT_ARGS,
30433043
CALL_PY_EXACT_ARGS,
3044-
CALL_PY_WITH_DEFAULTS,
30453044
CALL_TYPE_1,
30463045
CALL_STR_1,
30473046
CALL_TUPLE_1,
@@ -3323,40 +3322,6 @@ dummy_func(
33233322
_SAVE_RETURN_OFFSET +
33243323
_PUSH_FRAME;
33253324

3326-
inst(CALL_PY_WITH_DEFAULTS, (unused/1, func_version/2, callable, self_or_null, args[oparg] -- unused)) {
3327-
DEOPT_IF(tstate->interp->eval_frame);
3328-
int argcount = oparg;
3329-
if (self_or_null != NULL) {
3330-
args--;
3331-
argcount++;
3332-
}
3333-
DEOPT_IF(!PyFunction_Check(callable));
3334-
PyFunctionObject *func = (PyFunctionObject *)callable;
3335-
DEOPT_IF(func->func_version != func_version);
3336-
PyCodeObject *code = (PyCodeObject *)func->func_code;
3337-
assert(func->func_defaults);
3338-
assert(PyTuple_CheckExact(func->func_defaults));
3339-
int defcount = (int)PyTuple_GET_SIZE(func->func_defaults);
3340-
assert(defcount <= code->co_argcount);
3341-
int min_args = code->co_argcount - defcount;
3342-
DEOPT_IF(argcount > code->co_argcount);
3343-
DEOPT_IF(argcount < min_args);
3344-
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize));
3345-
STAT_INC(CALL, hit);
3346-
_PyInterpreterFrame *new_frame = _PyFrame_PushUnchecked(tstate, func, code->co_argcount);
3347-
for (int i = 0; i < argcount; i++) {
3348-
new_frame->localsplus[i] = args[i];
3349-
}
3350-
for (int i = argcount; i < code->co_argcount; i++) {
3351-
PyObject *def = PyTuple_GET_ITEM(func->func_defaults, i - min_args);
3352-
new_frame->localsplus[i] = Py_NewRef(def);
3353-
}
3354-
// Manipulate stack and cache directly since we leave using DISPATCH_INLINED().
3355-
STACK_SHRINK(oparg + 2);
3356-
frame->return_offset = (uint16_t)(next_instr - this_instr);
3357-
DISPATCH_INLINED(new_frame);
3358-
}
3359-
33603325
inst(CALL_TYPE_1, (unused/1, unused/2, callable, null, arg -- res)) {
33613326
assert(oparg == 1);
33623327
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)