mirror of
https://github.com/python/cpython.git
synced 2026-04-15 00:00:57 +00:00
gh-145866: Convert _CALL_INTRINSIC_2 to leave its inputs on the stack to be cleaned up by _POP_TOP (GH-146262)
This commit is contained in:
parent
495178ab05
commit
f5364ae750
10 changed files with 1346 additions and 1283 deletions
|
|
@ -1340,17 +1340,26 @@ dummy_func(
|
|||
|
||||
macro(CALL_INTRINSIC_1) = _CALL_INTRINSIC_1 + POP_TOP;
|
||||
|
||||
inst(CALL_INTRINSIC_2, (value2_st, value1_st -- res)) {
|
||||
op(_CALL_INTRINSIC_2, (value2_st, value1_st -- res, vs1, vs2)) {
|
||||
assert(oparg <= MAX_INTRINSIC_2);
|
||||
PyObject *value1 = PyStackRef_AsPyObjectBorrow(value1_st);
|
||||
PyObject *value2 = PyStackRef_AsPyObjectBorrow(value2_st);
|
||||
|
||||
PyObject *res_o = _PyIntrinsics_BinaryFunctions[oparg].func(tstate, value2, value1);
|
||||
DECREF_INPUTS();
|
||||
ERROR_IF(res_o == NULL);
|
||||
|
||||
if (res_o == NULL) {
|
||||
ERROR_NO_POP();
|
||||
}
|
||||
|
||||
res = PyStackRef_FromPyObjectSteal(res_o);
|
||||
|
||||
vs1 = value1_st;
|
||||
vs2 = value2_st;
|
||||
INPUTS_DEAD();
|
||||
}
|
||||
|
||||
macro(CALL_INTRINSIC_2) = _CALL_INTRINSIC_2 + POP_TOP + POP_TOP;
|
||||
|
||||
tier1 inst(RAISE_VARARGS, (args[oparg] -- )) {
|
||||
assert(oparg < 3);
|
||||
PyObject *cause = oparg == 2 ? PyStackRef_AsPyObjectSteal(args[1]) : NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue