Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d783e9

Browse files
committed
Move the code for BREAK and CONTINUE_LOOP to be near FOR_ITER.
Makes it more likely that all loop operations are in the cache at the same time.
1 parent db0de9e commit 2d783e9

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Python/ceval.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,15 +1583,6 @@ eval_frame(PyFrameObject *f)
15831583
#ifdef CASE_TOO_BIG
15841584
default: switch (opcode) {
15851585
#endif
1586-
case BREAK_LOOP:
1587-
why = WHY_BREAK;
1588-
goto fast_block_end;
1589-
1590-
case CONTINUE_LOOP:
1591-
retval = PyInt_FromLong(oparg);
1592-
why = WHY_CONTINUE;
1593-
goto fast_block_end;
1594-
15951586
case RAISE_VARARGS:
15961587
u = v = w = NULL;
15971588
switch (oparg) {
@@ -2109,6 +2100,15 @@ eval_frame(PyFrameObject *f)
21092100
JUMPBY(oparg);
21102101
continue;
21112102

2103+
case BREAK_LOOP:
2104+
why = WHY_BREAK;
2105+
goto fast_block_end;
2106+
2107+
case CONTINUE_LOOP:
2108+
retval = PyInt_FromLong(oparg);
2109+
why = WHY_CONTINUE;
2110+
goto fast_block_end;
2111+
21122112
case SETUP_LOOP:
21132113
case SETUP_EXCEPT:
21142114
case SETUP_FINALLY:

0 commit comments

Comments
 (0)