mirror of
https://github.com/python/cpython.git
synced 2025-12-31 12:33:28 +00:00
GH-139757: JIT: Remove redundant branches to jumps in the assembly optimizer (GH-140800)
JIT: Remove redundant branches to jump in the assembly optimizer * Refactor JIT assembly optimizer making instructions instances not just strings * Remove redundant jumps and branches where legal to do so * Modifies _BINARY_OP_SUBSCR_STR_INT to avoid excessive inlining depth
This commit is contained in:
parent
37988c57ea
commit
e0451ceef8
8 changed files with 220 additions and 74 deletions
5
Python/generated_cases.c.h
generated
5
Python/generated_cases.c.h
generated
|
|
@ -892,12 +892,13 @@
|
|||
assert(_PyOpcode_Deopt[opcode] == (BINARY_OP));
|
||||
JUMP_TO_PREDICTED(BINARY_OP);
|
||||
}
|
||||
Py_UCS4 c = PyUnicode_READ_CHAR(str, index);
|
||||
if (Py_ARRAY_LENGTH(_Py_SINGLETON(strings).ascii) <= c) {
|
||||
if (!PyUnicode_IS_COMPACT_ASCII(str)) {
|
||||
UPDATE_MISS_STATS(BINARY_OP);
|
||||
assert(_PyOpcode_Deopt[opcode] == (BINARY_OP));
|
||||
JUMP_TO_PREDICTED(BINARY_OP);
|
||||
}
|
||||
uint8_t c = PyUnicode_1BYTE_DATA(str)[index];
|
||||
assert(c < 128);
|
||||
STAT_INC(BINARY_OP, hit);
|
||||
PyObject *res_o = (PyObject*)&_Py_SINGLETON(strings).ascii[c];
|
||||
PyStackRef_CLOSE_SPECIALIZED(sub_st, _PyLong_ExactDealloc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue