]> granicus.if.org Git - python/commitdiff
Move the code for BREAK and CONTINUE_LOOP to be near FOR_ITER.
authorRaymond Hettinger <python@rcn.com>
Fri, 12 Mar 2004 09:12:22 +0000 (09:12 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 12 Mar 2004 09:12:22 +0000 (09:12 +0000)
Makes it more likely that all loop operations are in the cache
at the same time.

Python/ceval.c

index 3c9076c6194f5e5055d2a977306d2b802993ab63..71fd5471a972165ad6653c06c774c512c9d9e2ac 100644 (file)
@@ -1583,15 +1583,6 @@ eval_frame(PyFrameObject *f)
 #ifdef CASE_TOO_BIG
                default: switch (opcode) {
 #endif
-               case BREAK_LOOP:
-                       why = WHY_BREAK;
-                       goto fast_block_end;
-
-               case CONTINUE_LOOP:
-                       retval = PyInt_FromLong(oparg);
-                       why = WHY_CONTINUE;
-                       goto fast_block_end;
-
                case RAISE_VARARGS:
                        u = v = w = NULL;
                        switch (oparg) {
@@ -2109,6 +2100,15 @@ eval_frame(PyFrameObject *f)
                        JUMPBY(oparg);
                        continue;
 
+               case BREAK_LOOP:
+                       why = WHY_BREAK;
+                       goto fast_block_end;
+
+               case CONTINUE_LOOP:
+                       retval = PyInt_FromLong(oparg);
+                       why = WHY_CONTINUE;
+                       goto fast_block_end;
+
                case SETUP_LOOP:
                case SETUP_EXCEPT:
                case SETUP_FINALLY: