mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
31
Python/generated_cases.c.h
generated
31
Python/generated_cases.c.h
generated
|
@ -202,16 +202,6 @@
|
|||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(UNARY_POSITIVE) {
|
||||
PyObject *value = PEEK(1);
|
||||
PyObject *res;
|
||||
res = PyNumber_Positive(value);
|
||||
Py_DECREF(value);
|
||||
if (res == NULL) goto pop_1_error;
|
||||
POKE(1, res);
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(UNARY_NEGATIVE) {
|
||||
PyObject *value = PEEK(1);
|
||||
PyObject *res;
|
||||
|
@ -921,17 +911,6 @@
|
|||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(ASYNC_GEN_WRAP) {
|
||||
PyObject *v = PEEK(1);
|
||||
PyObject *w;
|
||||
assert(frame->f_code->co_flags & CO_ASYNC_GENERATOR);
|
||||
w = _PyAsyncGenValueWrapperNew(v);
|
||||
Py_DECREF(v);
|
||||
if (w == NULL) goto pop_1_error;
|
||||
POKE(1, w);
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(YIELD_VALUE) {
|
||||
PyObject *retval = PEEK(1);
|
||||
// NOTE: It's important that YIELD_VALUE never raises an exception!
|
||||
|
@ -1566,16 +1545,6 @@
|
|||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(LIST_TO_TUPLE) {
|
||||
PyObject *list = PEEK(1);
|
||||
PyObject *tuple;
|
||||
tuple = PyList_AsTuple(list);
|
||||
Py_DECREF(list);
|
||||
if (tuple == NULL) goto pop_1_error;
|
||||
POKE(1, tuple);
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(LIST_EXTEND) {
|
||||
PyObject *iterable = PEEK(1);
|
||||
PyObject *list = PEEK(oparg + 1); // iterable is still on the stack
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue