[pypy-svn] r37517 - in pypy/dist/pypy/jit/codegen: . llgraph

arigo at codespeak.net arigo at codespeak.net
Mon Jan 29 12:15:50 CET 2007


Author: arigo
Date: Mon Jan 29 12:15:49 2007
New Revision: 37517

Modified:
   pypy/dist/pypy/jit/codegen/graph2rgenop.py
   pypy/dist/pypy/jit/codegen/llgraph/llimpl.py
Log:
Fix graph2rgenop to avoid putting constants and duplicate variables
in the list of variables that are alive across a jump.


Modified: pypy/dist/pypy/jit/codegen/graph2rgenop.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/graph2rgenop.py	(original)
+++ pypy/dist/pypy/jit/codegen/graph2rgenop.py	Mon Jan 29 12:15:49 2007
@@ -100,7 +100,11 @@
                     meth = builder.jump_if_true
                 else:
                     meth = builder.jump_if_false
-                newbuilder = meth(varmap[block.exitswitch], args_gv)
+                vars_gv = {}
+                for v in args_gv:
+                    if not v.is_const:
+                        vars_gv[v] = True
+                newbuilder = meth(varmap[block.exitswitch], vars_gv.keys())
                 more_pending_blocks.append((jumplink.target,
                                             newbuilder,
                                             args_gv))

Modified: pypy/dist/pypy/jit/codegen/llgraph/llimpl.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/llgraph/llimpl.py	(original)
+++ pypy/dist/pypy/jit/codegen/llgraph/llimpl.py	Mon Jan 29 12:15:49 2007
@@ -387,6 +387,8 @@
         linkvars = list(otherlink.args)
     # check linkvars for consistency
     existing_vars = dict.fromkeys(prevblockvars)
+    for v in inputvars:
+        assert isinstance(v, flowmodel.Variable)
     for v in linkvars:
         assert v in existing_vars
 



More information about the Pypy-commit mailing list