Author: Alex Gaynor <[email protected]>
Branch: stdlib-2.7.8
Changeset: r73000:d52ea60276d3
Date: 2014-08-23 08:33 -0700
http://bitbucket.org/pypy/pypy/changeset/d52ea60276d3/

Log:    Minimize the stack effect when these instructions are used (from
        CPython

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
@@ -406,6 +406,9 @@
                     target_depth += 3
                     if target_depth > self._max_depth:
                         self._max_depth = target_depth
+                elif (jump_op == ops.JUMP_IF_TRUE_OR_POP or
+                      jump_op == ops.JUMP_IF_FALSE_OR_POP):
+                    depth -= 1
                 self._next_stack_depth_walk(instr.jump[0], target_depth)
                 if jump_op == ops.JUMP_ABSOLUTE or jump_op == ops.JUMP_FORWARD:
                     # Nothing more can occur.
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to