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:
Mark Shannon 2023-01-06 14:47:57 +00:00 committed by GitHub
parent 659c2607f5
commit 78068126a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 151 additions and 204 deletions

View file

@ -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