[pypy-commit] pypy ppc-jit-backend-rpythonization: (bivab, hager): translation fixes

hager noreply at buildbot.pypy.org
Tue Feb 7 17:56:23 CET 2012


Author: hager <sven.hager at uni-duesseldorf.de>
Branch: ppc-jit-backend-rpythonization
Changeset: r52196:5730965ab0ff
Date: 2012-02-07 08:55 -0800
http://bitbucket.org/pypy/pypy/changeset/5730965ab0ff/

Log:	(bivab, hager): translation fixes

diff --git a/pypy/jit/backend/arm/runner.py b/pypy/jit/backend/arm/runner.py
--- a/pypy/jit/backend/arm/runner.py
+++ b/pypy/jit/backend/arm/runner.py
@@ -112,7 +112,7 @@
                             (frame_depth +
                             len(all_regs) * WORD +
                             len(all_vfp_regs) * 2 * WORD))
-        fail_index_2 = self.assembler.failure_recovery_func(
+        fail_index_2 = self.assembler.decode_registers_and_descr(
             faildescr._failure_recovery_code,
             addr_of_force_index,
             addr_end_of_frame)
diff --git a/pypy/jit/backend/ppc/ppcgen/helper/assembler.py b/pypy/jit/backend/ppc/ppcgen/helper/assembler.py
--- a/pypy/jit/backend/ppc/ppcgen/helper/assembler.py
+++ b/pypy/jit/backend/ppc/ppcgen/helper/assembler.py
@@ -83,7 +83,7 @@
 
 def decode64(mem, index):
     value = 0
-    for x in unrolling_iterable(range(8)):
+    for x in range(8):
         value |= (ord(mem[index + x]) << (56 - x * 8))
     return intmask(value)
 
diff --git a/pypy/jit/backend/ppc/ppcgen/helper/regalloc.py b/pypy/jit/backend/ppc/ppcgen/helper/regalloc.py
--- a/pypy/jit/backend/ppc/ppcgen/helper/regalloc.py
+++ b/pypy/jit/backend/ppc/ppcgen/helper/regalloc.py
@@ -10,7 +10,7 @@
     return False
 
 def _check_imm_arg(arg, size=IMM_SIZE, allow_zero=True):
-    #assert not isinstance(arg, ConstInt)
+    assert not isinstance(arg, ConstInt)
     #if not we_are_translated():
     #    if not isinstance(arg, int):
     #        import pdb; pdb.set_trace()
@@ -25,8 +25,8 @@
     def f(self, op):
         boxes = op.getarglist()
         arg0, arg1 = boxes
-        imm_a0 = _check_imm_arg(arg0)
-        imm_a1 = _check_imm_arg(arg1)
+        imm_a0 = check_imm_box(arg0)
+        imm_a1 = check_imm_box(arg1)
         l0 = self._ensure_value_is_boxed(arg0, forbidden_vars=boxes)
 
         if imm_a1 and not imm_a0:
@@ -63,8 +63,8 @@
     def f(self, op):
         boxes = op.getarglist()
         b0, b1 = boxes
-        imm_b0 = _check_imm_arg(b0)
-        imm_b1 = _check_imm_arg(b1)
+        imm_b0 = check_imm_box(b0)
+        imm_b1 = check_imm_box(b1)
         l0 = self._ensure_value_is_boxed(b0, boxes)
         l1 = self._ensure_value_is_boxed(b1, boxes)
         locs = [l0, l1]
diff --git a/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py b/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py
--- a/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py
+++ b/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py
@@ -238,6 +238,7 @@
         descr = decode32(enc, i+1)
         self.fail_boxes_count = fail_index
         self.fail_force_index = spp_loc
+        assert isinstance(descr, int)
         return descr
 
     def decode_inputargs(self, enc):
@@ -600,8 +601,7 @@
             if op.is_ovf():
                 if (operations[i + 1].getopnum() != rop.GUARD_NO_OVERFLOW and
                     operations[i + 1].getopnum() != rop.GUARD_OVERFLOW):
-                    not_implemented("int_xxx_ovf not followed by "
-                                    "guard_(no)_overflow")
+                    assert 0, "int_xxx_ovf not followed by guard_(no)_overflow"
                 return True
             return False
         if (operations[i + 1].getopnum() != rop.GUARD_TRUE and
diff --git a/pypy/jit/backend/ppc/ppcgen/regalloc.py b/pypy/jit/backend/ppc/ppcgen/regalloc.py
--- a/pypy/jit/backend/ppc/ppcgen/regalloc.py
+++ b/pypy/jit/backend/ppc/ppcgen/regalloc.py
@@ -512,7 +512,7 @@
                 loc, box = self._ensure_value_is_boxed(op.getarg(i), argboxes)
                 arglocs.append(loc)
                 argboxes.append(box)
-            self.assembler.call_release_gil(gcrootmap, arglocs, fcond)
+            self.assembler.call_release_gil(gcrootmap, arglocs)
             self.possibly_free_vars(argboxes)
         # do the call
         faildescr = guard_op.getdescr()
@@ -595,11 +595,10 @@
         args = op.getarglist()
         base_loc = self._ensure_value_is_boxed(op.getarg(0), args)
         index_loc = self._ensure_value_is_boxed(op.getarg(1), args)
-        c_ofs = ConstInt(ofs)
-        if _check_imm_arg(c_ofs):
+        if _check_imm_arg(ofs):
             ofs_loc = imm(ofs)
         else:
-            ofs_loc = self._ensure_value_is_boxed(c_ofs, args)
+            ofs_loc = self._ensure_value_is_boxed(ConstInt(ofs), args)
         self.possibly_free_vars_for_op(op)
         self.free_temp_vars()
         result_loc = self.force_allocate_reg(op.result)
@@ -614,11 +613,10 @@
         base_loc = self._ensure_value_is_boxed(op.getarg(0), args)
         index_loc = self._ensure_value_is_boxed(op.getarg(1), args)
         value_loc = self._ensure_value_is_boxed(op.getarg(2), args)
-        c_ofs = ConstInt(ofs)
-        if _check_imm_arg(c_ofs):
+        if _check_imm_arg(ofs):
             ofs_loc = imm(ofs)
         else:
-            ofs_loc = self._ensure_value_is_boxed(c_ofs, args)
+            ofs_loc = self._ensure_value_is_boxed(ConstInt(ofs), args)
         return [base_loc, index_loc, value_loc, ofs_loc, imm(ofs),
                                         imm(itemsize), imm(fieldsize)]
 
@@ -640,8 +638,7 @@
         base_loc = self._ensure_value_is_boxed(args[0], args)
         ofs_loc = self._ensure_value_is_boxed(args[1], args)
         value_loc = self._ensure_value_is_boxed(args[2], args)
-        scratch_loc = self.rm.get_scratch_reg(INT, 
-                [base_loc, ofs_loc, value_loc])
+        scratch_loc = self.rm.get_scratch_reg(INT, args)
         assert _check_imm_arg(ofs)
         return [value_loc, base_loc, ofs_loc, scratch_loc, imm(scale), imm(ofs)]
     prepare_setarrayitem_raw = prepare_setarrayitem_gc
@@ -652,7 +649,7 @@
         scale = get_scale(size)
         base_loc = self._ensure_value_is_boxed(boxes[0], boxes)
         ofs_loc = self._ensure_value_is_boxed(boxes[1], boxes)
-        scratch_loc = self.rm.get_scratch_reg(INT, [base_loc, ofs_loc])
+        scratch_loc = self.rm.get_scratch_reg(INT, boxes)
         self.possibly_free_vars_for_op(op)
         self.free_temp_vars()
         res = self.force_allocate_reg(op.result)
diff --git a/pypy/jit/backend/ppc/runner.py b/pypy/jit/backend/ppc/runner.py
--- a/pypy/jit/backend/ppc/runner.py
+++ b/pypy/jit/backend/ppc/runner.py
@@ -97,7 +97,7 @@
         rffi.cast(TP, addr_of_force_index)[0] = ~fail_index
 
         # start of "no gc operation!" block
-        fail_index_2 = self.asm.failure_recovery_func(
+        fail_index_2 = self.asm.decode_registers_and_descr(
                 faildescr._failure_recovery_code, spilling_pointer)
         self.asm.leave_jitted_hook()
         # end of "no gc operation!" block


More information about the pypy-commit mailing list