mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
GH-131798: Split CALL_LEN into several uops (GH-133180)
This commit is contained in:
parent
893034cf93
commit
9cc77aaf9d
11 changed files with 314 additions and 281 deletions
|
@ -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 //
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue