[pypy-commit] pypy default: (fijal, bivab) fix test_gc_integration on ARM. When calling the writebarrier on
bivab
noreply at buildbot.pypy.org
Fri Apr 5 17:20:43 CEST 2013
Author: David Schneider <david.schneider at picle.org>
Branch:
Changeset: r63062:55a59cc5a0b5
Date: 2013-04-05 17:06 +0200
http://bitbucket.org/pypy/pypy/changeset/55a59cc5a0b5/
Log: (fijal, bivab) fix test_gc_integration on ARM. When calling the
writebarrier on the jitframe the argument was not passed correctly
diff --git a/rpython/jit/backend/arm/assembler.py b/rpython/jit/backend/arm/assembler.py
--- a/rpython/jit/backend/arm/assembler.py
+++ b/rpython/jit/backend/arm/assembler.py
@@ -526,9 +526,7 @@
self.gen_shadowstack_header(gcrootmap)
def gen_shadowstack_header(self, gcrootmap):
- # we need to put two words into the shadowstack: the MARKER_FRAME
- # and the address of the frame (fp, actually)
- # lr = rst addr
+ # lr = shadow stack top addr
# ip = *lr
rst = gcrootmap.get_root_stack_top_addr()
self.mc.gen_load_int(r.lr.value, rst)
diff --git a/rpython/jit/backend/arm/opassembler.py b/rpython/jit/backend/arm/opassembler.py
--- a/rpython/jit/backend/arm/opassembler.py
+++ b/rpython/jit/backend/arm/opassembler.py
@@ -628,12 +628,14 @@
bool(self._regalloc.vfprm.reg_bindings))
assert self.wb_slowpath[helper_num] != 0
#
- if not is_frame and loc_base is not r.r0:
+ if loc_base is not r.r0:
# push two registers to keep stack aligned
mc.PUSH([r.r0.value, loc_base.value])
- remap_frame_layout(self, [loc_base], [r.r0], r.ip)
+ mc.MOV_rr(r.r0.value, loc_base.value)
+ if is_frame:
+ assert loc_base is r.fp
mc.BL(self.wb_slowpath[helper_num])
- if not is_frame and loc_base is not r.r0:
+ if loc_base is not r.r0:
mc.POP([r.r0.value, loc_base.value])
if card_marking:
diff --git a/rpython/jit/backend/llsupport/test/test_gc_integration.py b/rpython/jit/backend/llsupport/test/test_gc_integration.py
--- a/rpython/jit/backend/llsupport/test/test_gc_integration.py
+++ b/rpython/jit/backend/llsupport/test/test_gc_integration.py
@@ -256,7 +256,9 @@
if self.cpu.IS_64_BIT:
assert frame.jf_gcmap[idx] == (1<<29) | (1 << 30)
else:
- assert frame.jf_gcmap[idx] == (1<<24) | (1 << 23)
+ assert frame.jf_gcmap[idx]
+ exp_idx = self.cpu.JITFRAME_FIXED_SIZE - 32 * idx + 1 # +1 from i0
+ assert frame.jf_gcmap[idx] == (1 << (exp_idx + 1)) | (1 << exp_idx)
self.cpu = self.getcpu(check)
ops = '''
@@ -680,7 +682,7 @@
def f(frame, x):
# all the gc pointers are alive p1 -> p7 (but not p0)
- assert bin(frame.jf_gcmap[0]).count('1') == 7
+ assert getmap(frame).count('1') == 7 #
assert x == 1
return 2
@@ -713,7 +715,7 @@
def f(frame, arg, x):
assert not arg
assert frame.jf_gcmap[0] & 31 == 0
- assert bin(frame.jf_gcmap[0]).count('1') == 3 # p1, p2, p3, but
+ assert getmap(frame).count('1') == 3 # p1, p2, p3, but
# not in registers
frame.jf_descr = frame.jf_force_descr # make guard_not_forced fail
assert x == 1
@@ -749,7 +751,8 @@
cpu.compile_loop(loop.inputargs, loop.operations, token)
frame = lltype.cast_opaque_ptr(JITFRAMEPTR,
cpu.execute_token(token, 1, a))
- assert bin(frame.jf_gcmap[0]).count('1') == 4
+
+ assert getmap(frame).count('1') == 4
def test_call_gcmap_no_guard(self):
cpu = self.cpu
@@ -757,7 +760,7 @@
def f(frame, arg, x):
assert not arg
assert frame.jf_gcmap[0] & 31 == 0
- assert bin(frame.jf_gcmap[0]).count('1') == 3 # p1, p2, p3
+ assert getmap(frame).count('1') == 3 # p1, p2, p3
frame.jf_descr = frame.jf_force_descr # make guard_not_forced fail
assert x == 1
return lltype.nullptr(llmemory.GCREF.TO)
@@ -792,4 +795,5 @@
cpu.compile_loop(loop.inputargs, loop.operations, token)
frame = lltype.cast_opaque_ptr(JITFRAMEPTR,
cpu.execute_token(token, 1, a))
- assert bin(frame.jf_gcmap[0]).count('1') == 4
+ assert getmap(frame).count('1') == 4
+
More information about the pypy-commit
mailing list