mirror of
https://github.com/python/cpython.git
synced 2025-08-26 03:34:43 +00:00
GH-99005: More intrinsics (GH-100774)
* Remove UNARY_POSITIVE, LIST_TO_TUPLE and ASYNC_GEN_WRAP, replacing them with intrinsics.
This commit is contained in:
parent
659c2607f5
commit
78068126a1
16 changed files with 151 additions and 204 deletions
|
@ -173,12 +173,6 @@ dummy_func(
|
|||
|
||||
macro(END_FOR) = POP_TOP + POP_TOP;
|
||||
|
||||
inst(UNARY_POSITIVE, (value -- res)) {
|
||||
res = PyNumber_Positive(value);
|
||||
DECREF_INPUTS();
|
||||
ERROR_IF(res == NULL, error);
|
||||
}
|
||||
|
||||
inst(UNARY_NEGATIVE, (value -- res)) {
|
||||
res = PyNumber_Negative(value);
|
||||
DECREF_INPUTS();
|
||||
|
@ -757,13 +751,6 @@ dummy_func(
|
|||
}
|
||||
}
|
||||
|
||||
inst(ASYNC_GEN_WRAP, (v -- w)) {
|
||||
assert(frame->f_code->co_flags & CO_ASYNC_GENERATOR);
|
||||
w = _PyAsyncGenValueWrapperNew(v);
|
||||
DECREF_INPUTS();
|
||||
ERROR_IF(w == NULL, error);
|
||||
}
|
||||
|
||||
inst(YIELD_VALUE, (retval -- unused)) {
|
||||
// NOTE: It's important that YIELD_VALUE never raises an exception!
|
||||
// The compiler treats any exception raised here as a failed close()
|
||||
|
@ -1348,12 +1335,6 @@ dummy_func(
|
|||
PUSH(list);
|
||||
}
|
||||
|
||||
inst(LIST_TO_TUPLE, (list -- tuple)) {
|
||||
tuple = PyList_AsTuple(list);
|
||||
DECREF_INPUTS();
|
||||
ERROR_IF(tuple == NULL, error);
|
||||
}
|
||||
|
||||
inst(LIST_EXTEND, (iterable -- )) {
|
||||
PyObject *list = PEEK(oparg + 1); // iterable is still on the stack
|
||||
PyObject *none_val = _PyList_Extend((PyListObject *)list, iterable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue