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

@ -2065,11 +2065,22 @@
break;
}
case _GUARD_CALLABLE_LEN: {
JitOptSymbol *callable;
callable = stack_pointer[-3];
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);
break;
}
case _CALL_LEN: {
JitOptSymbol *res;
res = sym_new_type(ctx, &PyLong_Type);
stack_pointer[-2 - oparg] = res;
stack_pointer += -1 - oparg;
stack_pointer[-3] = res;
stack_pointer += -2;
assert(WITHIN_STACK_BOUNDS());
break;
}