summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/bytecodes.c67
-rw-r--r--Python/generated_cases.c.h144
2 files changed, 88 insertions, 123 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index e87ca6e..f0e9e3a 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -69,6 +69,7 @@ do { \
#define DISPATCH() ((void)0)
#define inst(name) case name:
+#define super(name) static int SUPER_##name
#define family(name) static int family_##name
#define NAME_ERROR_MSG \
@@ -158,67 +159,11 @@ dummy_func(
SETLOCAL(oparg, value);
}
- // stack effect: ( -- __0, __1)
- inst(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);
- }
-
- // stack effect: ( -- __0, __1)
- inst(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);
- }
-
- // stack effect: ( -- )
- inst(STORE_FAST__LOAD_FAST) {
- PyObject *value = POP();
- SETLOCAL(oparg, value);
- NEXTOPARG();
- next_instr++;
- value = GETLOCAL(oparg);
- assert(value != NULL);
- Py_INCREF(value);
- PUSH(value);
- }
-
- // stack effect: (__0, __1 -- )
- inst(STORE_FAST__STORE_FAST) {
- PyObject *value = POP();
- SETLOCAL(oparg, value);
- NEXTOPARG();
- next_instr++;
- value = POP();
- SETLOCAL(oparg, value);
- }
-
- // stack effect: ( -- __0, __1)
- inst(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);
- }
+ super(LOAD_FAST__LOAD_FAST) = LOAD_FAST + LOAD_FAST;
+ super(LOAD_FAST__LOAD_CONST) = LOAD_FAST + LOAD_CONST;
+ super(STORE_FAST__LOAD_FAST) = STORE_FAST + LOAD_FAST;
+ super(STORE_FAST__STORE_FAST) = STORE_FAST + STORE_FAST;
+ super (LOAD_CONST__LOAD_FAST) = LOAD_CONST + LOAD_FAST;
// stack effect: (__0 -- )
inst(POP_TOP) {
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index c678de5..d83d683 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -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();
+ }