Skip to content

Commit 839d16e

Browse files
committed
Use _SAVE_RETURN_OFFSET in general call instructions
1 parent 857d152 commit 839d16e

File tree

8 files changed

+147
-131
lines changed

8 files changed

+147
-131
lines changed

Include/internal/pycore_opcode_metadata.h

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

Include/internal/pycore_uop_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: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3148,7 +3148,7 @@ dummy_func(
31483148

31493149
macro(CALL) = _SPECIALIZE_CALL + unused/2 + _CALL + _CHECK_PERIODIC;
31503150

3151-
op(_CALL_PY_GENERAL, (callable, self_or_null, args[oparg] -- new_frame: _PyInterpreterFrame*)) {
3151+
op(_PY_FRAME_GENERAL, (callable, self_or_null, args[oparg] -- new_frame: _PyInterpreterFrame*)) {
31523152
// oparg counts all of the args, but *not* self:
31533153
int total_args = oparg;
31543154
if (self_or_null != NULL) {
@@ -3168,7 +3168,6 @@ dummy_func(
31683168
if (new_frame == NULL) {
31693169
ERROR_NO_POP();
31703170
}
3171-
frame->return_offset = (uint16_t)(1 + INLINE_CACHE_ENTRIES_CALL);
31723171
}
31733172

31743173
op(_CHECK_FUNCTION_VERSION, (func_version/2, callable, unused, unused[oparg] -- callable, unused, unused[oparg])) {
@@ -3181,7 +3180,8 @@ dummy_func(
31813180
unused/1 + // Skip over the counter
31823181
_CHECK_PEP_523 +
31833182
_CHECK_FUNCTION_VERSION +
3184-
_CALL_PY_GENERAL +
3183+
_PY_FRAME_GENERAL +
3184+
_SAVE_RETURN_OFFSET +
31853185
_PUSH_FRAME;
31863186

31873187
op(_CHECK_METHOD_VERSION, (func_version/2, callable, null, unused[oparg] -- callable, null, unused[oparg])) {
@@ -3197,7 +3197,7 @@ dummy_func(
31973197
assert(Py_TYPE(callable) == &PyMethod_Type);
31983198
self = ((PyMethodObject *)callable)->im_self;
31993199
Py_INCREF(self);
3200-
stack_pointer[-1 - oparg] = self; // Patch stack as it is used by _CALL_PY_GENERAL
3200+
stack_pointer[-1 - oparg] = self; // Patch stack as it is used by _PY_FRAME_GENERAL
32013201
method = ((PyMethodObject *)callable)->im_func;
32023202
assert(PyFunction_Check(method));
32033203
Py_INCREF(method);
@@ -3209,7 +3209,8 @@ dummy_func(
32093209
_CHECK_PEP_523 +
32103210
_CHECK_METHOD_VERSION +
32113211
_EXPAND_METHOD +
3212-
_CALL_PY_GENERAL +
3212+
_PY_FRAME_GENERAL +
3213+
_SAVE_RETURN_OFFSET +
32133214
_PUSH_FRAME;
32143215

32153216
op(_CHECK_IS_NOT_PY_CALLABLE, (callable, unused, unused[oparg] -- callable, unused, unused[oparg])) {

0 commit comments

Comments
 (0)