[pypy-svn] r28987 - pypy/dist/pypy/translator/c
cfbolz at codespeak.net
cfbolz at codespeak.net
Tue Jun 20 13:36:21 CEST 2006
Author: cfbolz
Date: Tue Jun 20 13:36:13 2006
New Revision: 28987
Modified:
pypy/dist/pypy/translator/c/exceptiontransform.py
Log:
small optimization in exception transformer: don't check for an exception in
the case of tail calls.
Modified: pypy/dist/pypy/translator/c/exceptiontransform.py
==============================================================================
--- pypy/dist/pypy/translator/c/exceptiontransform.py (original)
+++ pypy/dist/pypy/translator/c/exceptiontransform.py Tue Jun 20 13:36:13 2006
@@ -167,6 +167,12 @@
if block.exitswitch == c_last_exception:
need_exc_matching = True
last_operation -= 1
+ elif (len(block.exits) == 1 and
+ block.exits[0].target is graph.returnblock and
+ len(block.operations) and
+ (block.exits[0].args[0].concretetype is lltype.Void or
+ block.exits[0].args[0] is block.operations[-1].result)):
+ last_operation -= 1
lastblock = block
for i in range(last_operation, -1, -1):
op = block.operations[i]
More information about the Pypy-commit
mailing list