mirror of
https://github.com/python/cpython.git
synced 2026-04-20 10:51:00 +00:00
gh-148211: decompose [_POP_CALL_X/_SHUFFLE_2]_LOAD_CONST_INLINE_BORROW in JIT (GH-148313)
This commit is contained in:
parent
d3b7b93cbb
commit
aea0b91d65
8 changed files with 1040 additions and 1411 deletions
|
|
@ -657,9 +657,6 @@ const uint16_t op_without_push[MAX_UOP_ID + 1] = {
|
|||
[_POP_TOP_LOAD_CONST_INLINE] = _POP_TOP,
|
||||
[_POP_TOP_LOAD_CONST_INLINE_BORROW] = _POP_TOP,
|
||||
[_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TWO,
|
||||
[_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE,
|
||||
[_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW] = _POP_CALL_TWO,
|
||||
[_SHUFFLE_2_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW,
|
||||
};
|
||||
|
||||
const bool op_skip[MAX_UOP_ID + 1] = {
|
||||
|
|
@ -679,15 +676,12 @@ const uint16_t op_without_pop[MAX_UOP_ID + 1] = {
|
|||
[_POP_TOP_LOAD_CONST_INLINE_BORROW] = _LOAD_CONST_INLINE_BORROW,
|
||||
[_POP_TWO] = _POP_TOP,
|
||||
[_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TOP_LOAD_CONST_INLINE_BORROW,
|
||||
[_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW,
|
||||
[_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = _POP_CALL_LOAD_CONST_INLINE_BORROW,
|
||||
[_POP_CALL_TWO] = _POP_CALL_ONE,
|
||||
[_POP_CALL_ONE] = _POP_CALL,
|
||||
};
|
||||
|
||||
const uint16_t op_without_pop_null[MAX_UOP_ID + 1] = {
|
||||
[_POP_CALL] = _POP_TOP,
|
||||
[_POP_CALL_LOAD_CONST_INLINE_BORROW] = _POP_TOP_LOAD_CONST_INLINE_BORROW,
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -739,9 +733,9 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
|
|||
}
|
||||
}
|
||||
else if (last->opcode == _PUSH_NULL) {
|
||||
// Handle _POP_CALL and _POP_CALL_LOAD_CONST_INLINE_BORROW separately.
|
||||
// Handle _POP_CALL separately.
|
||||
// This looks for a preceding _PUSH_NULL instruction and
|
||||
// simplifies to _POP_TOP(_LOAD_CONST_INLINE_BORROW).
|
||||
// simplifies to _POP_TOP.
|
||||
last->opcode = _NOP;
|
||||
opcode = buffer[pc].opcode = op_without_pop_null[opcode];
|
||||
assert(opcode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue