[pypy-svn] r29829 - pypy/dist/pypy/translator/backendopt
pedronis at codespeak.net
pedronis at codespeak.net
Sat Jul 8 16:00:02 CEST 2006
Author: pedronis
Date: Sat Jul 8 15:59:49 2006
New Revision: 29829
Modified:
pypy/dist/pypy/translator/backendopt/support.py
Log:
(arre, pedronis)
when split_block_with_keepalive is called with an annotator the inserted keepalive ops should have
they return value annotated too.
Modified: pypy/dist/pypy/translator/backendopt/support.py
==============================================================================
--- pypy/dist/pypy/translator/backendopt/support.py (original)
+++ pypy/dist/pypy/translator/backendopt/support.py Sat Jul 8 15:59:49 2006
@@ -3,7 +3,7 @@
from pypy.translator.simplify import get_graph
from pypy.rpython.rmodel import inputconst
from pypy.tool.ansi_print import ansi_log
-from pypy.annotation.model import setunion
+from pypy.annotation.model import setunion, s_ImpossibleValue
from pypy.translator.unsimplify import split_block, copyvar, insert_empty_block
from pypy.objspace.flow.model import Constant, Variable, SpaceOperation, c_last_exception
from pypy.rpython.lltypesystem import lltype
@@ -55,7 +55,7 @@
else:
return False
-def generate_keepalive(vars):
+def generate_keepalive(vars, annotator=None):
keepalive_ops = []
for v in vars:
if isinstance(v, Constant):
@@ -64,6 +64,8 @@
continue
v_keepalive = Variable()
v_keepalive.concretetype = lltype.Void
+ if annotator is not None:
+ annotator.setbinding(v_keepalive, s_ImpossibleValue)
keepalive_ops.append(SpaceOperation('keepalive', [v], v_keepalive))
return keepalive_ops
@@ -91,7 +93,8 @@
keep_alive_vars = [var for var in afterblock.operations[0].args
if isinstance(var, Variable) and var_needsgc(var)]
if len(afterblock.operations) > 1 or afterblock.exitswitch != c_last_exception:
- afterblock.operations[1:1] = generate_keepalive(keep_alive_vars)
+ afterblock.operations[1:1] = generate_keepalive(keep_alive_vars,
+ annotator=annotator)
keep_alive_vars = []
else:
keep_alive_vars = []
More information about the Pypy-commit
mailing list