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

fijal at codespeak.net fijal at codespeak.net
Fri Apr 3 23:04:14 CEST 2009


Author: fijal
Date: Fri Apr  3 23:04:12 2009
New Revision: 63587

Modified:
   pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/assembler.py
   pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/regalloc.py
   pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/runner.py
Log:
Next tests start passing. Remove even more code or comment out outdated
debugging facilities


Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/assembler.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/assembler.py	Fri Apr  3 23:04:12 2009
@@ -66,7 +66,7 @@
 
     def __init__(self, cpu, translate_support_code=False):
         self.cpu = cpu
-        self.verbose = False
+        self.verbose = True
         self.rtyper = cpu.rtyper
         self.malloc_func_addr = 0
         self._exception_data = lltype.nullptr(rffi.CArray(lltype.Signed))
@@ -183,13 +183,6 @@
         regalloc = RegAlloc(self, tree, self.cpu.translate_support_code)
         if not we_are_translated():
             self._regalloc = regalloc # for debugging
-        if self.verbose and not we_are_translated():
-            import pprint
-            print
-            pprint.pprint(operations)
-            print
-            #pprint.pprint(computed_ops)
-            #print
         regalloc.walk_operations(tree)
         self.mc.done()
         self.mc2.done()

Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/regalloc.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/backend/x86/regalloc.py	Fri Apr  3 23:04:12 2009
@@ -94,49 +94,49 @@
         return RegAlloc(self.assembler, None, self.translate_support_code,
                         self, guard_op)
 
-    def _start_from_guard_op(self, guard_op, mp, jump):
-        xxx
-        rev_stack_binds = {}
-        self.jump_reg_candidates = {}
-        j = 0
-        sd = len(mp.args)
-        if len(jump.args) > sd:
-            sd = len(jump.args)
-        for i in range(len(mp.args)):
-            arg = mp.args[i]
-            if not isinstance(arg, Const):
-                stackpos = guard_op.stacklocs[j]
-                if stackpos >= sd:
-                    sd = stackpos + 1
-                loc = guard_op.locs[j]
-                if isinstance(loc, REG):
-                    self.free_regs = [reg for reg in self.free_regs if reg is not loc]
-                    self.reg_bindings[arg] = loc
-                    self.dirty_stack[arg] = True
-                self.stack_bindings[arg] = stack_pos(stackpos)
-                rev_stack_binds[stackpos] = arg
-                j += 1
-        if jump.opnum != rop.JUMP:
-            return {}, sd
-        for i in range(len(jump.args)):
-            argloc = jump.jump_target.arglocs[i]
-            jarg = jump.args[i]
-            if not isinstance(jarg, Const):
-                if isinstance(argloc, REG):
-                    self.jump_reg_candidates[jarg] = argloc
-                if (i in rev_stack_binds and
-                    (self.longevity[rev_stack_binds[i]][1] >
-                     self.longevity[jarg][0])):
-                    # variables cannot occupy the same place on stack,
-                    # because they overlap, but we care only in consider_jump
-                    pass
-                else:
-                    # optimization for passing around values
-                    if jarg not in self.stack_bindings:
-                        self.dirty_stack[jarg] = True
-                        self.stack_bindings[jarg] = stack_pos(i)
-                j += 1
-        return {}, sd
+#     def _start_from_guard_op(self, guard_op, mp, jump):
+#         xxx
+#         rev_stack_binds = {}
+#         self.jump_reg_candidates = {}
+#         j = 0
+#         sd = len(mp.args)
+#         if len(jump.args) > sd:
+#             sd = len(jump.args)
+#         for i in range(len(mp.args)):
+#             arg = mp.args[i]
+#             if not isinstance(arg, Const):
+#                 stackpos = guard_op.stacklocs[j]
+#                 if stackpos >= sd:
+#                     sd = stackpos + 1
+#                 loc = guard_op.locs[j]
+#                 if isinstance(loc, REG):
+#                     self.free_regs = [reg for reg in self.free_regs if reg is not loc]
+#                     self.reg_bindings[arg] = loc
+#                     self.dirty_stack[arg] = True
+#                 self.stack_bindings[arg] = stack_pos(stackpos)
+#                 rev_stack_binds[stackpos] = arg
+#                 j += 1
+#         if jump.opnum != rop.JUMP:
+#             return {}, sd
+#         for i in range(len(jump.args)):
+#             argloc = jump.jump_target.arglocs[i]
+#             jarg = jump.args[i]
+#             if not isinstance(jarg, Const):
+#                 if isinstance(argloc, REG):
+#                     self.jump_reg_candidates[jarg] = argloc
+#                 if (i in rev_stack_binds and
+#                     (self.longevity[rev_stack_binds[i]][1] >
+#                      self.longevity[jarg][0])):
+#                     # variables cannot occupy the same place on stack,
+#                     # because they overlap, but we care only in consider_jump
+#                     pass
+#                 else:
+#                     # optimization for passing around values
+#                     if jarg not in self.stack_bindings:
+#                         self.dirty_stack[jarg] = True
+#                         self.stack_bindings[jarg] = stack_pos(i)
+#                 j += 1
+#         return {}, sd
 
     def _compute_loop_consts(self, inputargs, jump):
         self.jump_reg_candidates = {}
@@ -962,7 +962,7 @@
         for i in range(len(op.args)):
             arg = op.args[i]
             loop = op.jump_target
-            res = loop.inputargs[i]
+            res = loop.arglocs[i]
             if not (isinstance(arg, Const) or (arg in self.loop_consts
                                                and self.loop_consts[arg] == i)):
                 if arg in self.reg_bindings:

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	Fri Apr  3 23:04:12 2009
@@ -217,7 +217,7 @@
         if isinstance(box, BoxInt):
             box.value = fail_boxes[index]
         elif isinstance(box, BoxPtr):
-            xxx
+            box.value = self.cast_int_to_gcref(fail_boxes[index])
 
     def _get_mp_for_call(self, argnum, calldescr):
         try:



More information about the Pypy-commit mailing list