[pypy-svn] r63611 - pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86

fijal at codespeak.net fijal at codespeak.net
Sat Apr 4 04:18:34 CEST 2009


Author: fijal
Date: Sat Apr  4 04:18:34 2009
New Revision: 63611

Modified:
   pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/runner.py
Log:
nasty trick to work around the fact that each time we do_call box
should be different


Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/runner.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/runner.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/runner.py	Sat Apr  4 04:18:34 2009
@@ -222,16 +222,22 @@
         elif isinstance(box, BoxPtr):
             box.value = self.cast_int_to_gcref(fail_boxes[index])
 
+    def _new_box(self, ptr):
+        if ptr:
+            return BoxPtr(lltype.nullptr(llmemory.GCREF.TO))
+        return BoxInt(0)
+    
     def _get_loop_for_call(self, argnum, calldescr, ptr):
-        #try:
-        #    return self.generated_mps[calldescr]
-        #except KeyError:
-        #    pass
+        try:
+            loop = self.generated_mps[calldescr]
+            box = self._new_box(ptr)
+            loop.operations[0].result = box
+            loop.operations[-1].args[0] = box
+            return loop
+        except KeyError:
+            pass
         args = [BoxInt(0) for i in range(argnum + 1)]
-        if ptr:
-            result = BoxPtr(lltype.nullptr(llmemory.GCREF.TO))
-        else:
-            result = BoxInt(0)
+        result = self._new_box(ptr)
         operations = [
             ResOperation(rop.CALL, args, result, calldescr),
             ResOperation(rop.FAIL, [result], None)]



More information about the Pypy-commit mailing list