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

fijal at codespeak.net fijal at codespeak.net
Wed Apr 22 18:06:48 CEST 2009


Author: fijal
Date: Wed Apr 22 18:06:47 2009
New Revision: 64574

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/runner.py
Log:
kill the hack. Hack assumed that the only list of operations that can
end up with fail is either suboperations or loop ops. That's not true


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	Wed Apr 22 18:06:47 2009
@@ -44,7 +44,6 @@
         raise ValueError("convert_to_imm: got a %s" % c)
 
 class RegAlloc(object):
-    guard_index = -1
     max_stack_depth = 0
     exc = False
     
@@ -267,6 +266,9 @@
         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]
@@ -616,11 +618,7 @@
         self.eventually_free_vars(inputargs)
 
     def regalloc_for_guard(self, guard_op):
-        regalloc = self.copy(guard_op)
-        fop = guard_op.suboperations[-1]
-        if fop.opnum == rop.FAIL:
-            regalloc.guard_index = self.assembler.cpu.make_guard_index(fop)
-        return regalloc
+        return self.copy(guard_op)
 
     def _consider_guard(self, op, ignored):
         loc = self.make_sure_var_in_reg(op.args[0], [])

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/runner.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/runner.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/runner.py	Wed Apr 22 18:06:47 2009
@@ -304,11 +304,7 @@
         keepalive_until_here(valueboxes)
         self.keepalives_index = oldindex
         del self.keepalives[oldindex:]
-        if guard_index == -1:
-            # special case for calls
-            op = loop.operations[-1]
-        else:
-            op = self._guard_list[guard_index]
+        op = self._guard_list[guard_index]
         #print "Leaving at: %d" % self.assembler.fail_boxes[len(op.args)]
         for i in range(len(op.args)):
             box = op.args[i]



More information about the Pypy-commit mailing list