mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-134584: JIT: Eliminate redundant refcount ops for X_INT (GH-142765)
This commit is contained in:
parent
0978b9a7d5
commit
790a46a449
9 changed files with 1050 additions and 1246 deletions
72
Python/generated_cases.c.h
generated
72
Python/generated_cases.c.h
generated
|
|
@ -170,6 +170,8 @@
|
|||
_PyStackRef left;
|
||||
_PyStackRef right;
|
||||
_PyStackRef res;
|
||||
_PyStackRef l;
|
||||
_PyStackRef r;
|
||||
// _GUARD_TOS_INT
|
||||
{
|
||||
value = stack_pointer[-1];
|
||||
|
|
@ -206,8 +208,20 @@
|
|||
assert(_PyOpcode_Deopt[opcode] == (BINARY_OP));
|
||||
JUMP_TO_PREDICTED(BINARY_OP);
|
||||
}
|
||||
PyStackRef_CLOSE_SPECIALIZED(right, _PyLong_ExactDealloc);
|
||||
PyStackRef_CLOSE_SPECIALIZED(left, _PyLong_ExactDealloc);
|
||||
l = left;
|
||||
r = right;
|
||||
}
|
||||
// _POP_TOP_INT
|
||||
{
|
||||
value = r;
|
||||
assert(PyLong_CheckExact(PyStackRef_AsPyObjectBorrow(value)));
|
||||
PyStackRef_CLOSE_SPECIALIZED(value, _PyLong_ExactDealloc);
|
||||
}
|
||||
// _POP_TOP_INT
|
||||
{
|
||||
value = l;
|
||||
assert(PyLong_CheckExact(PyStackRef_AsPyObjectBorrow(value)));
|
||||
PyStackRef_CLOSE_SPECIALIZED(value, _PyLong_ExactDealloc);
|
||||
}
|
||||
stack_pointer[-2] = res;
|
||||
stack_pointer += -1;
|
||||
|
|
@ -511,6 +525,8 @@
|
|||
_PyStackRef left;
|
||||
_PyStackRef right;
|
||||
_PyStackRef res;
|
||||
_PyStackRef l;
|
||||
_PyStackRef r;
|
||||
// _GUARD_TOS_INT
|
||||
{
|
||||
value = stack_pointer[-1];
|
||||
|
|
@ -547,8 +563,20 @@
|
|||
assert(_PyOpcode_Deopt[opcode] == (BINARY_OP));
|
||||
JUMP_TO_PREDICTED(BINARY_OP);
|
||||
}
|
||||
PyStackRef_CLOSE_SPECIALIZED(right, _PyLong_ExactDealloc);
|
||||
PyStackRef_CLOSE_SPECIALIZED(left, _PyLong_ExactDealloc);
|
||||
l = left;
|
||||
r = right;
|
||||
}
|
||||
// _POP_TOP_INT
|
||||
{
|
||||
value = r;
|
||||
assert(PyLong_CheckExact(PyStackRef_AsPyObjectBorrow(value)));
|
||||
PyStackRef_CLOSE_SPECIALIZED(value, _PyLong_ExactDealloc);
|
||||
}
|
||||
// _POP_TOP_INT
|
||||
{
|
||||
value = l;
|
||||
assert(PyLong_CheckExact(PyStackRef_AsPyObjectBorrow(value)));
|
||||
PyStackRef_CLOSE_SPECIALIZED(value, _PyLong_ExactDealloc);
|
||||
}
|
||||
stack_pointer[-2] = res;
|
||||
stack_pointer += -1;
|
||||
|
|
@ -1109,6 +1137,8 @@
|
|||
_PyStackRef left;
|
||||
_PyStackRef right;
|
||||
_PyStackRef res;
|
||||
_PyStackRef l;
|
||||
_PyStackRef r;
|
||||
// _GUARD_TOS_INT
|
||||
{
|
||||
value = stack_pointer[-1];
|
||||
|
|
@ -1145,8 +1175,20 @@
|
|||
assert(_PyOpcode_Deopt[opcode] == (BINARY_OP));
|
||||
JUMP_TO_PREDICTED(BINARY_OP);
|
||||
}
|
||||
PyStackRef_CLOSE_SPECIALIZED(right, _PyLong_ExactDealloc);
|
||||
PyStackRef_CLOSE_SPECIALIZED(left, _PyLong_ExactDealloc);
|
||||
l = left;
|
||||
r = right;
|
||||
}
|
||||
// _POP_TOP_INT
|
||||
{
|
||||
value = r;
|
||||
assert(PyLong_CheckExact(PyStackRef_AsPyObjectBorrow(value)));
|
||||
PyStackRef_CLOSE_SPECIALIZED(value, _PyLong_ExactDealloc);
|
||||
}
|
||||
// _POP_TOP_INT
|
||||
{
|
||||
value = l;
|
||||
assert(PyLong_CheckExact(PyStackRef_AsPyObjectBorrow(value)));
|
||||
PyStackRef_CLOSE_SPECIALIZED(value, _PyLong_ExactDealloc);
|
||||
}
|
||||
stack_pointer[-2] = res;
|
||||
stack_pointer += -1;
|
||||
|
|
@ -4544,6 +4586,8 @@
|
|||
_PyStackRef left;
|
||||
_PyStackRef right;
|
||||
_PyStackRef res;
|
||||
_PyStackRef l;
|
||||
_PyStackRef r;
|
||||
// _GUARD_TOS_INT
|
||||
{
|
||||
value = stack_pointer[-1];
|
||||
|
|
@ -4578,10 +4622,22 @@
|
|||
Py_ssize_t ileft = _PyLong_CompactValue((PyLongObject *)left_o);
|
||||
Py_ssize_t iright = _PyLong_CompactValue((PyLongObject *)right_o);
|
||||
int sign_ish = COMPARISON_BIT(ileft, iright);
|
||||
PyStackRef_CLOSE_SPECIALIZED(left, _PyLong_ExactDealloc);
|
||||
PyStackRef_CLOSE_SPECIALIZED(right, _PyLong_ExactDealloc);
|
||||
l = left;
|
||||
r = right;
|
||||
res = (sign_ish & oparg) ? PyStackRef_True : PyStackRef_False;
|
||||
}
|
||||
// _POP_TOP_INT
|
||||
{
|
||||
value = r;
|
||||
assert(PyLong_CheckExact(PyStackRef_AsPyObjectBorrow(value)));
|
||||
PyStackRef_CLOSE_SPECIALIZED(value, _PyLong_ExactDealloc);
|
||||
}
|
||||
// _POP_TOP_INT
|
||||
{
|
||||
value = l;
|
||||
assert(PyLong_CheckExact(PyStackRef_AsPyObjectBorrow(value)));
|
||||
PyStackRef_CLOSE_SPECIALIZED(value, _PyLong_ExactDealloc);
|
||||
}
|
||||
stack_pointer[-2] = res;
|
||||
stack_pointer += -1;
|
||||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue