mirror of
https://github.com/python/cpython.git
synced 2026-01-07 07:52:29 +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
|
|
@ -196,7 +196,7 @@ check_stack_bounds(JitOptContext *ctx, JitOptRef *stack_pointer, int offset, int
|
|||
(opcode == _RETURN_VALUE) ||
|
||||
(opcode == _RETURN_GENERATOR) ||
|
||||
(opcode == _YIELD_VALUE);
|
||||
if (should_check && (stack_level < 0 || stack_level > STACK_SIZE())) {
|
||||
if (should_check && (stack_level < 0 || stack_level > STACK_SIZE() + MAX_CACHED_REGISTER)) {
|
||||
ctx->contradiction = true;
|
||||
ctx->done = true;
|
||||
return 1;
|
||||
|
|
@ -312,7 +312,7 @@ _Py_opt_assert_within_stack_bounds(
|
|||
fflush(stdout);
|
||||
abort();
|
||||
}
|
||||
int size = (int)(frame->stack_len);
|
||||
int size = (int)(frame->stack_len) + MAX_CACHED_REGISTER;
|
||||
if (level > size) {
|
||||
printf("Stack overflow (depth = %d) at %s:%d\n", level, filename, lineno);
|
||||
fflush(stdout);
|
||||
|
|
@ -327,13 +327,6 @@ _Py_opt_assert_within_stack_bounds(
|
|||
#define ASSERT_WITHIN_STACK_BOUNDS(F, L) (void)0
|
||||
#endif
|
||||
|
||||
// TODO (gh-134584) generate most of this table automatically
|
||||
const uint16_t op_without_decref_inputs[MAX_UOP_ID + 1] = {
|
||||
[_BINARY_OP_MULTIPLY_FLOAT] = _BINARY_OP_MULTIPLY_FLOAT__NO_DECREF_INPUTS,
|
||||
[_BINARY_OP_ADD_FLOAT] = _BINARY_OP_ADD_FLOAT__NO_DECREF_INPUTS,
|
||||
[_BINARY_OP_SUBTRACT_FLOAT] = _BINARY_OP_SUBTRACT_FLOAT__NO_DECREF_INPUTS,
|
||||
};
|
||||
|
||||
/* >0 (length) for success, 0 for not ready, clears all possible errors. */
|
||||
static int
|
||||
optimize_uops(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue