Author: Richard Plangger <planri...@gmail.com>
Branch: s390x-backend
Changeset: r81878:1dcc4c9a8961
Date: 2016-01-20 14:17 +0100
http://bitbucket.org/pypy/pypy/changeset/1dcc4c9a8961/

Log:    did not write pool entires to the right location

diff --git a/rpython/jit/backend/zarch/assembler.py 
b/rpython/jit/backend/zarch/assembler.py
--- a/rpython/jit/backend/zarch/assembler.py
+++ b/rpython/jit/backend/zarch/assembler.py
@@ -1181,7 +1181,7 @@
             self.mc.b_offset(descr._ll_loop_code + self.mc.LARL_byte_count)
         else:
             # restore the pool address
-            offset = self.pool.get_offset(descr) + \
+            offset = self.pool.get_descr_offset(descr) + \
                      JUMPABS_TARGET_ADDR__POOL_OFFSET
             offset_pool = offset + JUMPABS_POOL_ADDR_POOL_OFFSET
             self.mc.LG(r.SCRATCH, l.pool(offset))
diff --git a/rpython/jit/backend/zarch/pool.py 
b/rpython/jit/backend/zarch/pool.py
--- a/rpython/jit/backend/zarch/pool.py
+++ b/rpython/jit/backend/zarch/pool.py
@@ -92,6 +92,9 @@
             if arg.is_constant():
                 self.reserve_literal(8, arg)
 
+    def get_descr_offset(self, descr):
+        return self.offset_descr[descr]
+
     def get_offset(self, box):
         assert box.is_constant()
         uvalue = self.unique_value(box)
@@ -171,18 +174,17 @@
         if self.constant_64_zeros != -1:
             self.constant_64_zeros = self.ensure_value(0x0)
         if self.constant_64_sign_bit != -1:
-            self.constant_64_zeros = self.ensure_value(-2**63) # == 
0x8000000000000000
+            self.constant_64_sign_bit = self.ensure_value(-2**63) # == 
0x8000000000000000
         if self.constant_max_64_positive != -1:
             self.constant_max_64_positive = 
self.ensure_value(0x7fffFFFFffffFFFF)
+        asm.mc.write('\x00' * self.size)
         wrote = 0
         for val, offset in self.offset_map.items():
             if not we_are_translated():
                 print('pool: %s at offset: %d' % (val, offset))
-            asm.mc.write_i64(val)
+            self.overwrite_64(asm.mc, offset, val)
             wrote += 8
-        self.offset_map = {}
         # for the descriptors
-        asm.mc.write('\x00' * (self.size - wrote))
         if not we_are_translated():
             print "pool with %d quad words" % (self.size // 8)
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to