mirror of
https://github.com/python/cpython.git
synced 2026-02-06 09:50:43 +00:00
gh-144007: Eliminate redundant refcounting in the JIT for BINARY_OP (GH-144011)
This commit is contained in:
parent
29f1e778fa
commit
4e10fa993a
11 changed files with 105 additions and 48 deletions
26
Python/executor_cases.c.h
generated
26
Python/executor_cases.c.h
generated
|
|
@ -16594,12 +16594,14 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _BINARY_OP_r21: {
|
||||
case _BINARY_OP_r23: {
|
||||
CHECK_CURRENT_CACHED_VALUES(2);
|
||||
assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE());
|
||||
_PyStackRef rhs;
|
||||
_PyStackRef lhs;
|
||||
_PyStackRef res;
|
||||
_PyStackRef l;
|
||||
_PyStackRef r;
|
||||
_PyStackRef _stack_item_0 = _tos_cache0;
|
||||
_PyStackRef _stack_item_1 = _tos_cache1;
|
||||
oparg = CURRENT_OPARG();
|
||||
|
|
@ -16620,23 +16622,13 @@
|
|||
JUMP_TO_ERROR();
|
||||
}
|
||||
res = PyStackRef_FromPyObjectSteal(res_o);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
_PyStackRef tmp = lhs;
|
||||
lhs = res;
|
||||
stack_pointer[-2] = lhs;
|
||||
PyStackRef_CLOSE(tmp);
|
||||
tmp = rhs;
|
||||
rhs = PyStackRef_NULL;
|
||||
stack_pointer[-1] = rhs;
|
||||
PyStackRef_CLOSE(tmp);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
stack_pointer += -1;
|
||||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
l = lhs;
|
||||
r = rhs;
|
||||
_tos_cache2 = r;
|
||||
_tos_cache1 = l;
|
||||
_tos_cache0 = res;
|
||||
_tos_cache1 = PyStackRef_ZERO_BITS;
|
||||
_tos_cache2 = PyStackRef_ZERO_BITS;
|
||||
SET_CURRENT_CACHED_VALUES(1);
|
||||
stack_pointer += -1;
|
||||
SET_CURRENT_CACHED_VALUES(3);
|
||||
stack_pointer += -2;
|
||||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE());
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue