[pypy-svn] pypy default: Fix the "peepholer" optimization: the size of the code changes,

amauryfa commits-noreply at bitbucket.org
Thu Jan 20 00:35:10 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r40956:7914cd5a7e14
Date: 2011-01-20 00:33 +0100
http://bitbucket.org/pypy/pypy/changeset/7914cd5a7e14/

Log:	Fix the "peepholer" optimization: the size of the code changes,
	offsets must be computed again.

diff --git a/pypy/interpreter/astcompiler/assemble.py b/pypy/interpreter/astcompiler/assemble.py
--- a/pypy/interpreter/astcompiler/assemble.py
+++ b/pypy/interpreter/astcompiler/assemble.py
@@ -291,6 +291,9 @@
                                     instr.opcode = ops.RETURN_VALUE
                                     instr.arg = 0
                                     instr.has_jump = False
+                                    # The size of the code changed,
+                                    # we have to trigger another pass
+                                    extended_arg_count += 1
                                     continue
                         if absolute:
                             jump_arg = target.offset


More information about the Pypy-commit mailing list