GH-131798: Split CALL_LIST_APPEND into several uops (GH-134240)

This commit is contained in:
Diego Russo 2025-05-19 15:48:55 -04:00 committed by GitHub
parent 92f85ff3a0
commit 42d03f3933
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 370 additions and 259 deletions

View file

@ -1087,6 +1087,13 @@ dummy_func(void) {
sym_set_null(null);
}
op(_GUARD_NOS_NOT_NULL, (nos, unused -- nos, unused)) {
if (sym_is_not_null(nos)) {
REPLACE_OP(this_instr, _NOP, 0, 0);
}
sym_set_non_null(nos);
}
op(_GUARD_THIRD_NULL, (null, unused, unused -- null, unused, unused)) {
if (sym_is_null(null)) {
REPLACE_OP(this_instr, _NOP, 0, 0);
@ -1135,6 +1142,14 @@ dummy_func(void) {
sym_set_const(callable, isinstance);
}
op(_GUARD_CALLABLE_LIST_APPEND, (callable, unused, unused -- callable, unused, unused)) {
PyObject *list_append = _PyInterpreterState_GET()->callable_cache.list_append;
if (sym_get_const(ctx, callable) == list_append) {
REPLACE_OP(this_instr, _NOP, 0, 0);
}
sym_set_const(callable, list_append);
}
// END BYTECODES //
}