Commits

Sven Hager committed f14a20d

kill _malloc_varsize and _regalloc_malloc_varsize

Comments (0)

Files changed (2)

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

         self.emit_call(op, arglocs, regalloc)
         self.propagate_memoryerror_if_r3_is_null()
 
-    # from: ../x86/regalloc.py:750
-    # called from regalloc
-    # XXX kill this function at some point
-    def _regalloc_malloc_varsize(self, size, size_box, vloc, vbox,
-            ofs_items_loc, regalloc, result):
-        if IS_PPC_32:
-            self.mc.mullw(size.value, size.value, vloc.value)
-        else:
-            self.mc.mulld(size.value, size.value, vloc.value)
-        if ofs_items_loc.is_imm():
-            self.mc.addi(size.value, size.value, ofs_items_loc.value)
-        else:
-            self.mc.add(size.value, size.value, ofs_items_loc.value)
-        force_index = self.write_new_force_index()
-        regalloc.force_spill_var(vbox)
-        self._emit_call(force_index, self.malloc_func_addr, [size_box], regalloc,
-                                    result=result)
-
     def set_vtable(self, box, vtable):
         if self.cpu.vtable_offset is not None:
             adr = rffi.cast(lltype.Signed, vtable)

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

             arglocs.append(t)
         return arglocs
 
-    def _malloc_varsize(self, ofs_items, ofs_length, itemsize, op):
-        v = op.getarg(0)
-        res_v = op.result
-        boxes = [v, res_v]
-        itemsize_box = ConstInt(itemsize)
-        ofs_items_box = ConstInt(ofs_items)
-        if _check_imm_arg(ofs_items_box):
-            ofs_items_loc = self.convert_to_imm(ofs_items_box)
-        else:
-            ofs_items_loc, ofs_items_box = self._ensure_value_is_boxed(ofs_items_box, boxes)
-            boxes.append(ofs_items_box)
-        vloc, vbox = self._ensure_value_is_boxed(v, [res_v])
-        boxes.append(vbox)
-        size, size_box = self._ensure_value_is_boxed(itemsize_box, boxes)
-        boxes.append(size_box)
-        self.assembler._regalloc_malloc_varsize(size, size_box,
-                                vloc, vbox, ofs_items_loc, self, res_v)
-        base_loc = self.make_sure_var_in_reg(res_v)
-
-        value_loc, vbox = self._ensure_value_is_boxed(v, [res_v])
-        boxes.append(vbox)
-        self.possibly_free_vars(boxes)
-        assert value_loc.is_reg()
-        assert base_loc.is_reg()
-        return [value_loc, base_loc, imm(ofs_length)]
-
     # from ../x86/regalloc.py:791
     def _unpack_fielddescr(self, fielddescr):
         assert isinstance(fielddescr, BaseFieldDescr)