[pypy-svn] r64810 - pypy/branch/pyjitpl5/pypy/translator/cli

antocuni at codespeak.net antocuni at codespeak.net
Wed Apr 29 16:00:55 CEST 2009


Author: antocuni
Date: Wed Apr 29 16:00:54 2009
New Revision: 64810

Modified:
   pypy/branch/pyjitpl5/pypy/translator/cli/function.py
   pypy/branch/pyjitpl5/pypy/translator/cli/ilgenerator.py
Log:
this is needed to compile JIT tests to CLI.  I couldn't find a simple way to
produce a graph that triggers the bug though :-/



Modified: pypy/branch/pyjitpl5/pypy/translator/cli/function.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/translator/cli/function.py	(original)
+++ pypy/branch/pyjitpl5/pypy/translator/cli/function.py	Wed Apr 29 16:00:54 2009
@@ -198,6 +198,9 @@
     def store(self, v):
         if isinstance(v, flowmodel.Variable):
             if v.concretetype is not Void:
-                self.ilasm.store_local(v)
+                if v.name in self.argset:
+                    self.ilasm.store_arg(v)
+                else:
+                    self.ilasm.store_local(v)
         else:
             assert False

Modified: pypy/branch/pyjitpl5/pypy/translator/cli/ilgenerator.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/translator/cli/ilgenerator.py	(original)
+++ pypy/branch/pyjitpl5/pypy/translator/cli/ilgenerator.py	Wed Apr 29 16:00:54 2009
@@ -232,9 +232,12 @@
         elif type_ in (SignedLongLong, UnsignedLongLong):
             self.opcode('ldc.i8', str(v))
 
-    def store_local (self, v):
+    def store_local(self, v):
         self.opcode('stloc', repr(v.name))
 
+    def store_arg(self, v):
+        self.opcode('starg', repr(v.name))
+
     def store_static_constant(self, cts_type, CONST_NAMESPACE, CONST_CLASS, name):
         self.opcode('stsfld', '%s %s.%s::%s' % (cts_type, CONST_NAMESPACE, CONST_CLASS, name))
 



More information about the Pypy-commit mailing list