gh-145866: Convert CALL_INTRINSIC_1 to leave its inputs on the stack to be cleaned up by _POP_TOP. (GH-145964)

This commit is contained in:
Sacul 2026-03-16 19:58:12 +08:00 committed by GitHub
parent 36b5284f04
commit 37121ef77e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 1257 additions and 1215 deletions

View file

@ -1246,14 +1246,19 @@ dummy_func(
ERROR_IF(err);
}
inst(CALL_INTRINSIC_1, (value -- res)) {
op(_CALL_INTRINSIC_1, (value -- res, v)) {
assert(oparg <= MAX_INTRINSIC_1);
PyObject *res_o = _PyIntrinsics_UnaryFunctions[oparg].func(tstate, PyStackRef_AsPyObjectBorrow(value));
PyStackRef_CLOSE(value);
ERROR_IF(res_o == NULL);
if (res_o == NULL) {
ERROR_NO_POP();
}
v = value;
DEAD(value);
res = PyStackRef_FromPyObjectSteal(res_o);
}
macro(CALL_INTRINSIC_1) = _CALL_INTRINSIC_1 + POP_TOP;
inst(CALL_INTRINSIC_2, (value2_st, value1_st -- res)) {
assert(oparg <= MAX_INTRINSIC_2);
PyObject *value1 = PyStackRef_AsPyObjectBorrow(value1_st);