Commits

Remi Meier committed 8291074

seems to fix one bug - reload frame after stm_invalidate_jmp_buf

Comments (0)

Files changed (2)

rpython/jit/backend/llsupport/assembler.py

         else:
             self.gc_size_of_header = WORD # for tests
         self.memcpy_addr = self.cpu.cast_ptr_to_int(memcpy_fn)
-        self._build_failure_recovery(False, withfloats=False)
-        self._build_failure_recovery(True, withfloats=False)
         if gc_ll_descr.stm:
             descrs = [gc_ll_descr.P2Rdescr, gc_ll_descr.P2Wdescr]
         else:
             self._build_b_slowpath(d, False)
             self._build_b_slowpath(d, True)
             self._build_b_slowpath(d, False, for_frame=True)
+        # building the barriers needs to happen before these:
+        self._build_failure_recovery(False, withfloats=False)
+        self._build_failure_recovery(True, withfloats=False)
         # only for stm:
         if gc_ll_descr.stm:
             self._build_ptr_eq_slowpath()

rpython/jit/backend/x86/assembler.py

         if not withcards:
             func = descr.get_barrier_fn(self.cpu, 
                                         returns_modified_object=is_stm)
+            assert func is not None
         else:
             assert not is_stm
             if descr.jit_wb_cards_set == 0:
             self.mc.LEA_rs(edi.value, FRAME_FIXED_SIZE * WORD)
             fn = stmtlocal.stm_invalidate_jmp_buf_fn
             self.mc.CALL(imm(self.cpu.cast_ptr_to_int(fn)))
+            # there could have been a collection in invalidate_jmp_buf()
+            self._reload_frame_if_necessary(self.mc)
 
         # the return value is the jitframe
         self.mc.MOV_rr(eax.value, ebp.value)
             mc.SUB_ri(esp.value, 16 - WORD) # erase the return address
             # ||retadr|...||
         func = descr.get_b_slowpath(helper_num)
+        assert func != 0
         mc.CALL(imm(func))
         # get result:
         if is_frame: