gh-101799: implement PREP_RERAISE_STAR as an intrinsic function (#101800)

This commit is contained in:
Irit Katriel 2023-02-14 11:54:13 +00:00 committed by GitHub
parent 3690688149
commit 81e3aa835c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 107 additions and 73 deletions

View file

@ -501,7 +501,14 @@ dummy_func(
inst(CALL_INTRINSIC_1, (value -- res)) {
assert(oparg <= MAX_INTRINSIC_1);
res = _PyIntrinsics_UnaryFunctions[oparg](tstate, value);
Py_DECREF(value);
DECREF_INPUTS();
ERROR_IF(res == NULL, error);
}
inst(CALL_INTRINSIC_2, (value2, value1 -- res)) {
assert(oparg <= MAX_INTRINSIC_2);
res = _PyIntrinsics_BinaryFunctions[oparg](tstate, value2, value1);
DECREF_INPUTS();
ERROR_IF(res == NULL, error);
}
@ -788,15 +795,6 @@ dummy_func(
goto exception_unwind;
}
inst(PREP_RERAISE_STAR, (orig, excs -- val)) {
assert(PyList_Check(excs));
val = _PyExc_PrepReraiseStar(orig, excs);
DECREF_INPUTS();
ERROR_IF(val == NULL, error);
}
inst(END_ASYNC_FOR, (awaitable, exc -- )) {
assert(exc && PyExceptionInstance_Check(exc));
if (PyErr_GivenExceptionMatches(exc, PyExc_StopAsyncIteration)) {
@ -2383,7 +2381,7 @@ dummy_func(
}
// Cache layout: counter/1, func_version/2, min_args/1
// Neither CALL_INTRINSIC_1 nor CALL_FUNCTION_EX are members!
// Neither CALL_INTRINSIC_1/2 nor CALL_FUNCTION_EX are members!
family(call, INLINE_CACHE_ENTRIES_CALL) = {
CALL,
CALL_BOUND_METHOD_EXACT_ARGS,