GH-118095: Add tier two support for BINARY_SUBSCR_GETITEM (GH-120793)

This commit is contained in:
Mark Shannon 2024-08-02 00:19:05 +01:00 committed by GitHub
parent fda6bd842a
commit df13a1821a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 317 additions and 207 deletions

View file

@ -52,14 +52,6 @@
#define DPRINTF(level, ...)
#endif
static inline bool
op_is_end(uint32_t opcode)
{
return opcode == _EXIT_TRACE || opcode == _JUMP_TO_TOP;
}
static int
get_mutations(PyObject* dict) {
assert(PyDict_CheckExact(dict));
@ -288,7 +280,7 @@ remove_globals(_PyInterpreterFrame *frame, _PyUOpInstruction *buffer,
prechecked_function_version = (uint32_t)buffer[pc].operand;
break;
default:
if (op_is_end(opcode)) {
if (is_terminator(inst)) {
return 1;
}
break;
@ -552,6 +544,7 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
}
case _JUMP_TO_TOP:
case _EXIT_TRACE:
case _DYNAMIC_EXIT:
return pc + 1;
default:
{