Author: Armin Rigo <[email protected]>
Branch:
Changeset: r59947:067f06080d2e
Date: 2013-01-11 08:48 +0100
http://bitbucket.org/pypy/pypy/changeset/067f06080d2e/
Log: Add comments (from stm-thread-2).
diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -178,6 +178,11 @@
else:
oparg = 0
+ # note: the structure of the code here is such that it makes
+ # (after translation) a big "if/elif" chain, which is then
+ # turned into a switch(). It starts here: even if the first
+ # one is not an "if" but a "while" the effect is the same.
+
while opcode == self.opcodedesc.EXTENDED_ARG.index:
opcode = ord(co_code[next_instr])
if opcode < self.HAVE_ARGUMENT:
@@ -226,6 +231,8 @@
'END_FINALLY', 'JUMP_ABSOLUTE'):
continue # opcodes implemented above
+ # the following "if" is part of the big switch described
+ # above.
if opcode == opdesc.index:
# dispatch to the opcode method
meth = getattr(self, opdesc.methodname)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit