Sven Hager avatar Sven Hager committed 5730965

(bivab, hager): translation fixes

Comments (0)

Files changed (6)

pypy/jit/backend/arm/runner.py

                             (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)

pypy/jit/backend/ppc/ppcgen/helper/assembler.py

 
 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)
 

pypy/jit/backend/ppc/ppcgen/helper/regalloc.py

     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()
     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:
     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]

pypy/jit/backend/ppc/ppcgen/ppc_assembler.py

         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):
             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

pypy/jit/backend/ppc/ppcgen/regalloc.py

                 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()
         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)
         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)]
 
         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
         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)

pypy/jit/backend/ppc/runner.py

         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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.