mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-98831: Implement super-instruction generation (#99084)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
This commit is contained in:
parent
ede6cb2615
commit
7dcd28eb41
5 changed files with 163 additions and 138 deletions
144
Python/generated_cases.c.h
generated
144
Python/generated_cases.c.h
generated
|
@ -57,68 +57,6 @@
|
|||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(LOAD_FAST__LOAD_FAST) {
|
||||
PyObject *value = GETLOCAL(oparg);
|
||||
assert(value != NULL);
|
||||
NEXTOPARG();
|
||||
next_instr++;
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
value = GETLOCAL(oparg);
|
||||
assert(value != NULL);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(LOAD_FAST__LOAD_CONST) {
|
||||
PyObject *value = GETLOCAL(oparg);
|
||||
assert(value != NULL);
|
||||
NEXTOPARG();
|
||||
next_instr++;
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
value = GETITEM(consts, oparg);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(STORE_FAST__LOAD_FAST) {
|
||||
PyObject *value = POP();
|
||||
SETLOCAL(oparg, value);
|
||||
NEXTOPARG();
|
||||
next_instr++;
|
||||
value = GETLOCAL(oparg);
|
||||
assert(value != NULL);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(STORE_FAST__STORE_FAST) {
|
||||
PyObject *value = POP();
|
||||
SETLOCAL(oparg, value);
|
||||
NEXTOPARG();
|
||||
next_instr++;
|
||||
value = POP();
|
||||
SETLOCAL(oparg, value);
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(LOAD_CONST__LOAD_FAST) {
|
||||
PyObject *value = GETITEM(consts, oparg);
|
||||
NEXTOPARG();
|
||||
next_instr++;
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
value = GETLOCAL(oparg);
|
||||
assert(value != NULL);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(POP_TOP) {
|
||||
PyObject *value = POP();
|
||||
Py_DECREF(value);
|
||||
|
@ -3900,3 +3838,85 @@
|
|||
TARGET(CACHE) {
|
||||
Py_UNREACHABLE();
|
||||
}
|
||||
|
||||
TARGET(LOAD_FAST__LOAD_FAST) {
|
||||
{
|
||||
PyObject *value = GETLOCAL(oparg);
|
||||
assert(value != NULL);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
}
|
||||
NEXTOPARG();
|
||||
next_instr++;
|
||||
{
|
||||
PyObject *value = GETLOCAL(oparg);
|
||||
assert(value != NULL);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
}
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(LOAD_FAST__LOAD_CONST) {
|
||||
{
|
||||
PyObject *value = GETLOCAL(oparg);
|
||||
assert(value != NULL);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
}
|
||||
NEXTOPARG();
|
||||
next_instr++;
|
||||
{
|
||||
PyObject *value = GETITEM(consts, oparg);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
}
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(STORE_FAST__LOAD_FAST) {
|
||||
{
|
||||
PyObject *value = POP();
|
||||
SETLOCAL(oparg, value);
|
||||
}
|
||||
NEXTOPARG();
|
||||
next_instr++;
|
||||
{
|
||||
PyObject *value = GETLOCAL(oparg);
|
||||
assert(value != NULL);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
}
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(STORE_FAST__STORE_FAST) {
|
||||
{
|
||||
PyObject *value = POP();
|
||||
SETLOCAL(oparg, value);
|
||||
}
|
||||
NEXTOPARG();
|
||||
next_instr++;
|
||||
{
|
||||
PyObject *value = POP();
|
||||
SETLOCAL(oparg, value);
|
||||
}
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(LOAD_CONST__LOAD_FAST) {
|
||||
{
|
||||
PyObject *value = GETITEM(consts, oparg);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
}
|
||||
NEXTOPARG();
|
||||
next_instr++;
|
||||
{
|
||||
PyObject *value = GETLOCAL(oparg);
|
||||
assert(value != NULL);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
}
|
||||
DISPATCH();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue