[pypy-svn] r18189 - pypy/dist/pypy/translator/llvm

ericvrp at codespeak.net ericvrp at codespeak.net
Wed Oct 5 12:08:09 CEST 2005


Author: ericvrp
Date: Wed Oct  5 12:08:09 2005
New Revision: 18189

Modified:
   pypy/dist/pypy/translator/llvm/exception.py
   pypy/dist/pypy/translator/llvm/opwriter.py
Log:
Changes to get keepalive operation to work.

note: I think keepalive should not be allowed to be the last operation
of blocks that have exitswitch Constant(last_exception)


Modified: pypy/dist/pypy/translator/llvm/exception.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/exception.py	(original)
+++ pypy/dist/pypy/translator/llvm/exception.py	Wed Oct  5 12:08:09 2005
@@ -205,7 +205,8 @@
 
     def invoke(self, codewriter, targetvar, tail_, cconv, returntype, functionref, args, label, except_label):
         if returntype == 'void':
-            codewriter.indent('%scall %s void %s(%s)' % (tail_, cconv, functionref, args))
+            if functionref != '%keepalive': #XXX I think keepalive should not be the last operation here!
+                codewriter.indent('%scall %s void %s(%s)' % (tail_, cconv, functionref, args))
         else:
             codewriter.indent('%s = %scall %s %s %s(%s)' % (targetvar, tail_, cconv, returntype, functionref, args))
         tmp = '%%invoke.tmp.%d' % self.invoke_count

Modified: pypy/dist/pypy/translator/llvm/opwriter.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/opwriter.py	(original)
+++ pypy/dist/pypy/translator/llvm/opwriter.py	Wed Oct  5 12:08:09 2005
@@ -132,6 +132,10 @@
         targetvar = self.db.repr_arg(op.result)
         self.codewriter.cast(targetvar, mult_type, res_val, mult_type)        
 
+    def _skipped(self, op):
+        self.codewriter.comment('***Skipping operation %s()' % (op.opname,))
+    keepalive = _skipped
+
     def int_abs(self, op):
         functionref = '%' + op.opname
         ExternalFuncNode.used_external_functions[functionref] = True
@@ -442,7 +446,7 @@
                                           ("uint", index))        
             self.codewriter.load(targetvar, targettype, tmpvar)
         else:
-            self.codewriter.comment("***Skipping operation getfield()***")
+            self._skipped(op)
  
     def getsubstruct(self, op): 
         struct, structtype = self.db.repr_argwithtype(op.args[0])
@@ -465,7 +469,7 @@
                                           ("uint", index))
             self.codewriter.store(valuetype, valuevar, tmpvar) 
         else:
-            self.codewriter.comment("***Skipping operation setfield()***")
+            self._skipped(op)
             
     def getarrayitem(self, op):        
         array, arraytype = self.db.repr_argwithtype(op.args[0])
@@ -479,7 +483,7 @@
                                           ("uint", 1), (indextype, index))
             self.codewriter.load(targetvar, targettype, tmpvar)
         else:
-            self.codewriter.comment("***Skipping operation getarrayitem()***")
+            self._skipped(op)
 
     def getarraysubstruct(self, op):        
         array, arraytype = self.db.repr_argwithtype(op.args[0])
@@ -503,7 +507,7 @@
                                       ("uint", 1), (indextype, index))
             self.codewriter.store(valuetype, valuevar, tmpvar) 
         else:
-            self.codewriter.comment("***Skipping operation setarrayitem()***")
+            self._skipped(op)
 
     def getarraysize(self, op):
         array, arraytype = self.db.repr_argwithtype(op.args[0])



More information about the Pypy-commit mailing list