Skip to content

Commit cfcc054

Browse files
authored
GH-119476: Split _CHECK_FUNCTION_VERSION out of _CHECK_FUNCTION_EXACT_ARGS (GH-119510)
1 parent d87b015 commit cfcc054

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

Include/internal/pycore_opcode_metadata.h

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

Python/bytecodes.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3261,10 +3261,9 @@ dummy_func(
32613261
DEOPT_IF(tstate->interp->eval_frame);
32623262
}
32633263

3264-
op(_CHECK_FUNCTION_EXACT_ARGS, (func_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
3265-
EXIT_IF(!PyFunction_Check(callable));
3264+
op(_CHECK_FUNCTION_EXACT_ARGS, (callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
3265+
assert(PyFunction_Check(callable));
32663266
PyFunctionObject *func = (PyFunctionObject *)callable;
3267-
EXIT_IF(func->func_version != func_version);
32683267
PyCodeObject *code = (PyCodeObject *)func->func_code;
32693268
EXIT_IF(code->co_argcount != oparg + (self_or_null != NULL));
32703269
}
@@ -3308,6 +3307,7 @@ dummy_func(
33083307
_CHECK_PEP_523 +
33093308
_CHECK_CALL_BOUND_METHOD_EXACT_ARGS +
33103309
_INIT_CALL_BOUND_METHOD_EXACT_ARGS +
3310+
_CHECK_FUNCTION_VERSION +
33113311
_CHECK_FUNCTION_EXACT_ARGS +
33123312
_CHECK_STACK_SPACE +
33133313
_INIT_CALL_PY_EXACT_ARGS +
@@ -3317,6 +3317,7 @@ dummy_func(
33173317
macro(CALL_PY_EXACT_ARGS) =
33183318
unused/1 + // Skip over the counter
33193319
_CHECK_PEP_523 +
3320+
_CHECK_FUNCTION_VERSION +
33203321
_CHECK_FUNCTION_EXACT_ARGS +
33213322
_CHECK_STACK_SPACE +
33223323
_INIT_CALL_PY_EXACT_ARGS +

Python/executor_cases.c.h

Lines changed: 1 addition & 9 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: 15 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/optimizer_bytecodes.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,9 @@ dummy_func(void) {
519519
self = sym_new_not_null(ctx);
520520
}
521521

522-
op(_CHECK_FUNCTION_EXACT_ARGS, (func_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
522+
op(_CHECK_FUNCTION_EXACT_ARGS, (callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
523523
sym_set_type(callable, &PyFunction_Type);
524524
(void)self_or_null;
525-
(void)func_version;
526525
}
527526

528527
op(_CHECK_CALL_BOUND_METHOD_EXACT_ARGS, (callable, null, unused[oparg] -- callable, null, unused[oparg])) {

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)