mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
gh-101799: implement PREP_RERAISE_STAR as an intrinsic function (#101800)
This commit is contained in:
parent
3690688149
commit
81e3aa835c
13 changed files with 107 additions and 73 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue