[pypy-commit] pypy ppc-jit-backend: use temp_loc in emit_STRSETITEM

hager noreply at buildbot.pypy.org
Tue Feb 14 11:21:27 CET 2012


Author: hager <sven.hager at uni-duesseldorf.de>
Branch: ppc-jit-backend
Changeset: r52441:971b484130cc
Date: 2012-02-14 11:21 +0100
http://bitbucket.org/pypy/pypy/changeset/971b484130cc/

Log:	use temp_loc in emit_STRSETITEM

diff --git a/pypy/jit/backend/ppc/opassembler.py b/pypy/jit/backend/ppc/opassembler.py
--- a/pypy/jit/backend/ppc/opassembler.py
+++ b/pypy/jit/backend/ppc/opassembler.py
@@ -688,12 +688,12 @@
         self.mc.lbz(res.value, res.value, basesize.value)
 
     def emit_strsetitem(self, op, arglocs, regalloc):
-        value_loc, base_loc, ofs_loc, basesize = arglocs
+        value_loc, base_loc, ofs_loc, temp_loc, basesize = arglocs
         if ofs_loc.is_imm():
-            self.mc.addi(base_loc.value, base_loc.value, ofs_loc.getint())
+            self.mc.addi(temp_loc.value, base_loc.value, ofs_loc.getint())
         else:
-            self.mc.add(base_loc.value, base_loc.value, ofs_loc.value)
-        self.mc.stb(value_loc.value, base_loc.value, basesize.value)
+            self.mc.add(temp_loc.value, base_loc.value, ofs_loc.value)
+        self.mc.stb(value_loc.value, temp_loc.value, basesize.value)
 
     #from ../x86/regalloc.py:928 ff.
     def emit_copystrcontent(self, op, arglocs, regalloc):
diff --git a/pypy/jit/backend/ppc/regalloc.py b/pypy/jit/backend/ppc/regalloc.py
--- a/pypy/jit/backend/ppc/regalloc.py
+++ b/pypy/jit/backend/ppc/regalloc.py
@@ -701,10 +701,11 @@
         base_loc = self._ensure_value_is_boxed(boxes[0], boxes)
         ofs_loc = self._ensure_value_is_boxed(boxes[1], boxes)
         value_loc = self._ensure_value_is_boxed(boxes[2], boxes)
+        temp_loc = self.get_scratch_reg(INT, boxes)
         basesize, itemsize, ofs_length = symbolic.get_array_token(rstr.STR,
                                          self.cpu.translate_support_code)
         assert itemsize == 1
-        return [value_loc, base_loc, ofs_loc, imm(basesize)]
+        return [value_loc, base_loc, ofs_loc, temp_loc, imm(basesize)]
 
     prepare_copystrcontent = void
     prepare_copyunicodecontent = void


More information about the pypy-commit mailing list