Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
de5ec2ac
Commit
de5ec2ac
authored
Jan 06, 2007
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SF# 1409443: Expand comment to cover the interaction between f->f_lasti and the PREDICT macros.
parent
e12944dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
Python/ceval.c
Python/ceval.c
+10
-1
No files found.
Python/ceval.c
View file @
de5ec2ac
...
@@ -741,7 +741,16 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -741,7 +741,16 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
this wasn't always true before 2.3! PyFrame_New now sets
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)
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
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
;
next_instr
=
first_instr
+
f
->
f_lasti
+
1
;
stack_pointer
=
f
->
f_stacktop
;
stack_pointer
=
f
->
f_stacktop
;
assert
(
stack_pointer
!=
NULL
);
assert
(
stack_pointer
!=
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment