[pypy-svn] r65268 - in pypy/branch/pyjitpl5/pypy/rpython: lltypesystem memory/gc memory/gctransform

arigo at codespeak.net arigo at codespeak.net
Fri May 15 14:28:01 CEST 2009


Author: arigo
Date: Fri May 15 14:27:58 2009
New Revision: 65268

Modified:
   pypy/branch/pyjitpl5/pypy/rpython/lltypesystem/lloperation.py
   pypy/branch/pyjitpl5/pypy/rpython/memory/gc/generation.py
   pypy/branch/pyjitpl5/pypy/rpython/memory/gctransform/framework.py
Log:
In-progress: write barrier support.  This just adds the necessary
support to the GC.


Modified: pypy/branch/pyjitpl5/pypy/rpython/lltypesystem/lloperation.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/rpython/lltypesystem/lloperation.py	(original)
+++ pypy/branch/pyjitpl5/pypy/rpython/lltypesystem/lloperation.py	Fri May 15 14:27:58 2009
@@ -388,6 +388,7 @@
     'get_exception_addr':   LLOp(),
     'get_exc_value_addr':   LLOp(),
     'do_malloc_fixedsize_clear': LLOp(),
+    'get_write_barrier_failing_case': LLOp(sideeffects=False),
 
     # __________ GC operations __________
 

Modified: pypy/branch/pyjitpl5/pypy/rpython/memory/gc/generation.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/rpython/memory/gc/generation.py	(original)
+++ pypy/branch/pyjitpl5/pypy/rpython/memory/gc/generation.py	Fri May 15 14:27:58 2009
@@ -407,6 +407,10 @@
                     continue    # no need to remember this weakref any longer
             self.objects_with_weakrefs.append(obj)
 
+    # for the JIT: a minimal description of the write_barrier() method
+    JIT_WB_IF_FLAG = GCFLAG_NO_YOUNG_PTRS
+    JIT_WB_THEN_CALL = 'remember_young_pointer'
+
     def write_barrier(self, newvalue, addr_struct):
         if self.header(addr_struct).tid & GCFLAG_NO_YOUNG_PTRS:
             self.remember_young_pointer(addr_struct, newvalue)

Modified: pypy/branch/pyjitpl5/pypy/rpython/memory/gctransform/framework.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/rpython/memory/gctransform/framework.py	(original)
+++ pypy/branch/pyjitpl5/pypy/rpython/memory/gctransform/framework.py	Fri May 15 14:27:58 2009
@@ -340,6 +340,12 @@
                                             annmodel.SomeAddress()],
                                            annmodel.s_None,
                                            inline=True)
+            func = getattr(GCClass, GCClass.JIT_WB_THEN_CALL).im_func
+            self.write_barrier_failing_case_ptr = getfn(func,
+                                           [s_gc,
+                                            annmodel.SomeAddress(),
+                                            annmodel.SomeAddress()],
+                                           annmodel.s_None)
         else:
             self.write_barrier_ptr = None
         self.statistics_ptr = getfn(GCClass.statistics.im_func,
@@ -607,6 +613,15 @@
                    v_has_finalizer, v_contains_weakptr],
                   resultvar=op.result)
 
+    def gct_get_write_barrier_failing_case(self, hop):
+        op = hop.spaceop
+        c_result = rmodel.inputconst(
+            lltype.typeOf(self.write_barrier_failing_case_ptr),
+            self.write_barrier_failing_case_ptr)
+        hop.genop("same_as",
+                  [c_result],
+                  resultvar=op.result)
+
     def gct_zero_gc_pointers_inside(self, hop):
         if not self.malloc_zero_filled:
             v_ob = hop.spaceop.args[0]



More information about the Pypy-commit mailing list