mirror of
https://github.com/python/cpython.git
synced 2026-05-06 12:49:07 -04:00
gh-134584: Remove custom float decref ops (GH-142576)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user