Blame SOURCES/00233-Computed-Goto-dispatch.patch

925e6b
From 66818f47df1e37b105fd42d6cbaa756c4d72393c Mon Sep 17 00:00:00 2001
925e6b
From: Charalampos Stratakis <cstratak@redhat.com>
925e6b
Date: Wed, 30 Mar 2016 15:54:29 +0200
925e6b
Subject: [PATCH] Computed Goto dispatch for Python2
925e6b
925e6b
---
925e6b
 Include/opcode.h            |   9 +
925e6b
 Makefile.pre.in             |  15 +
925e6b
 Python/ceval.c              | 770 +++++++++++++++++++++++++++++++-------------
925e6b
 Python/makeopcodetargets.py |  45 +++
925e6b
 Python/opcode_targets.h     | 258 +++++++++++++++
925e6b
 configure                   |  81 +++++
925e6b
 configure.ac                |  51 +++
925e6b
 pyconfig.h.in               |   6 +
925e6b
 8 files changed, 1005 insertions(+), 230 deletions(-)
925e6b
925e6b
diff --git a/Include/opcode.h b/Include/opcode.h
925e6b
index 9764109..9ed5487 100644
925e6b
--- a/Include/opcode.h
925e6b
+++ b/Include/opcode.h
925e6b
@@ -37,12 +37,21 @@ extern "C" {
925e6b
 
925e6b
 #define SLICE		30
925e6b
 /* Also uses 31-33 */
925e6b
+#define SLICE_1		31
925e6b
+#define SLICE_2		32
925e6b
+#define SLICE_3		33
925e6b
 
925e6b
 #define STORE_SLICE	40
925e6b
 /* Also uses 41-43 */
925e6b
+#define STORE_SLICE_1	41
925e6b
+#define STORE_SLICE_2	42
925e6b
+#define STORE_SLICE_3	43
925e6b
 
925e6b
 #define DELETE_SLICE	50
925e6b
 /* Also uses 51-53 */
925e6b
+#define DELETE_SLICE_1	51
925e6b
+#define DELETE_SLICE_2	52
925e6b
+#define DELETE_SLICE_3	53
925e6b
 
925e6b
 #define STORE_MAP	54
925e6b
 #define INPLACE_ADD	55
925e6b
diff --git a/Makefile.pre.in b/Makefile.pre.in
925e6b
index 4ee61f6..611f63a 100644
925e6b
--- a/Makefile.pre.in
925e6b
+++ b/Makefile.pre.in
925e6b
@@ -299,6 +299,16 @@ ASDLGEN=	$(srcdir)/Parser/asdl_c.py
925e6b
 
925e6b
 ##########################################################################
925e6b
 # Python
925e6b
+
925e6b
+OPCODETARGETS_H= \
925e6b
+			   $(srcdir)/Python/opcode_targets.h
925e6b
+
925e6b
+OPCODETARGETGEN= \
925e6b
+			   $(srcdir)/Python/makeopcodetargets.py
925e6b
+
925e6b
+OPCODETARGETGEN_FILES= \
925e6b
+			   $(OPCODETARGETGEN) $(srcdir)/Lib/opcode.py
925e6b
+
925e6b
 PYTHON_OBJS=	\
925e6b
 		Python/_warnings.o \
925e6b
 		Python/Python-ast.o \
925e6b
@@ -648,6 +658,11 @@ Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c \
925e6b
 Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \
925e6b
 				$(STRINGLIB_HEADERS)
925e6b
 
925e6b
+$(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES)
925e6b
+	   $(OPCODETARGETGEN) $(OPCODETARGETS_H)
925e6b
+
925e6b
+Python/ceval.o: $(OPCODETARGETS_H)
925e6b
+
925e6b
 Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
925e6b
 				$(STRINGLIB_HEADERS)
925e6b
 
925e6b
diff --git a/Python/ceval.c b/Python/ceval.c
925e6b
index 8c6f8d7..67d1576 100644
925e6b
--- a/Python/ceval.c
925e6b
+++ b/Python/ceval.c
925e6b
@@ -757,6 +757,99 @@ PyEval_EvalFrame(PyFrameObject *f) {
925e6b
 PyObject *
925e6b
 PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
 {
925e6b
+#ifdef DYNAMIC_EXECUTION_PROFILE
925e6b
+  #undef USE_COMPUTED_GOTOS
925e6b
+#endif
925e6b
+#ifdef HAVE_COMPUTED_GOTOS
925e6b
+    #ifndef USE_COMPUTED_GOTOS
925e6b
+    #define USE_COMPUTED_GOTOS 1
925e6b
+    #endif
925e6b
+#else
925e6b
+    #if defined(USE_COMPUTED_GOTOS) && USE_COMPUTED_GOTOS
925e6b
+    #error "Computed gotos are not supported on this compiler."
925e6b
+    #endif
925e6b
+    #undef USE_COMPUTED_GOTOS
925e6b
+    #define USE_COMPUTED_GOTOS 0
925e6b
+#endif
925e6b
+#if USE_COMPUTED_GOTOS
925e6b
+/* Import the static jump table */
925e6b
+#include "opcode_targets.h"
925e6b
+
925e6b
+  /* This macro is used when several opcodes defer to the same implementation
925e6b
+    (e.g. SETUP_LOOP, SETUP_FINALLY) */
925e6b
+#define TARGET_WITH_IMPL(op, impl) \
925e6b
+               TARGET_##op: \
925e6b
+               opcode = op; \
925e6b
+               oparg = NEXTARG(); \
925e6b
+               case op: \
925e6b
+               goto impl; \
925e6b
+
925e6b
+#define TARGET_WITH_IMPL_NOARG(op, impl) \
925e6b
+               TARGET_##op: \
925e6b
+               opcode = op; \
925e6b
+               case op: \
925e6b
+               goto impl; \
925e6b
+
925e6b
+#define TARGET_NOARG(op) \
925e6b
+               TARGET_##op: \
925e6b
+               opcode = op; \
925e6b
+               case op: \
925e6b
+
925e6b
+#define TARGET(op) \
925e6b
+               TARGET_##op: \
925e6b
+               opcode = op; \
925e6b
+               oparg = NEXTARG(); \
925e6b
+               case op:\
925e6b
+
925e6b
+#define DISPATCH() \
925e6b
+               { \
925e6b
+       int _tick = _Py_Ticker - 1; \
925e6b
+       _Py_Ticker = _tick; \
925e6b
+       if (_tick >= 0) { \
925e6b
+               FAST_DISPATCH(); \
925e6b
+       } \
925e6b
+       continue; \
925e6b
+               }
925e6b
+
925e6b
+#ifdef LLTRACE
925e6b
+#define FAST_DISPATCH() \
925e6b
+               { \
925e6b
+       if (!lltrace && !_Py_TracingPossible) { \
925e6b
+               f->f_lasti = INSTR_OFFSET(); \
925e6b
+               goto *opcode_targets[*next_instr++]; \
925e6b
+       } \
925e6b
+       goto fast_next_opcode; \
925e6b
+               }
925e6b
+#else
925e6b
+#define FAST_DISPATCH() { \
925e6b
+               if (!_Py_TracingPossible) { \
925e6b
+                       f->f_lasti = INSTR_OFFSET(); \
925e6b
+                       goto *opcode_targets[*next_instr++]; \
925e6b
+               } \
925e6b
+               goto fast_next_opcode;\
925e6b
+}
925e6b
+#endif
925e6b
+
925e6b
+#else
925e6b
+#define TARGET(op) \
925e6b
+               case op:
925e6b
+#define TARGET_WITH_IMPL(op, impl) \
925e6b
+               /* silence compiler warnings about `impl` unused */ \
925e6b
+               if (0) goto impl;
925e6b
+               case op:\
925e6b
+
925e6b
+#define TARGET_NOARG(op) \
925e6b
+               case op:\
925e6b
+
925e6b
+#define TARGET_WITH_IMPL_NOARG(op, impl) \
925e6b
+               if (0) goto impl; \
925e6b
+               case op:\
925e6b
+
925e6b
+#define DISPATCH() continue
925e6b
+#define FAST_DISPATCH() goto fast_next_opcode
925e6b
+#endif
925e6b
+
925e6b
+
925e6b
 #ifdef DXPAIRS
925e6b
     int lastopcode = 0;
925e6b
 #endif
925e6b
@@ -874,14 +967,17 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
     counter updates for both opcodes.
925e6b
 */
925e6b
 
925e6b
-#ifdef DYNAMIC_EXECUTION_PROFILE
925e6b
+// Next opcode prediction is also enabled for Computed Gotos as well.
925e6b
+#if defined(DYNAMIC_EXECUTION_PROFILE) || USE_COMPUTED_GOTOS
925e6b
 #define PREDICT(op)             if (0) goto PRED_##op
925e6b
+#define PREDICTED(op)           PRED_##op:
925e6b
+#define PREDICTED_WITH_ARG(op)  PRED_##op:
925e6b
 #else
925e6b
 #define PREDICT(op)             if (*next_instr == op) goto PRED_##op
925e6b
-#endif
925e6b
-
925e6b
 #define PREDICTED(op)           PRED_##op: next_instr++
925e6b
 #define PREDICTED_WITH_ARG(op)  PRED_##op: oparg = PEEKARG(); next_instr += 3
925e6b
+#endif
925e6b
+
925e6b
 
925e6b
 /* Stack manipulation macros */
925e6b
 
925e6b
@@ -1179,55 +1275,71 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
 
925e6b
         /* case STOP_CODE: this is an error! */
925e6b
 
925e6b
-        case NOP:
925e6b
-            goto fast_next_opcode;
925e6b
+        TARGET_NOARG(NOP)
925e6b
+       {
925e6b
+               FAST_DISPATCH();
925e6b
+       }
925e6b
+        TARGET(LOAD_FAST)
925e6b
+        {
925e6b
 
925e6b
-        case LOAD_FAST:
925e6b
             x = GETLOCAL(oparg);
925e6b
             if (x != NULL) {
925e6b
                 Py_INCREF(x);
925e6b
                 PUSH(x);
925e6b
-                goto fast_next_opcode;
925e6b
+                FAST_DISPATCH();
925e6b
             }
925e6b
             format_exc_check_arg(PyExc_UnboundLocalError,
925e6b
                 UNBOUNDLOCAL_ERROR_MSG,
925e6b
                 PyTuple_GetItem(co->co_varnames, oparg));
925e6b
             break;
925e6b
 
925e6b
-        case LOAD_CONST:
925e6b
+        }
925e6b
+
925e6b
+        TARGET(LOAD_CONST)
925e6b
+        {
925e6b
             x = GETITEM(consts, oparg);
925e6b
             Py_INCREF(x);
925e6b
             PUSH(x);
925e6b
-            goto fast_next_opcode;
925e6b
+            FAST_DISPATCH();
925e6b
+        }
925e6b
 
925e6b
         PREDICTED_WITH_ARG(STORE_FAST);
925e6b
-        case STORE_FAST:
925e6b
+        TARGET(STORE_FAST)
925e6b
+        {
925e6b
             v = POP();
925e6b
             SETLOCAL(oparg, v);
925e6b
-            goto fast_next_opcode;
925e6b
+            FAST_DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case POP_TOP:
925e6b
+        TARGET_NOARG(POP_TOP)
925e6b
+        {
925e6b
             v = POP();
925e6b
             Py_DECREF(v);
925e6b
-            goto fast_next_opcode;
925e6b
+            FAST_DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case ROT_TWO:
925e6b
+        TARGET_NOARG(ROT_TWO)
925e6b
+        {
925e6b
             v = TOP();
925e6b
             w = SECOND();
925e6b
             SET_TOP(w);
925e6b
             SET_SECOND(v);
925e6b
-            goto fast_next_opcode;
925e6b
+            FAST_DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case ROT_THREE:
925e6b
+        TARGET_NOARG(ROT_THREE)
925e6b
+        {
925e6b
             v = TOP();
925e6b
             w = SECOND();
925e6b
             x = THIRD();
925e6b
             SET_TOP(w);
925e6b
             SET_SECOND(x);
925e6b
             SET_THIRD(v);
925e6b
-            goto fast_next_opcode;
925e6b
+            FAST_DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case ROT_FOUR:
925e6b
+        TARGET_NOARG(ROT_FOUR)
925e6b
+        {
925e6b
             u = TOP();
925e6b
             v = SECOND();
925e6b
             w = THIRD();
925e6b
@@ -1236,15 +1348,19 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             SET_SECOND(w);
925e6b
             SET_THIRD(x);
925e6b
             SET_FOURTH(u);
925e6b
-            goto fast_next_opcode;
925e6b
+            FAST_DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case DUP_TOP:
925e6b
+        TARGET_NOARG(DUP_TOP)
925e6b
+        {
925e6b
             v = TOP();
925e6b
             Py_INCREF(v);
925e6b
             PUSH(v);
925e6b
-            goto fast_next_opcode;
925e6b
+            FAST_DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case DUP_TOPX:
925e6b
+        TARGET(DUP_TOPX)
925e6b
+        {
925e6b
             if (oparg == 2) {
925e6b
                 x = TOP();
925e6b
                 Py_INCREF(x);
925e6b
@@ -1253,7 +1369,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 STACKADJ(2);
925e6b
                 SET_TOP(x);
925e6b
                 SET_SECOND(w);
925e6b
-                goto fast_next_opcode;
925e6b
+                FAST_DISPATCH();
925e6b
             } else if (oparg == 3) {
925e6b
                 x = TOP();
925e6b
                 Py_INCREF(x);
925e6b
@@ -1265,84 +1381,100 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 SET_TOP(x);
925e6b
                 SET_SECOND(w);
925e6b
                 SET_THIRD(v);
925e6b
-                goto fast_next_opcode;
925e6b
+                FAST_DISPATCH();
925e6b
             }
925e6b
             Py_FatalError("invalid argument to DUP_TOPX"
925e6b
                           " (bytecode corruption?)");
925e6b
             /* Never returns, so don't bother to set why. */
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case UNARY_POSITIVE:
925e6b
+        TARGET_NOARG(UNARY_POSITIVE)
925e6b
+        {
925e6b
             v = TOP();
925e6b
             x = PyNumber_Positive(v);
925e6b
             Py_DECREF(v);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case UNARY_NEGATIVE:
925e6b
+        TARGET_NOARG( UNARY_NEGATIVE)
925e6b
+        {
925e6b
             v = TOP();
925e6b
             x = PyNumber_Negative(v);
925e6b
             Py_DECREF(v);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case UNARY_NOT:
925e6b
+        TARGET_NOARG(UNARY_NOT)
925e6b
+        {
925e6b
             v = TOP();
925e6b
             err = PyObject_IsTrue(v);
925e6b
             Py_DECREF(v);
925e6b
             if (err == 0) {
925e6b
                 Py_INCREF(Py_True);
925e6b
                 SET_TOP(Py_True);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             else if (err > 0) {
925e6b
                 Py_INCREF(Py_False);
925e6b
                 SET_TOP(Py_False);
925e6b
                 err = 0;
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             STACKADJ(-1);
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case UNARY_CONVERT:
925e6b
+        TARGET_NOARG(UNARY_CONVERT)
925e6b
+        {
925e6b
             v = TOP();
925e6b
             x = PyObject_Repr(v);
925e6b
             Py_DECREF(v);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case UNARY_INVERT:
925e6b
+        TARGET_NOARG(UNARY_INVERT)
925e6b
+        {
925e6b
             v = TOP();
925e6b
             x = PyNumber_Invert(v);
925e6b
             Py_DECREF(v);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_POWER:
925e6b
+        TARGET_NOARG(BINARY_POWER)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_Power(v, w, Py_None);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_MULTIPLY:
925e6b
+        TARGET_NOARG(BINARY_MULTIPLY)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_Multiply(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if(x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_DIVIDE:
925e6b
+        TARGET_NOARG(BINARY_DIVIDE)
925e6b
+        {
925e6b
             if (!_Py_QnewFlag) {
925e6b
                 w = POP();
925e6b
                 v = TOP();
925e6b
@@ -1350,32 +1482,37 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 Py_DECREF(v);
925e6b
                 Py_DECREF(w);
925e6b
                 SET_TOP(x);
925e6b
-                if (x != NULL) continue;
925e6b
+                if (x != NULL) DISPATCH();
925e6b
                 break;
925e6b
             }
925e6b
-            /* -Qnew is in effect:  fall through to
925e6b
-               BINARY_TRUE_DIVIDE */
925e6b
-        case BINARY_TRUE_DIVIDE:
925e6b
+        }
925e6b
+        /* -Qnew is in effect:  fall through to BINARY_TRUE_DIVIDE */
925e6b
+        TARGET_NOARG(BINARY_TRUE_DIVIDE)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_TrueDivide(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_FLOOR_DIVIDE:
925e6b
+        TARGET_NOARG(BINARY_FLOOR_DIVIDE)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_FloorDivide(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_MODULO:
925e6b
+        TARGET_NOARG(BINARY_MODULO)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             if (PyString_CheckExact(v))
925e6b
@@ -1385,10 +1522,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_ADD:
925e6b
+        TARGET_NOARG(BINARY_ADD)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             if (PyInt_CheckExact(v) && PyInt_CheckExact(w)) {
925e6b
@@ -1417,10 +1556,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
           skip_decref_vx:
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_SUBTRACT:
925e6b
+        TARGET_NOARG(BINARY_SUBTRACT)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             if (PyInt_CheckExact(v) && PyInt_CheckExact(w)) {
925e6b
@@ -1442,10 +1583,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_SUBSCR:
925e6b
+        TARGET_NOARG(BINARY_SUBSCR)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             if (PyList_CheckExact(v) && PyInt_CheckExact(w)) {
925e6b
@@ -1466,102 +1609,122 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_LSHIFT:
925e6b
+        TARGET_NOARG(BINARY_LSHIFT)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_Lshift(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_RSHIFT:
925e6b
+        TARGET_NOARG(BINARY_RSHIFT)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_Rshift(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_AND:
925e6b
+        TARGET_NOARG(BINARY_AND)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_And(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_XOR:
925e6b
+        TARGET_NOARG(BINARY_XOR)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_Xor(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BINARY_OR:
925e6b
+        TARGET_NOARG(BINARY_OR)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_Or(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case LIST_APPEND:
925e6b
+        TARGET(LIST_APPEND)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = PEEK(oparg);
925e6b
             err = PyList_Append(v, w);
925e6b
             Py_DECREF(w);
925e6b
             if (err == 0) {
925e6b
                 PREDICT(JUMP_ABSOLUTE);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case SET_ADD:
925e6b
+        TARGET(SET_ADD)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = stack_pointer[-oparg];
925e6b
             err = PySet_Add(v, w);
925e6b
             Py_DECREF(w);
925e6b
             if (err == 0) {
925e6b
                 PREDICT(JUMP_ABSOLUTE);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case INPLACE_POWER:
925e6b
+        TARGET_NOARG(INPLACE_POWER)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_InPlacePower(v, w, Py_None);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case INPLACE_MULTIPLY:
925e6b
+        TARGET_NOARG(INPLACE_MULTIPLY)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_InPlaceMultiply(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case INPLACE_DIVIDE:
925e6b
+        TARGET_NOARG(INPLACE_DIVIDE)
925e6b
+        {
925e6b
             if (!_Py_QnewFlag) {
925e6b
                 w = POP();
925e6b
                 v = TOP();
925e6b
@@ -1569,42 +1732,50 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 Py_DECREF(v);
925e6b
                 Py_DECREF(w);
925e6b
                 SET_TOP(x);
925e6b
-                if (x != NULL) continue;
925e6b
+                if (x != NULL) DISPATCH();
925e6b
                 break;
925e6b
             }
925e6b
+        }
925e6b
             /* -Qnew is in effect:  fall through to
925e6b
                INPLACE_TRUE_DIVIDE */
925e6b
-        case INPLACE_TRUE_DIVIDE:
925e6b
+        TARGET_NOARG(INPLACE_TRUE_DIVIDE)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_InPlaceTrueDivide(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case INPLACE_FLOOR_DIVIDE:
925e6b
+        TARGET_NOARG(INPLACE_FLOOR_DIVIDE)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_InPlaceFloorDivide(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case INPLACE_MODULO:
925e6b
+        TARGET_NOARG(INPLACE_MODULO)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_InPlaceRemainder(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case INPLACE_ADD:
925e6b
+        TARGET_NOARG(INPLACE_ADD)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             if (PyInt_CheckExact(v) && PyInt_CheckExact(w)) {
925e6b
@@ -1631,10 +1802,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
           skip_decref_v:
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case INPLACE_SUBTRACT:
925e6b
+        TARGET_NOARG(INPLACE_SUBTRACT)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             if (PyInt_CheckExact(v) && PyInt_CheckExact(w)) {
925e6b
@@ -1654,63 +1827,78 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case INPLACE_LSHIFT:
925e6b
+        TARGET_NOARG(INPLACE_LSHIFT)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_InPlaceLshift(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case INPLACE_RSHIFT:
925e6b
+        TARGET_NOARG(INPLACE_RSHIFT)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_InPlaceRshift(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case INPLACE_AND:
925e6b
+        TARGET_NOARG(INPLACE_AND)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_InPlaceAnd(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case INPLACE_XOR:
925e6b
+        TARGET_NOARG(INPLACE_XOR)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_InPlaceXor(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case INPLACE_OR:
925e6b
+        TARGET_NOARG(INPLACE_OR)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             x = PyNumber_InPlaceOr(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
+
925e6b
 
925e6b
-        case SLICE+0:
925e6b
-        case SLICE+1:
925e6b
-        case SLICE+2:
925e6b
-        case SLICE+3:
925e6b
+
925e6b
+        TARGET_WITH_IMPL_NOARG(SLICE, _slice)
925e6b
+        TARGET_WITH_IMPL_NOARG(SLICE_1, _slice)
925e6b
+        TARGET_WITH_IMPL_NOARG(SLICE_2, _slice)
925e6b
+        TARGET_WITH_IMPL_NOARG(SLICE_3, _slice)
925e6b
+        _slice:
925e6b
+        {
925e6b
             if ((opcode-SLICE) & 2)
925e6b
                 w = POP();
925e6b
             else
925e6b
@@ -1725,13 +1913,17 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_XDECREF(v);
925e6b
             Py_XDECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+               }
925e6b
+
925e6b
 
925e6b
-        case STORE_SLICE+0:
925e6b
-        case STORE_SLICE+1:
925e6b
-        case STORE_SLICE+2:
925e6b
-        case STORE_SLICE+3:
925e6b
+        TARGET_WITH_IMPL_NOARG(STORE_SLICE, _store_slice)
925e6b
+        TARGET_WITH_IMPL_NOARG(STORE_SLICE_1, _store_slice)
925e6b
+        TARGET_WITH_IMPL_NOARG(STORE_SLICE_2, _store_slice)
925e6b
+        TARGET_WITH_IMPL_NOARG(STORE_SLICE_3, _store_slice)
925e6b
+        _store_slice:
925e6b
+        {
925e6b
             if ((opcode-STORE_SLICE) & 2)
925e6b
                 w = POP();
925e6b
             else
925e6b
@@ -1747,13 +1939,17 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(u);
925e6b
             Py_XDECREF(v);
925e6b
             Py_XDECREF(w);
925e6b
-            if (err == 0) continue;
925e6b
+            if (err == 0) DISPATCH();
925e6b
             break;
925e6b
+               }
925e6b
+
925e6b
 
925e6b
-        case DELETE_SLICE+0:
925e6b
-        case DELETE_SLICE+1:
925e6b
-        case DELETE_SLICE+2:
925e6b
-        case DELETE_SLICE+3:
925e6b
+        TARGET_WITH_IMPL_NOARG(DELETE_SLICE, _delete_slice)
925e6b
+        TARGET_WITH_IMPL_NOARG(DELETE_SLICE_1, _delete_slice)
925e6b
+        TARGET_WITH_IMPL_NOARG(DELETE_SLICE_2, _delete_slice)
925e6b
+        TARGET_WITH_IMPL_NOARG(DELETE_SLICE_3, _delete_slice)
925e6b
+        _delete_slice:
925e6b
+        {
925e6b
             if ((opcode-DELETE_SLICE) & 2)
925e6b
                 w = POP();
925e6b
             else
925e6b
@@ -1768,10 +1964,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(u);
925e6b
             Py_XDECREF(v);
925e6b
             Py_XDECREF(w);
925e6b
-            if (err == 0) continue;
925e6b
+            if (err == 0) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case STORE_SUBSCR:
925e6b
+        TARGET_NOARG(STORE_SUBSCR)
925e6b
+        {
925e6b
             w = TOP();
925e6b
             v = SECOND();
925e6b
             u = THIRD();
925e6b
@@ -1781,10 +1979,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(u);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
-            if (err == 0) continue;
925e6b
+            if (err == 0) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case DELETE_SUBSCR:
925e6b
+        TARGET_NOARG(DELETE_SUBSCR)
925e6b
+        {
925e6b
             w = TOP();
925e6b
             v = SECOND();
925e6b
             STACKADJ(-2);
925e6b
@@ -1792,10 +1992,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             err = PyObject_DelItem(v, w);
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
-            if (err == 0) continue;
925e6b
+            if (err == 0) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case PRINT_EXPR:
925e6b
+        TARGET_NOARG(PRINT_EXPR)
925e6b
+        {
925e6b
             v = POP();
925e6b
             w = PySys_GetObject("displayhook");
925e6b
             if (w == NULL) {
925e6b
@@ -1818,12 +2020,16 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(v);
925e6b
             Py_XDECREF(x);
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case PRINT_ITEM_TO:
925e6b
+        TARGET_NOARG(PRINT_ITEM_TO)
925e6b
+        {
925e6b
             w = stream = POP();
925e6b
             /* fall through to PRINT_ITEM */
925e6b
+        }
925e6b
 
925e6b
-        case PRINT_ITEM:
925e6b
+        TARGET_NOARG(PRINT_ITEM)
925e6b
+        {
925e6b
             v = POP();
925e6b
             if (stream == NULL || stream == Py_None) {
925e6b
                 w = PySys_GetObject("stdout");
925e6b
@@ -1869,16 +2075,20 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(v);
925e6b
             Py_XDECREF(stream);
925e6b
             stream = NULL;
925e6b
-            if (err == 0)
925e6b
-                continue;
925e6b
+            if (err == 0) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case PRINT_NEWLINE_TO:
925e6b
+        TARGET_NOARG(PRINT_NEWLINE_TO)
925e6b
+        {
925e6b
             w = stream = POP();
925e6b
             /* fall through to PRINT_NEWLINE */
925e6b
+        }
925e6b
 
925e6b
-        case PRINT_NEWLINE:
925e6b
-            if (stream == NULL || stream == Py_None) {
925e6b
+        TARGET_NOARG(PRINT_NEWLINE)
925e6b
+        {
925e6b
+            if (stream == NULL || stream == Py_None)
925e6b
+            {
925e6b
                 w = PySys_GetObject("stdout");
925e6b
                 if (w == NULL) {
925e6b
                     PyErr_SetString(PyExc_RuntimeError,
925e6b
@@ -1899,11 +2109,13 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             stream = NULL;
925e6b
             break;
925e6b
 
925e6b
-
925e6b
+        }
925e6b
 #ifdef CASE_TOO_BIG
925e6b
         default: switch (opcode) {
925e6b
 #endif
925e6b
-        case RAISE_VARARGS:
925e6b
+
925e6b
+        TARGET(RAISE_VARARGS)
925e6b
+        {
925e6b
             u = v = w = NULL;
925e6b
             switch (oparg) {
925e6b
             case 3:
925e6b
@@ -1924,28 +2136,37 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 break;
925e6b
             }
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case LOAD_LOCALS:
925e6b
-            if ((x = f->f_locals) != NULL) {
925e6b
+        TARGET_NOARG(LOAD_LOCALS)
925e6b
+        {
925e6b
+            if ((x = f->f_locals) != NULL)
925e6b
+            {
925e6b
                 Py_INCREF(x);
925e6b
                 PUSH(x);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             PyErr_SetString(PyExc_SystemError, "no locals");
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case RETURN_VALUE:
925e6b
+        TARGET_NOARG(RETURN_VALUE)
925e6b
+        {
925e6b
             retval = POP();
925e6b
             why = WHY_RETURN;
925e6b
             goto fast_block_end;
925e6b
+        }
925e6b
 
925e6b
-        case YIELD_VALUE:
925e6b
+        TARGET_NOARG(YIELD_VALUE)
925e6b
+        {
925e6b
             retval = POP();
925e6b
             f->f_stacktop = stack_pointer;
925e6b
             why = WHY_YIELD;
925e6b
             goto fast_yield;
925e6b
+        }
925e6b
 
925e6b
-        case EXEC_STMT:
925e6b
+        TARGET_NOARG(EXEC_STMT)
925e6b
+        {
925e6b
             w = TOP();
925e6b
             v = SECOND();
925e6b
             u = THIRD();
925e6b
@@ -1957,8 +2178,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case POP_BLOCK:
925e6b
+        TARGET_NOARG(POP_BLOCK)
925e6b
+        {
925e6b
             {
925e6b
                 PyTryBlock *b = PyFrame_BlockPop(f);
925e6b
                 while (STACK_LEVEL() > b->b_level) {
925e6b
@@ -1966,10 +2189,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                     Py_DECREF(v);
925e6b
                 }
925e6b
             }
925e6b
-            continue;
925e6b
+            DISPATCH();
925e6b
+        }
925e6b
 
925e6b
         PREDICTED(END_FINALLY);
925e6b
-        case END_FINALLY:
925e6b
+        TARGET_NOARG(END_FINALLY)
925e6b
+        {
925e6b
             v = POP();
925e6b
             if (PyInt_Check(v)) {
925e6b
                 why = (enum why_code) PyInt_AS_LONG(v);
925e6b
@@ -1993,8 +2218,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             }
925e6b
             Py_DECREF(v);
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BUILD_CLASS:
925e6b
+        TARGET_NOARG(BUILD_CLASS)
925e6b
+        {
925e6b
             u = TOP();
925e6b
             v = SECOND();
925e6b
             w = THIRD();
925e6b
@@ -2005,8 +2232,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(w);
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case STORE_NAME:
925e6b
+        TARGET(STORE_NAME)
925e6b
+        {
925e6b
             w = GETITEM(names, oparg);
925e6b
             v = POP();
925e6b
             if ((x = f->f_locals) != NULL) {
925e6b
@@ -2015,15 +2244,17 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 else
925e6b
                     err = PyObject_SetItem(x, w, v);
925e6b
                 Py_DECREF(v);
925e6b
-                if (err == 0) continue;
925e6b
+                if (err == 0) DISPATCH();
925e6b
                 break;
925e6b
             }
925e6b
             PyErr_Format(PyExc_SystemError,
925e6b
                          "no locals found when storing %s",
925e6b
                          PyObject_REPR(w));
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case DELETE_NAME:
925e6b
+        TARGET(DELETE_NAME)
925e6b
+        {
925e6b
             w = GETITEM(names, oparg);
925e6b
             if ((x = f->f_locals) != NULL) {
925e6b
                 if ((err = PyObject_DelItem(x, w)) != 0)
925e6b
@@ -2036,9 +2267,11 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                          "no locals when deleting %s",
925e6b
                          PyObject_REPR(w));
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
         PREDICTED_WITH_ARG(UNPACK_SEQUENCE);
925e6b
-        case UNPACK_SEQUENCE:
925e6b
+        TARGET(UNPACK_SEQUENCE)
925e6b
+        {
925e6b
             v = POP();
925e6b
             if (PyTuple_CheckExact(v) &&
925e6b
                 PyTuple_GET_SIZE(v) == oparg) {
925e6b
@@ -2050,7 +2283,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                     PUSH(w);
925e6b
                 }
925e6b
                 Py_DECREF(v);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             } else if (PyList_CheckExact(v) &&
925e6b
                        PyList_GET_SIZE(v) == oparg) {
925e6b
                 PyObject **items = \
925e6b
@@ -2069,8 +2302,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             }
925e6b
             Py_DECREF(v);
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case STORE_ATTR:
925e6b
+        TARGET(STORE_ATTR)
925e6b
+        {
925e6b
             w = GETITEM(names, oparg);
925e6b
             v = TOP();
925e6b
             u = SECOND();
925e6b
@@ -2078,33 +2313,41 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             err = PyObject_SetAttr(v, w, u); /* v.w = u */
925e6b
             Py_DECREF(v);
925e6b
             Py_DECREF(u);
925e6b
-            if (err == 0) continue;
925e6b
+            if (err == 0) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case DELETE_ATTR:
925e6b
+        TARGET(DELETE_ATTR)
925e6b
+        {
925e6b
             w = GETITEM(names, oparg);
925e6b
             v = POP();
925e6b
             err = PyObject_SetAttr(v, w, (PyObject *)NULL);
925e6b
                                             /* del v.w */
925e6b
             Py_DECREF(v);
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case STORE_GLOBAL:
925e6b
+        TARGET(STORE_GLOBAL)
925e6b
+        {
925e6b
             w = GETITEM(names, oparg);
925e6b
             v = POP();
925e6b
             err = PyDict_SetItem(f->f_globals, w, v);
925e6b
             Py_DECREF(v);
925e6b
-            if (err == 0) continue;
925e6b
+            if (err == 0) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case DELETE_GLOBAL:
925e6b
+        TARGET(DELETE_GLOBAL)
925e6b
+        {
925e6b
             w = GETITEM(names, oparg);
925e6b
             if ((err = PyDict_DelItem(f->f_globals, w)) != 0)
925e6b
                 format_exc_check_arg(
925e6b
                     PyExc_NameError, GLOBAL_NAME_ERROR_MSG, w);
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case LOAD_NAME:
925e6b
+        TARGET(LOAD_NAME)
925e6b
+        {
925e6b
             w = GETITEM(names, oparg);
925e6b
             if ((v = f->f_locals) == NULL) {
925e6b
                 PyErr_Format(PyExc_SystemError,
925e6b
@@ -2140,9 +2383,11 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 Py_INCREF(x);
925e6b
             }
925e6b
             PUSH(x);
925e6b
-            continue;
925e6b
+            DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case LOAD_GLOBAL:
925e6b
+        TARGET(LOAD_GLOBAL)
925e6b
+        {
925e6b
             w = GETITEM(names, oparg);
925e6b
             if (PyString_CheckExact(w)) {
925e6b
                 /* Inline the PyDict_GetItem() calls.
925e6b
@@ -2162,7 +2407,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                     if (x != NULL) {
925e6b
                         Py_INCREF(x);
925e6b
                         PUSH(x);
925e6b
-                        continue;
925e6b
+                        DISPATCH();
925e6b
                     }
925e6b
                     d = (PyDictObject *)(f->f_builtins);
925e6b
                     e = d->ma_lookup(d, w, hash);
925e6b
@@ -2174,7 +2419,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                     if (x != NULL) {
925e6b
                         Py_INCREF(x);
925e6b
                         PUSH(x);
925e6b
-                        continue;
925e6b
+                        DISPATCH();
925e6b
                     }
925e6b
                     goto load_global_error;
925e6b
                 }
925e6b
@@ -2193,13 +2438,15 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             }
925e6b
             Py_INCREF(x);
925e6b
             PUSH(x);
925e6b
-            continue;
925e6b
+            DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case DELETE_FAST:
925e6b
+        TARGET(DELETE_FAST)
925e6b
+        {
925e6b
             x = GETLOCAL(oparg);
925e6b
             if (x != NULL) {
925e6b
                 SETLOCAL(oparg, NULL);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             format_exc_check_arg(
925e6b
                 PyExc_UnboundLocalError,
925e6b
@@ -2207,20 +2454,24 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 PyTuple_GetItem(co->co_varnames, oparg)
925e6b
                 );
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case LOAD_CLOSURE:
925e6b
+        TARGET(LOAD_CLOSURE)
925e6b
+        {
925e6b
             x = freevars[oparg];
925e6b
             Py_INCREF(x);
925e6b
             PUSH(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case LOAD_DEREF:
925e6b
+        TARGET(LOAD_DEREF)
925e6b
+        {
925e6b
             x = freevars[oparg];
925e6b
             w = PyCell_Get(x);
925e6b
             if (w != NULL) {
925e6b
                 PUSH(w);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             err = -1;
925e6b
             /* Don't stomp existing exception */
925e6b
@@ -2240,15 +2491,19 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                                      UNBOUNDFREE_ERROR_MSG, v);
925e6b
             }
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case STORE_DEREF:
925e6b
+        TARGET(STORE_DEREF)
925e6b
+        {
925e6b
             w = POP();
925e6b
             x = freevars[oparg];
925e6b
             PyCell_Set(x, w);
925e6b
             Py_DECREF(w);
925e6b
-            continue;
925e6b
+            DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case BUILD_TUPLE:
925e6b
+        TARGET(BUILD_TUPLE)
925e6b
+        {
925e6b
             x = PyTuple_New(oparg);
925e6b
             if (x != NULL) {
925e6b
                 for (; --oparg >= 0;) {
925e6b
@@ -2256,11 +2511,13 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                     PyTuple_SET_ITEM(x, oparg, w);
925e6b
                 }
925e6b
                 PUSH(x);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BUILD_LIST:
925e6b
+        TARGET(BUILD_LIST)
925e6b
+        {
925e6b
             x =  PyList_New(oparg);
925e6b
             if (x != NULL) {
925e6b
                 for (; --oparg >= 0;) {
925e6b
@@ -2268,11 +2525,13 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                     PyList_SET_ITEM(x, oparg, w);
925e6b
                 }
925e6b
                 PUSH(x);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case BUILD_SET:
925e6b
+        TARGET(BUILD_SET)
925e6b
+        {
925e6b
             x = PySet_New(NULL);
925e6b
             if (x != NULL) {
925e6b
                 for (; --oparg >= 0;) {
925e6b
@@ -2286,18 +2545,21 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                     break;
925e6b
                 }
925e6b
                 PUSH(x);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-
925e6b
-        case BUILD_MAP:
925e6b
+        TARGET(BUILD_MAP)
925e6b
+        {
925e6b
             x = _PyDict_NewPresized((Py_ssize_t)oparg);
925e6b
             PUSH(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case STORE_MAP:
925e6b
+        TARGET_NOARG(STORE_MAP)
925e6b
+        {
925e6b
             w = TOP();     /* key */
925e6b
             u = SECOND();  /* value */
925e6b
             v = THIRD();   /* dict */
925e6b
@@ -2306,10 +2568,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             err = PyDict_SetItem(v, w, u);  /* v[w] = u */
925e6b
             Py_DECREF(u);
925e6b
             Py_DECREF(w);
925e6b
-            if (err == 0) continue;
925e6b
+            if (err == 0) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case MAP_ADD:
925e6b
+        TARGET(MAP_ADD)
925e6b
+        {
925e6b
             w = TOP();     /* key */
925e6b
             u = SECOND();  /* value */
925e6b
             STACKADJ(-2);
925e6b
@@ -2320,20 +2584,24 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(w);
925e6b
             if (err == 0) {
925e6b
                 PREDICT(JUMP_ABSOLUTE);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case LOAD_ATTR:
925e6b
+        TARGET(LOAD_ATTR)
925e6b
+        {
925e6b
             w = GETITEM(names, oparg);
925e6b
             v = TOP();
925e6b
             x = PyObject_GetAttr(v, w);
925e6b
             Py_DECREF(v);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case COMPARE_OP:
925e6b
+        TARGET(COMPARE_OP)
925e6b
+        {
925e6b
             w = POP();
925e6b
             v = TOP();
925e6b
             if (PyInt_CheckExact(w) && PyInt_CheckExact(v)) {
925e6b
@@ -2366,9 +2634,11 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             if (x == NULL) break;
925e6b
             PREDICT(POP_JUMP_IF_FALSE);
925e6b
             PREDICT(POP_JUMP_IF_TRUE);
925e6b
-            continue;
925e6b
+            DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case IMPORT_NAME:
925e6b
+        TARGET(IMPORT_NAME)
925e6b
+        {
925e6b
             w = GETITEM(names, oparg);
925e6b
             x = PyDict_GetItemString(f->f_builtins, "__import__");
925e6b
             if (x == NULL) {
925e6b
@@ -2409,10 +2679,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             READ_TIMESTAMP(intr1);
925e6b
             Py_DECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case IMPORT_STAR:
925e6b
+        TARGET_NOARG(IMPORT_STAR)
925e6b
+        {
925e6b
             v = POP();
925e6b
             PyFrame_FastToLocals(f);
925e6b
             if ((x = f->f_locals) == NULL) {
925e6b
@@ -2425,34 +2697,40 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             READ_TIMESTAMP(intr1);
925e6b
             PyFrame_LocalsToFast(f, 0);
925e6b
             Py_DECREF(v);
925e6b
-            if (err == 0) continue;
925e6b
+            if (err == 0) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case IMPORT_FROM:
925e6b
+        TARGET(IMPORT_FROM)
925e6b
+        {
925e6b
             w = GETITEM(names, oparg);
925e6b
             v = TOP();
925e6b
             READ_TIMESTAMP(intr0);
925e6b
             x = import_from(v, w);
925e6b
             READ_TIMESTAMP(intr1);
925e6b
             PUSH(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case JUMP_FORWARD:
925e6b
+        TARGET(JUMP_FORWARD)
925e6b
+        {
925e6b
             JUMPBY(oparg);
925e6b
-            goto fast_next_opcode;
925e6b
+            FAST_DISPATCH();
925e6b
+        }
925e6b
 
925e6b
         PREDICTED_WITH_ARG(POP_JUMP_IF_FALSE);
925e6b
-        case POP_JUMP_IF_FALSE:
925e6b
+        TARGET(POP_JUMP_IF_FALSE)
925e6b
+        {
925e6b
             w = POP();
925e6b
             if (w == Py_True) {
925e6b
                 Py_DECREF(w);
925e6b
-                goto fast_next_opcode;
925e6b
+                FAST_DISPATCH();
925e6b
             }
925e6b
             if (w == Py_False) {
925e6b
                 Py_DECREF(w);
925e6b
                 JUMPTO(oparg);
925e6b
-                goto fast_next_opcode;
925e6b
+                FAST_DISPATCH();
925e6b
             }
925e6b
             err = PyObject_IsTrue(w);
925e6b
             Py_DECREF(w);
925e6b
@@ -2462,19 +2740,20 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 JUMPTO(oparg);
925e6b
             else
925e6b
                 break;
925e6b
-            continue;
925e6b
-
925e6b
+            DISPATCH();
925e6b
+        }
925e6b
         PREDICTED_WITH_ARG(POP_JUMP_IF_TRUE);
925e6b
-        case POP_JUMP_IF_TRUE:
925e6b
+        TARGET(POP_JUMP_IF_TRUE)
925e6b
+        {
925e6b
             w = POP();
925e6b
             if (w == Py_False) {
925e6b
                 Py_DECREF(w);
925e6b
-                goto fast_next_opcode;
925e6b
+                FAST_DISPATCH();
925e6b
             }
925e6b
             if (w == Py_True) {
925e6b
                 Py_DECREF(w);
925e6b
                 JUMPTO(oparg);
925e6b
-                goto fast_next_opcode;
925e6b
+                FAST_DISPATCH();
925e6b
             }
925e6b
             err = PyObject_IsTrue(w);
925e6b
             Py_DECREF(w);
925e6b
@@ -2486,18 +2765,20 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 ;
925e6b
             else
925e6b
                 break;
925e6b
-            continue;
925e6b
+            DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case JUMP_IF_FALSE_OR_POP:
925e6b
+        TARGET(JUMP_IF_FALSE_OR_POP)
925e6b
+        {
925e6b
             w = TOP();
925e6b
             if (w == Py_True) {
925e6b
                 STACKADJ(-1);
925e6b
                 Py_DECREF(w);
925e6b
-                goto fast_next_opcode;
925e6b
+                FAST_DISPATCH();
925e6b
             }
925e6b
             if (w == Py_False) {
925e6b
                 JUMPTO(oparg);
925e6b
-                goto fast_next_opcode;
925e6b
+                FAST_DISPATCH();
925e6b
             }
925e6b
             err = PyObject_IsTrue(w);
925e6b
             if (err > 0) {
925e6b
@@ -2509,18 +2790,20 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 JUMPTO(oparg);
925e6b
             else
925e6b
                 break;
925e6b
-            continue;
925e6b
+            DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case JUMP_IF_TRUE_OR_POP:
925e6b
+        TARGET(JUMP_IF_TRUE_OR_POP)
925e6b
+        {
925e6b
             w = TOP();
925e6b
             if (w == Py_False) {
925e6b
                 STACKADJ(-1);
925e6b
                 Py_DECREF(w);
925e6b
-                goto fast_next_opcode;
925e6b
+                FAST_DISPATCH();
925e6b
             }
925e6b
             if (w == Py_True) {
925e6b
                 JUMPTO(oparg);
925e6b
-                goto fast_next_opcode;
925e6b
+                FAST_DISPATCH();
925e6b
             }
925e6b
             err = PyObject_IsTrue(w);
925e6b
             if (err > 0) {
925e6b
@@ -2533,10 +2816,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             }
925e6b
             else
925e6b
                 break;
925e6b
-            continue;
925e6b
+            DISPATCH();
925e6b
+        }
925e6b
 
925e6b
         PREDICTED_WITH_ARG(JUMP_ABSOLUTE);
925e6b
-        case JUMP_ABSOLUTE:
925e6b
+        TARGET(JUMP_ABSOLUTE)
925e6b
+        {
925e6b
             JUMPTO(oparg);
925e6b
 #if FAST_LOOPS
925e6b
             /* Enabling this path speeds-up all while and for-loops by bypassing
925e6b
@@ -2548,10 +2833,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             */
925e6b
             goto fast_next_opcode;
925e6b
 #else
925e6b
-            continue;
925e6b
+            DISPATCH();
925e6b
 #endif
925e6b
+        }
925e6b
 
925e6b
-        case GET_ITER:
925e6b
+        TARGET_NOARG(GET_ITER)
925e6b
+        {
925e6b
             /* before: [obj]; after [getiter(obj)] */
925e6b
             v = TOP();
925e6b
             x = PyObject_GetIter(v);
925e6b
@@ -2559,13 +2846,15 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             if (x != NULL) {
925e6b
                 SET_TOP(x);
925e6b
                 PREDICT(FOR_ITER);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             STACKADJ(-1);
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
         PREDICTED_WITH_ARG(FOR_ITER);
925e6b
-        case FOR_ITER:
925e6b
+        TARGET(FOR_ITER)
925e6b
+        {
925e6b
             /* before: [iter]; after: [iter, iter()] *or* [] */
925e6b
             v = TOP();
925e6b
             x = (*v->ob_type->tp_iternext)(v);
925e6b
@@ -2573,7 +2862,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 PUSH(x);
925e6b
                 PREDICT(STORE_FAST);
925e6b
                 PREDICT(UNPACK_SEQUENCE);
925e6b
-                continue;
925e6b
+                DISPATCH();
925e6b
             }
925e6b
             if (PyErr_Occurred()) {
925e6b
                 if (!PyErr_ExceptionMatches(
925e6b
@@ -2585,13 +2874,17 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             x = v = POP();
925e6b
             Py_DECREF(v);
925e6b
             JUMPBY(oparg);
925e6b
-            continue;
925e6b
+            DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case BREAK_LOOP:
925e6b
+        TARGET_NOARG(BREAK_LOOP)
925e6b
+        {
925e6b
             why = WHY_BREAK;
925e6b
             goto fast_block_end;
925e6b
+        }
925e6b
 
925e6b
-        case CONTINUE_LOOP:
925e6b
+        TARGET(CONTINUE_LOOP)
925e6b
+        {
925e6b
             retval = PyInt_FromLong(oparg);
925e6b
             if (!retval) {
925e6b
                 x = NULL;
925e6b
@@ -2599,10 +2892,13 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             }
925e6b
             why = WHY_CONTINUE;
925e6b
             goto fast_block_end;
925e6b
+        }
925e6b
 
925e6b
-        case SETUP_LOOP:
925e6b
-        case SETUP_EXCEPT:
925e6b
-        case SETUP_FINALLY:
925e6b
+        TARGET_WITH_IMPL(SETUP_LOOP, _setup_finally)
925e6b
+        TARGET_WITH_IMPL(SETUP_EXCEPT, _setup_finally)
925e6b
+        TARGET(SETUP_FINALLY)
925e6b
+        _setup_finally:
925e6b
+        {
925e6b
             /* NOTE: If you add any new block-setup opcodes that
925e6b
                are not try/except/finally handlers, you may need
925e6b
                to update the PyGen_NeedsFinalizing() function.
925e6b
@@ -2610,9 +2906,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
 
925e6b
             PyFrame_BlockSetup(f, opcode, INSTR_OFFSET() + oparg,
925e6b
                                STACK_LEVEL());
925e6b
-            continue;
925e6b
+            DISPATCH();
925e6b
+        }
925e6b
 
925e6b
-        case SETUP_WITH:
925e6b
+
925e6b
+        TARGET(SETUP_WITH)
925e6b
+        {
925e6b
         {
925e6b
             static PyObject *exit, *enter;
925e6b
             w = TOP();
925e6b
@@ -2638,10 +2937,11 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                                STACK_LEVEL());
925e6b
 
925e6b
             PUSH(x);
925e6b
-            continue;
925e6b
+            DISPATCH();
925e6b
+          }
925e6b
         }
925e6b
 
925e6b
-        case WITH_CLEANUP:
925e6b
+        TARGET_NOARG(WITH_CLEANUP)
925e6b
         {
925e6b
             /* At the top of the stack are 1-3 values indicating
925e6b
                how/why we entered the finally clause:
925e6b
@@ -2729,7 +3029,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             break;
925e6b
         }
925e6b
 
925e6b
-        case CALL_FUNCTION:
925e6b
+        TARGET(CALL_FUNCTION)
925e6b
         {
925e6b
             PyObject **sp;
925e6b
             PCALL(PCALL_ALL);
925e6b
@@ -2741,14 +3041,14 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
 #endif
925e6b
             stack_pointer = sp;
925e6b
             PUSH(x);
925e6b
-            if (x != NULL)
925e6b
-                continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
         }
925e6b
 
925e6b
-        case CALL_FUNCTION_VAR:
925e6b
-        case CALL_FUNCTION_KW:
925e6b
-        case CALL_FUNCTION_VAR_KW:
925e6b
+        TARGET_WITH_IMPL(CALL_FUNCTION_VAR, _call_function_var_kw)
925e6b
+        TARGET_WITH_IMPL(CALL_FUNCTION_KW, _call_function_var_kw)
925e6b
+        TARGET(CALL_FUNCTION_VAR_KW)
925e6b
+        _call_function_var_kw:
925e6b
         {
925e6b
             int na = oparg & 0xff;
925e6b
             int nk = (oparg>>8) & 0xff;
925e6b
@@ -2786,12 +3086,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
                 Py_DECREF(w);
925e6b
             }
925e6b
             PUSH(x);
925e6b
-            if (x != NULL)
925e6b
-                continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
         }
925e6b
 
925e6b
-        case MAKE_FUNCTION:
925e6b
+        TARGET(MAKE_FUNCTION)
925e6b
+        {
925e6b
             v = POP(); /* code object */
925e6b
             x = PyFunction_New(v, f->f_globals);
925e6b
             Py_DECREF(v);
925e6b
@@ -2812,8 +3112,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             }
925e6b
             PUSH(x);
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case MAKE_CLOSURE:
925e6b
+        TARGET(MAKE_CLOSURE)
925e6b
         {
925e6b
             v = POP(); /* code object */
925e6b
             x = PyFunction_New(v, f->f_globals);
925e6b
@@ -2848,7 +3149,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             break;
925e6b
         }
925e6b
 
925e6b
-        case BUILD_SLICE:
925e6b
+        TARGET(BUILD_SLICE)
925e6b
+        {
925e6b
             if (oparg == 3)
925e6b
                 w = POP();
925e6b
             else
925e6b
@@ -2860,14 +3162,22 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
925e6b
             Py_DECREF(v);
925e6b
             Py_XDECREF(w);
925e6b
             SET_TOP(x);
925e6b
-            if (x != NULL) continue;
925e6b
+            if (x != NULL) DISPATCH();
925e6b
             break;
925e6b
+        }
925e6b
 
925e6b
-        case EXTENDED_ARG:
925e6b
+        TARGET(EXTENDED_ARG)
925e6b
+        {
925e6b
             opcode = NEXTOP();
925e6b
             oparg = oparg<<16 | NEXTARG();
925e6b
             goto dispatch_opcode;
925e6b
 
925e6b
+        }
925e6b
+
925e6b
+
925e6b
+#if USE_COMPUTED_GOTOS
925e6b
+        _unknown_opcode:
925e6b
+#endif
925e6b
         default:
925e6b
             fprintf(stderr,
925e6b
                 "XXX lineno: %d, opcode: %d\n",
925e6b
diff --git a/Python/makeopcodetargets.py b/Python/makeopcodetargets.py
925e6b
index e69de29..703e5f2 100644
925e6b
--- a/Python/makeopcodetargets.py
925e6b
+++ b/Python/makeopcodetargets.py
925e6b
@@ -0,0 +1,45 @@
925e6b
+#! /usr/bin/env python
925e6b
+"""Generate C code for the jump table of the threaded code interpreter
925e6b
+(for compilers supporting computed gotos or "labels-as-values", such as gcc).
925e6b
+"""
925e6b
+
925e6b
+# This code should stay compatible with Python 2.3, at least while
925e6b
+# some of the buildbots have Python 2.3 as their system Python.
925e6b
+
925e6b
+import imp
925e6b
+import os
925e6b
+
925e6b
+
925e6b
+def find_module(modname):
925e6b
+    """Finds and returns a module in the local dist/checkout.
925e6b
+    """
925e6b
+    modpath = os.path.join(
925e6b
+        os.path.dirname(os.path.dirname(__file__)), "Lib")
925e6b
+    return imp.load_module(modname, *imp.find_module(modname, [modpath]))
925e6b
+
925e6b
+def write_contents(f):
925e6b
+    """Write C code contents to the target file object.
925e6b
+    """
925e6b
+    opcode = find_module("opcode")
925e6b
+    targets = ['_unknown_opcode'] * 256
925e6b
+    for opname, op in opcode.opmap.items():
925e6b
+        if opname == "STOP_CODE":
925e6b
+            continue
925e6b
+        targets[op] = "TARGET_%s" % opname.replace("+0", " ").replace("+", "_")
925e6b
+    f.write("static void *opcode_targets[256] = {\n")
925e6b
+    f.write(",\n".join(["    &&%s" % s for s in targets]))
925e6b
+    f.write("\n};\n")
925e6b
+
925e6b
+
925e6b
+if __name__ == "__main__":
925e6b
+    import sys
925e6b
+    assert len(sys.argv) < 3, "Too many arguments"
925e6b
+    if len(sys.argv) == 2:
925e6b
+        target = sys.argv[1]
925e6b
+    else:
925e6b
+        target = "Python/opcode_targets.h"
925e6b
+    f = open(target, "w")
925e6b
+    try:
925e6b
+        write_contents(f)
925e6b
+    finally:
925e6b
+        f.close()
925e6b
\ No newline at end of file
925e6b
diff --git a/Python/opcode_targets.h b/Python/opcode_targets.h
925e6b
index e69de29..2203566 100644
925e6b
--- a/Python/opcode_targets.h
925e6b
+++ b/Python/opcode_targets.h
925e6b
@@ -0,0 +1,258 @@
925e6b
+static void *opcode_targets[256] = {
925e6b
+    &&_unknown_opcode,
925e6b
+    &&TARGET_POP_TOP,
925e6b
+    &&TARGET_ROT_TWO,
925e6b
+    &&TARGET_ROT_THREE,
925e6b
+    &&TARGET_DUP_TOP,
925e6b
+    &&TARGET_ROT_FOUR,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&TARGET_NOP,
925e6b
+    &&TARGET_UNARY_POSITIVE,
925e6b
+    &&TARGET_UNARY_NEGATIVE,
925e6b
+    &&TARGET_UNARY_NOT,
925e6b
+    &&TARGET_UNARY_CONVERT,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&TARGET_UNARY_INVERT,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&TARGET_BINARY_POWER,
925e6b
+    &&TARGET_BINARY_MULTIPLY,
925e6b
+    &&TARGET_BINARY_DIVIDE,
925e6b
+    &&TARGET_BINARY_MODULO,
925e6b
+    &&TARGET_BINARY_ADD,
925e6b
+    &&TARGET_BINARY_SUBTRACT,
925e6b
+    &&TARGET_BINARY_SUBSCR,
925e6b
+    &&TARGET_BINARY_FLOOR_DIVIDE,
925e6b
+    &&TARGET_BINARY_TRUE_DIVIDE,
925e6b
+    &&TARGET_INPLACE_FLOOR_DIVIDE,
925e6b
+    &&TARGET_INPLACE_TRUE_DIVIDE,
925e6b
+    &&TARGET_SLICE ,
925e6b
+    &&TARGET_SLICE_1,
925e6b
+    &&TARGET_SLICE_2,
925e6b
+    &&TARGET_SLICE_3,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&TARGET_STORE_SLICE ,
925e6b
+    &&TARGET_STORE_SLICE_1,
925e6b
+    &&TARGET_STORE_SLICE_2,
925e6b
+    &&TARGET_STORE_SLICE_3,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&TARGET_DELETE_SLICE ,
925e6b
+    &&TARGET_DELETE_SLICE_1,
925e6b
+    &&TARGET_DELETE_SLICE_2,
925e6b
+    &&TARGET_DELETE_SLICE_3,
925e6b
+    &&TARGET_STORE_MAP,
925e6b
+    &&TARGET_INPLACE_ADD,
925e6b
+    &&TARGET_INPLACE_SUBTRACT,
925e6b
+    &&TARGET_INPLACE_MULTIPLY,
925e6b
+    &&TARGET_INPLACE_DIVIDE,
925e6b
+    &&TARGET_INPLACE_MODULO,
925e6b
+    &&TARGET_STORE_SUBSCR,
925e6b
+    &&TARGET_DELETE_SUBSCR,
925e6b
+    &&TARGET_BINARY_LSHIFT,
925e6b
+    &&TARGET_BINARY_RSHIFT,
925e6b
+    &&TARGET_BINARY_AND,
925e6b
+    &&TARGET_BINARY_XOR,
925e6b
+    &&TARGET_BINARY_OR,
925e6b
+    &&TARGET_INPLACE_POWER,
925e6b
+    &&TARGET_GET_ITER,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&TARGET_PRINT_EXPR,
925e6b
+    &&TARGET_PRINT_ITEM,
925e6b
+    &&TARGET_PRINT_NEWLINE,
925e6b
+    &&TARGET_PRINT_ITEM_TO,
925e6b
+    &&TARGET_PRINT_NEWLINE_TO,
925e6b
+    &&TARGET_INPLACE_LSHIFT,
925e6b
+    &&TARGET_INPLACE_RSHIFT,
925e6b
+    &&TARGET_INPLACE_AND,
925e6b
+    &&TARGET_INPLACE_XOR,
925e6b
+    &&TARGET_INPLACE_OR,
925e6b
+    &&TARGET_BREAK_LOOP,
925e6b
+    &&TARGET_WITH_CLEANUP,
925e6b
+    &&TARGET_LOAD_LOCALS,
925e6b
+    &&TARGET_RETURN_VALUE,
925e6b
+    &&TARGET_IMPORT_STAR,
925e6b
+    &&TARGET_EXEC_STMT,
925e6b
+    &&TARGET_YIELD_VALUE,
925e6b
+    &&TARGET_POP_BLOCK,
925e6b
+    &&TARGET_END_FINALLY,
925e6b
+    &&TARGET_BUILD_CLASS,
925e6b
+    &&TARGET_STORE_NAME,
925e6b
+    &&TARGET_DELETE_NAME,
925e6b
+    &&TARGET_UNPACK_SEQUENCE,
925e6b
+    &&TARGET_FOR_ITER,
925e6b
+    &&TARGET_LIST_APPEND,
925e6b
+    &&TARGET_STORE_ATTR,
925e6b
+    &&TARGET_DELETE_ATTR,
925e6b
+    &&TARGET_STORE_GLOBAL,
925e6b
+    &&TARGET_DELETE_GLOBAL,
925e6b
+    &&TARGET_DUP_TOPX,
925e6b
+    &&TARGET_LOAD_CONST,
925e6b
+    &&TARGET_LOAD_NAME,
925e6b
+    &&TARGET_BUILD_TUPLE,
925e6b
+    &&TARGET_BUILD_LIST,
925e6b
+    &&TARGET_BUILD_SET,
925e6b
+    &&TARGET_BUILD_MAP,
925e6b
+    &&TARGET_LOAD_ATTR,
925e6b
+    &&TARGET_COMPARE_OP,
925e6b
+    &&TARGET_IMPORT_NAME,
925e6b
+    &&TARGET_IMPORT_FROM,
925e6b
+    &&TARGET_JUMP_FORWARD,
925e6b
+    &&TARGET_JUMP_IF_FALSE_OR_POP,
925e6b
+    &&TARGET_JUMP_IF_TRUE_OR_POP,
925e6b
+    &&TARGET_JUMP_ABSOLUTE,
925e6b
+    &&TARGET_POP_JUMP_IF_FALSE,
925e6b
+    &&TARGET_POP_JUMP_IF_TRUE,
925e6b
+    &&TARGET_LOAD_GLOBAL,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&TARGET_CONTINUE_LOOP,
925e6b
+    &&TARGET_SETUP_LOOP,
925e6b
+    &&TARGET_SETUP_EXCEPT,
925e6b
+    &&TARGET_SETUP_FINALLY,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&TARGET_LOAD_FAST,
925e6b
+    &&TARGET_STORE_FAST,
925e6b
+    &&TARGET_DELETE_FAST,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&TARGET_RAISE_VARARGS,
925e6b
+    &&TARGET_CALL_FUNCTION,
925e6b
+    &&TARGET_MAKE_FUNCTION,
925e6b
+    &&TARGET_BUILD_SLICE,
925e6b
+    &&TARGET_MAKE_CLOSURE,
925e6b
+    &&TARGET_LOAD_CLOSURE,
925e6b
+    &&TARGET_LOAD_DEREF,
925e6b
+    &&TARGET_STORE_DEREF,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&TARGET_CALL_FUNCTION_VAR,
925e6b
+    &&TARGET_CALL_FUNCTION_KW,
925e6b
+    &&TARGET_CALL_FUNCTION_VAR_KW,
925e6b
+    &&TARGET_SETUP_WITH,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&TARGET_EXTENDED_ARG,
925e6b
+    &&TARGET_SET_ADD,
925e6b
+    &&TARGET_MAP_ADD,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode,
925e6b
+    &&_unknown_opcode
925e6b
+};
925e6b
\ No newline at end of file
925e6b
diff --git a/configure b/configure
925e6b
index 6a47e1a..60a3335 100755
925e6b
--- a/configure
925e6b
+++ b/configure
925e6b
@@ -810,6 +810,7 @@ with_libm
925e6b
 with_libc
925e6b
 enable_big_digits
925e6b
 enable_unicode
925e6b
+with_computed_gotos
925e6b
 '
925e6b
       ac_precious_vars='build_alias
925e6b
 host_alias
925e6b
@@ -1488,6 +1489,9 @@ Optional Packages:
925e6b
   --with-fpectl           enable SIGFPE catching
925e6b
   --with-libm=STRING      math library
925e6b
   --with-libc=STRING      C library
925e6b
+  --with(out)-computed-gotos
925e6b
+                          Use computed gotos in evaluation loop (enabled by
925e6b
+                          default on supported compilers)
925e6b
 
925e6b
 Some influential environment variables:
925e6b
   CC          C compiler command
925e6b
@@ -14608,6 +14612,83 @@ for dir in $SRCDIRS; do
925e6b
         mkdir $dir
925e6b
     fi
925e6b
 done
925e6b
+
925e6b
+ BEGIN_COMPUTED_GOTO
925e6b
+# Check for --with-computed-gotos
925e6b
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-computed-gotos" >&5
925e6b
+$as_echo_n "checking for --with-computed-gotos... " >&6; }
925e6b
+
925e6b
+# Check whether --with-computed-gotos was given.
925e6b
+if test "${with_computed_gotos+set}" = set; then :
925e6b
+  withval=$with_computed_gotos;
925e6b
+if test "$withval" = yes
925e6b
+then
925e6b
+
925e6b
+$as_echo "#define USE_COMPUTED_GOTOS 1" >>confdefs.h
925e6b
+
925e6b
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
925e6b
+$as_echo "yes" >&6; }
925e6b
+fi
925e6b
+if test "$withval" = no
925e6b
+then
925e6b
+
925e6b
+$as_echo "#define USE_COMPUTED_GOTOS 0" >>confdefs.h
925e6b
+
925e6b
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
925e6b
+$as_echo "no" >&6; }
925e6b
+fi
925e6b
+
925e6b
+else
925e6b
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no value specified" >&5
925e6b
+$as_echo "no value specified" >&6; }
925e6b
+fi
925e6b
+
925e6b
+
925e6b
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports computed gotos" >&5
925e6b
+$as_echo_n "checking whether $CC supports computed gotos... " >&6; }
925e6b
+if ${ac_cv_computed_gotos+:} false; then :
925e6b
+  $as_echo_n "(cached) " >&6
925e6b
+else
925e6b
+  if test "$cross_compiling" = yes; then :
925e6b
+  if test "${with_computed_gotos+set}" = set; then
925e6b
+   ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos"
925e6b
+ else
925e6b
+   ac_cv_computed_gotos=no
925e6b
+ fi
925e6b
+else
925e6b
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
925e6b
+/* end confdefs.h.  */
925e6b
+int main(int argc, char **argv)
925e6b
+{
925e6b
+    static void *targets[1] = { &&LABEL1 };
925e6b
+    goto LABEL2;
925e6b
+LABEL1:
925e6b
+    return 0;
925e6b
+LABEL2:
925e6b
+    goto *targets[0];
925e6b
+    return 1;
925e6b
+}
925e6b
+_ACEOF
925e6b
+if ac_fn_c_try_run "$LINENO"; then :
925e6b
+  ac_cv_computed_gotos=yes
925e6b
+else
925e6b
+  ac_cv_computed_gotos=no
925e6b
+fi
925e6b
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
925e6b
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
925e6b
+fi
925e6b
+
925e6b
+fi
925e6b
+
925e6b
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_computed_gotos" >&5
925e6b
+$as_echo "$ac_cv_computed_gotos" >&6; }
925e6b
+case "$ac_cv_computed_gotos" in yes*)
925e6b
+
925e6b
+$as_echo "#define HAVE_COMPUTED_GOTOS 1" >>confdefs.h
925e6b
+
925e6b
+esac
925e6b
+# END_COMPUTED_GOTO
925e6b
+
925e6b
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
925e6b
 $as_echo "done" >&6; }
925e6b
 
925e6b
diff --git a/configure.ac b/configure.ac
925e6b
index 48eccdd..74bb514 100644
925e6b
--- a/configure.ac
925e6b
+++ b/configure.ac
925e6b
@@ -4561,6 +4561,57 @@ for dir in $SRCDIRS; do
925e6b
         mkdir $dir
925e6b
     fi
925e6b
 done
925e6b
+
925e6b
+# BEGIN_COMPUTED_GOTO
925e6b
+# Check for --with-computed-gotos
925e6b
+AC_MSG_CHECKING(for --with-computed-gotos)
925e6b
+AC_ARG_WITH(computed-gotos,
925e6b
+            AS_HELP_STRING([--with(out)-computed-gotos],
925e6b
+                           [Use computed gotos in evaluation loop (enabled by default on supported compilers)]),
925e6b
+[
925e6b
+if test "$withval" = yes
925e6b
+then
925e6b
+  AC_DEFINE(USE_COMPUTED_GOTOS, 1,
925e6b
+  [Define if you want to use computed gotos in ceval.c.])
925e6b
+  AC_MSG_RESULT(yes)
925e6b
+fi
925e6b
+if test "$withval" = no
925e6b
+then
925e6b
+  AC_DEFINE(USE_COMPUTED_GOTOS, 0,
925e6b
+  [Define if you want to use computed gotos in ceval.c.])
925e6b
+  AC_MSG_RESULT(no)
925e6b
+fi
925e6b
+],
925e6b
+[AC_MSG_RESULT(no value specified)])
925e6b
+
925e6b
+AC_MSG_CHECKING(whether $CC supports computed gotos)
925e6b
+AC_CACHE_VAL(ac_cv_computed_gotos,
925e6b
+AC_RUN_IFELSE([AC_LANG_SOURCE([[[
925e6b
+int main(int argc, char **argv)
925e6b
+{
925e6b
+    static void *targets[1] = { &&LABEL1 };
925e6b
+    goto LABEL2;
925e6b
+LABEL1:
925e6b
+    return 0;
925e6b
+LABEL2:
925e6b
+    goto *targets[0];
925e6b
+    return 1;
925e6b
+}
925e6b
+]]])],
925e6b
+[ac_cv_computed_gotos=yes],
925e6b
+[ac_cv_computed_gotos=no],
925e6b
+[if test "${with_computed_gotos+set}" = set; then
925e6b
+   ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos"
925e6b
+ else
925e6b
+   ac_cv_computed_gotos=no
925e6b
+ fi]))
925e6b
+AC_MSG_RESULT($ac_cv_computed_gotos)
925e6b
+case "$ac_cv_computed_gotos" in yes*)
925e6b
+  AC_DEFINE(HAVE_COMPUTED_GOTOS, 1,
925e6b
+  [Define if the C compiler supports computed gotos.])
925e6b
+esac
925e6b
+# END_COMPUTED_GOTO
925e6b
+
925e6b
 AC_MSG_RESULT(done)
925e6b
 
925e6b
 # generate output files
925e6b
diff --git a/pyconfig.h.in b/pyconfig.h.in
925e6b
index eace285..ac85729 100644
925e6b
--- a/pyconfig.h.in
925e6b
+++ b/pyconfig.h.in
925e6b
@@ -121,6 +121,9 @@
925e6b
 /* Define to 1 if you have the `clock' function. */
925e6b
 #undef HAVE_CLOCK
925e6b
 
925e6b
+/* Define if the C compiler supports computed gotos. */
925e6b
+#undef HAVE_COMPUTED_GOTOS
925e6b
+
925e6b
 /* Define to 1 if you have the `confstr' function. */
925e6b
 #undef HAVE_CONFSTR
925e6b
 
925e6b
@@ -1060,6 +1063,9 @@
925e6b
 /* Define to 1 if your <sys/time.h> declares `struct tm'. */
925e6b
 #undef TM_IN_SYS_TIME
925e6b
 
925e6b
+/* Define if you want to use computed gotos in ceval.c. */
925e6b
+#undef USE_COMPUTED_GOTOS
925e6b
+
925e6b
 /* Enable extensions on AIX 3, Interix.  */
925e6b
 #ifndef _ALL_SOURCE
925e6b
 # undef _ALL_SOURCE
925e6b
-- 
925e6b
2.5.5
925e6b