GH-131798: Split CALL_LEN into several uops (GH-133180)

This commit is contained in:
Diego Russo 2025-05-05 22:31:48 +01:00 committed by GitHub
parent 893034cf93
commit 9cc77aaf9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 314 additions and 281 deletions

View file

@ -1084,10 +1084,18 @@ dummy_func(void) {
sym_set_const(callable, (PyObject *)&PyUnicode_Type);
}
op(_CALL_LEN, (callable[1], self_or_null[1], args[oparg] -- res)) {
op(_CALL_LEN, (unused, unused, unused -- res)) {
res = sym_new_type(ctx, &PyLong_Type);
}
op(_GUARD_CALLABLE_LEN, (callable, unused, unused -- callable, unused, unused)) {
PyObject *len = _PyInterpreterState_GET()->callable_cache.len;
if (sym_get_const(ctx, callable) == len) {
REPLACE_OP(this_instr, _NOP, 0, 0);
}
sym_set_const(callable, len);
}
// END BYTECODES //
}