mirror of
https://github.com/python/cpython.git
synced 2026-01-20 14:20:27 +00:00
gh-134584: JIT: Remove redundant refcounting for UNARY_{INVERT|NEGATIVE} (GH-143704)
This commit is contained in:
parent
9d13ca97c1
commit
548526bbbe
10 changed files with 976 additions and 899 deletions
|
|
@ -449,7 +449,8 @@ dummy_func(void) {
|
|||
res = sym_new_truthiness(ctx, value, false);
|
||||
}
|
||||
|
||||
op(_UNARY_NEGATIVE, (value -- res)) {
|
||||
op(_UNARY_NEGATIVE, (value -- res, v)) {
|
||||
v = value;
|
||||
REPLACE_OPCODE_IF_EVALUATES_PURE(value, res);
|
||||
if (sym_is_compact_int(value)) {
|
||||
res = sym_new_compact_int(ctx);
|
||||
|
|
@ -465,7 +466,8 @@ dummy_func(void) {
|
|||
}
|
||||
}
|
||||
|
||||
op(_UNARY_INVERT, (value -- res)) {
|
||||
op(_UNARY_INVERT, (value -- res, v)) {
|
||||
v = value;
|
||||
// Required to avoid a warning due to the deprecation of bitwise inversion of bools
|
||||
if (!sym_matches_type(value, &PyBool_Type)) {
|
||||
REPLACE_OPCODE_IF_EVALUATES_PURE(value, res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue