David Schneider avatar David Schneider committed 55a59cc

(fijal, bivab) fix test_gc_integration on ARM. When calling the writebarrier on
the jitframe the argument was not passed correctly

Comments (0)

Files changed (3)

rpython/jit/backend/arm/assembler.py

             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)

rpython/jit/backend/arm/opassembler.py

                                     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:

rpython/jit/backend/llsupport/test/test_gc_integration.py

             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 = '''
 
         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
         
         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
         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
         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)
         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
+
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.