[pypy-svn] r65012 - pypy/branch/pyjitpl5/pypy/jit/backend/x86

fijal at codespeak.net fijal at codespeak.net
Mon May 4 01:19:26 CEST 2009


Author: fijal
Date: Mon May  4 01:19:25 2009
New Revision: 65012

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py
Log:
simplify handling the guard_index. I *think* in rare cases the previous one
might not work, but I didn't encounter one in the wild. Anyway, it's simpler now


Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py	Mon May  4 01:19:25 2009
@@ -829,7 +829,7 @@
         self.mc = oldmc
         return addr
 
-    def generate_failure(self, op, locs, guard_index, exc):
+    def generate_failure(self, op, locs, exc):
         pos = self.mc.tell()
         for i in range(len(locs)):
             loc = locs[i]
@@ -849,6 +849,7 @@
             self.generate_exception_handling(eax)
         self.places_to_patch_framesize.append(self.mc.tell())
         self.mc.ADD(esp, imm32(0))
+        guard_index = self.cpu.make_guard_index(op)
         self.mc.MOV(eax, imm(guard_index))
         self.mc.RET()
 

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py	Mon May  4 01:19:25 2009
@@ -270,9 +270,6 @@
         self._walk_operations(operations)
 
     def _walk_operations(self, operations):
-        fop = operations[-1]
-        if fop.opnum == rop.FAIL:
-            self.guard_index = self.assembler.cpu.make_guard_index(fop)
         i = 0
         while i < len(operations):
             op = operations[i]
@@ -638,7 +635,7 @@
     def consider_fail(self, op, ignored):
         # make sure all vars are on stack
         locs = [self.loc(arg) for arg in op.args]
-        self.assembler.generate_failure(op, locs, self.guard_index, self.exc)
+        self.assembler.generate_failure(op, locs, self.exc)
         self.eventually_free_vars(op.args)
 
     def consider_guard_nonvirtualized(self, op, ignored):



More information about the Pypy-commit mailing list