Commits

Armin Rigo committed abb1e07

We don't need do_write_barrier() any more.

Comments (0)

Files changed (2)

rpython/jit/backend/llsupport/gc.py

         return True
     def initialize(self):
         pass
-    def do_write_barrier(self, gcref_struct, gcref_newptr):
-        pass
     def can_use_nursery_malloc(self, size):
         return False
     def has_write_barrier_class(self):
         hdr = llmemory.cast_adr_to_ptr(hdr_addr, self.HDRPTR)
         hdr.tid = tid
 
-    def do_write_barrier(self, gcref_struct, gcref_newptr):
-        hdr_addr = llmemory.cast_ptr_to_adr(gcref_struct)
-        hdr_addr -= self.gcheaderbuilder.size_gc_header
-        hdr = llmemory.cast_adr_to_ptr(hdr_addr, self.HDRPTR)
-        if hdr.tid & self.GCClass.JIT_WB_IF_FLAG:
-            # get a pointer to the 'remember_young_pointer' function from
-            # the GC, and call it immediately
-            llop1 = self.llop1
-            funcptr = llop1.get_write_barrier_failing_case(self.WB_FUNCPTR)
-            funcptr(llmemory.cast_ptr_to_adr(gcref_struct))
-
     def can_use_nursery_malloc(self, size):
         return size < self.max_size_of_young_obj
 

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

                                       repr(basesize), repr(itemsize),
                                       repr(ofs_length), p)]
 
-    def test_do_write_barrier(self):
-        gc_ll_descr = self.gc_ll_descr
-        R = lltype.GcStruct('R')
-        S = lltype.GcStruct('S', ('r', lltype.Ptr(R)))
-        s = lltype.malloc(S)
-        r = lltype.malloc(R)
-        s_hdr = gc_ll_descr.gcheaderbuilder.new_header(s)
-        s_gcref = lltype.cast_opaque_ptr(llmemory.GCREF, s)
-        r_gcref = lltype.cast_opaque_ptr(llmemory.GCREF, r)
-        s_adr = llmemory.cast_ptr_to_adr(s)
-        llmemory.cast_ptr_to_adr(r)
-        #
-        s_hdr.tid &= ~gc_ll_descr.GCClass.JIT_WB_IF_FLAG
-        gc_ll_descr.do_write_barrier(s_gcref, r_gcref)
-        assert self.llop1.record == []    # not called
-        #
-        s_hdr.tid |= gc_ll_descr.GCClass.JIT_WB_IF_FLAG
-        gc_ll_descr.do_write_barrier(s_gcref, r_gcref)
-        assert self.llop1.record == [('barrier', s_adr)]
-
     def test_gen_write_barrier(self):
         gc_ll_descr = self.gc_ll_descr
         llop1 = self.llop1