Skip to content

Commit 2c6be6d

Browse files
committed
Split into finer-grained uops
1 parent 907ff95 commit 2c6be6d

File tree

4 files changed

+50
-15
lines changed

4 files changed

+50
-15
lines changed

Include/internal/pycore_opcode_metadata.h

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

Python/bytecodes.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2944,14 +2944,22 @@ dummy_func(
29442944
GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS);
29452945
}
29462946

2947-
op(_CHECK_CALL_PY_EXACT_ARGS, (func_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
2948-
ASSERT_KWNAMES_IS_NULL();
2947+
op(_CHECK_PEP_523, (--)) {
29492948
DEOPT_IF(tstate->interp->eval_frame, CALL);
2949+
}
2950+
2951+
op(_CHECK_FUNCTION_EXACT_ARGS, (func_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
2952+
ASSERT_KWNAMES_IS_NULL();
29502953
DEOPT_IF(!PyFunction_Check(callable), CALL);
29512954
PyFunctionObject *func = (PyFunctionObject *)callable;
29522955
DEOPT_IF(func->func_version != func_version, CALL);
29532956
PyCodeObject *code = (PyCodeObject *)func->func_code;
29542957
DEOPT_IF(code->co_argcount != oparg + (self_or_null != NULL), CALL);
2958+
}
2959+
2960+
op(_CHECK_STACK_SPACE, (callable, unused, unused[oparg] -- callable, unused, unused[oparg])) {
2961+
PyFunctionObject *func = (PyFunctionObject *)callable;
2962+
PyCodeObject *code = (PyCodeObject *)func->func_code;
29552963
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize), CALL);
29562964
}
29572965

@@ -2976,7 +2984,9 @@ dummy_func(
29762984

29772985
macro(CALL_PY_EXACT_ARGS) =
29782986
unused/1 + // Skip over the counter
2979-
_CHECK_CALL_PY_EXACT_ARGS +
2987+
_CHECK_PEP_523 +
2988+
_CHECK_FUNCTION_EXACT_ARGS +
2989+
_CHECK_STACK_SPACE +
29802990
_INIT_CALL_PY_EXACT_ARGS +
29812991
_PUSH_FRAME;
29822992

Python/executor_cases.c.h

Lines changed: 14 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: 11 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)