mirror of
https://github.com/python/cpython.git
synced 2025-12-31 12:33:28 +00:00
gh-134584: Remove custom float decref ops (GH-142576)
This commit is contained in:
parent
b3b644b6b8
commit
0ac4e6c6cd
15 changed files with 2606 additions and 3131 deletions
|
|
@ -261,31 +261,25 @@ dummy_func(void) {
|
|||
res = sym_new_compact_int(ctx);
|
||||
}
|
||||
|
||||
op(_BINARY_OP_ADD_FLOAT, (left, right -- res)) {
|
||||
op(_BINARY_OP_ADD_FLOAT, (left, right -- res, l, r)) {
|
||||
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right);
|
||||
res = sym_new_type(ctx, &PyFloat_Type);
|
||||
// TODO (gh-134584): Refactor this to use another uop
|
||||
if (PyJitRef_IsBorrowed(left) && PyJitRef_IsBorrowed(right)) {
|
||||
REPLACE_OP(this_instr, op_without_decref_inputs[opcode], oparg, 0);
|
||||
}
|
||||
l = left;
|
||||
r = right;
|
||||
}
|
||||
|
||||
op(_BINARY_OP_SUBTRACT_FLOAT, (left, right -- res)) {
|
||||
op(_BINARY_OP_SUBTRACT_FLOAT, (left, right -- res, l, r)) {
|
||||
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right);
|
||||
res = sym_new_type(ctx, &PyFloat_Type);
|
||||
// TODO (gh-134584): Refactor this to use another uop
|
||||
if (PyJitRef_IsBorrowed(left) && PyJitRef_IsBorrowed(right)) {
|
||||
REPLACE_OP(this_instr, op_without_decref_inputs[opcode], oparg, 0);
|
||||
}
|
||||
l = left;
|
||||
r = right;
|
||||
}
|
||||
|
||||
op(_BINARY_OP_MULTIPLY_FLOAT, (left, right -- res)) {
|
||||
op(_BINARY_OP_MULTIPLY_FLOAT, (left, right -- res, l, r)) {
|
||||
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right);
|
||||
res = sym_new_type(ctx, &PyFloat_Type);
|
||||
// TODO (gh-134584): Refactor this to use another uop
|
||||
if (PyJitRef_IsBorrowed(left) && PyJitRef_IsBorrowed(right)) {
|
||||
REPLACE_OP(this_instr, op_without_decref_inputs[opcode], oparg, 0);
|
||||
}
|
||||
l = left;
|
||||
r = right;
|
||||
}
|
||||
|
||||
op(_BINARY_OP_ADD_UNICODE, (left, right -- res)) {
|
||||
|
|
@ -546,6 +540,12 @@ dummy_func(void) {
|
|||
}
|
||||
}
|
||||
|
||||
op(_POP_TOP_FLOAT, (value --)) {
|
||||
if (PyJitRef_IsBorrowed(value)) {
|
||||
REPLACE_OP(this_instr, _POP_TOP_NOP, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
op(_COPY, (bottom, unused[oparg-1] -- bottom, unused[oparg-1], top)) {
|
||||
assert(oparg > 0);
|
||||
top = bottom;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue