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
fea59e7f
Commit
fea59e7f
authored
Jun 13, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The opcode FOR_LOOP no longer exists.
parent
efb9097a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
40 deletions
+3
-40
Doc/lib/libdis.tex
Doc/lib/libdis.tex
+3
-7
Include/opcode.h
Include/opcode.h
+0
-1
Lib/dis.py
Lib/dis.py
+0
-1
Python/ceval.c
Python/ceval.c
+0
-31
No files found.
Doc/lib/libdis.tex
View file @
fea59e7f
...
...
@@ -556,13 +556,9 @@ it). If the iterator indicates it is exhausted \code{TOS} is
popped, and the byte code counter is incremented by
\var
{
delta
}
.
\end{opcodedesc}
\begin{opcodedesc}
{
FOR
_
LOOP
}{
delta
}
This opcode is obsolete.
%Iterate over a sequence. TOS is the current index, TOS1 the sequence.
%First, the next element is computed. If the sequence is exhausted,
%increment byte code counter by \var{delta}. Otherwise, push the
%sequence, the incremented counter, and the current item onto the stack.
\end{opcodedesc}
%\begin{opcodedesc}{FOR_LOOP}{delta}
%This opcode is obsolete.
%\end{opcodedesc}
%\begin{opcodedesc}{LOAD_LOCAL}{namei}
%This opcode is obsolete.
...
...
Include/opcode.h
View file @
fea59e7f
...
...
@@ -107,7 +107,6 @@ extern "C" {
#define JUMP_IF_FALSE 111
/* "" */
#define JUMP_IF_TRUE 112
/* "" */
#define JUMP_ABSOLUTE 113
/* Target byte offset from beginning of code */
#define FOR_LOOP 114
/* Number of bytes to skip */
#define LOAD_GLOBAL 116
/* Index in name list */
...
...
Lib/dis.py
View file @
fea59e7f
...
...
@@ -262,7 +262,6 @@ jrel_op('JUMP_FORWARD', 110) # Number of bytes to skip
jrel_op
(
'JUMP_IF_FALSE'
,
111
)
# ""
jrel_op
(
'JUMP_IF_TRUE'
,
112
)
# ""
jabs_op
(
'JUMP_ABSOLUTE'
,
113
)
# Target byte offset from beginning of code
jrel_op
(
'FOR_LOOP'
,
114
)
# Number of bytes to skip
name_op
(
'LOAD_GLOBAL'
,
116
)
# Index in name list
...
...
Python/ceval.c
View file @
fea59e7f
...
...
@@ -1942,37 +1942,6 @@ eval_frame(PyFrameObject *f)
}
break
;
case
FOR_LOOP
:
/* for v in s: ...
On entry: stack contains s, i.
On exit: stack contains s, i+1, s[i];
but if loop exhausted:
s, i are popped, and we jump */
w
=
POP
();
/* Loop index */
v
=
POP
();
/* Sequence object */
u
=
loop_subscript
(
v
,
w
);
if
(
u
!=
NULL
)
{
PUSH
(
v
);
x
=
PyInt_FromLong
(
PyInt_AsLong
(
w
)
+
1
);
PUSH
(
x
);
Py_DECREF
(
w
);
PUSH
(
u
);
if
(
x
!=
NULL
)
continue
;
}
else
{
Py_DECREF
(
v
);
Py_DECREF
(
w
);
/* A NULL can mean "s exhausted"
but also an error: */
if
(
PyErr_Occurred
())
why
=
WHY_EXCEPTION
;
else
{
JUMPBY
(
oparg
);
continue
;
}
}
break
;
case
SETUP_LOOP
:
case
SETUP_EXCEPT
:
case
SETUP_FINALLY
:
...
...
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