summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-01-06 01:14:41 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-01-06 01:14:41 (GMT)
commit4bd97d4549cc9e31c2b281095f2770a6ffd50a59 (patch)
tree6e3db1161362bb06c89d8c03d09dee8641e0c90c /Python
parentd14ef77ae1d455369f12b3d483c36323663d2fa3 (diff)
downloadcpython-4bd97d4549cc9e31c2b281095f2770a6ffd50a59.zip
cpython-4bd97d4549cc9e31c2b281095f2770a6ffd50a59.tar.gz
cpython-4bd97d4549cc9e31c2b281095f2770a6ffd50a59.tar.bz2
SF# 1409443: Expand comment to cover the interaction between f->f_lasti and the PREDICT macros.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 7884051..67eefba 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -741,7 +741,16 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
this wasn't always true before 2.3! PyFrame_New now sets
f->f_lasti to -1 (i.e. the index *before* the first instruction)
and YIELD_VALUE doesn't fiddle with f_lasti any more. So this
- does work. Promise. */
+ does work. Promise.
+
+ When the PREDICT() macros are enabled, some opcode pairs follow in
+ direct succession without updating f->f_lasti. A successful
+ prediction effectively links the two codes together as if they
+ were a single new opcode; accordingly,f->f_lasti will point to
+ the first code in the pair (for instance, GET_ITER followed by
+ FOR_ITER is effectively a single opcode and f->f_lasti will point
+ at to the beginning of the combined pair.)
+ */
next_instr = first_instr + f->f_lasti + 1;
stack_pointer = f->f_stacktop;
assert(stack_pointer != NULL);