[pypy-svn] r77622 - in pypy/branch/32ptr-on-64bit/pypy: config rpython rpython/memory/gctransform

arigo at codespeak.net arigo at codespeak.net
Tue Oct 5 19:10:48 CEST 2010


Author: arigo
Date: Tue Oct  5 19:10:46 2010
New Revision: 77622

Modified:
   pypy/branch/32ptr-on-64bit/pypy/config/translationoption.py
   pypy/branch/32ptr-on-64bit/pypy/rpython/memory/gctransform/framework.py
   pypy/branch/32ptr-on-64bit/pypy/rpython/rbuiltin.py
Log:
Fix fix fix...


Modified: pypy/branch/32ptr-on-64bit/pypy/config/translationoption.py
==============================================================================
--- pypy/branch/32ptr-on-64bit/pypy/config/translationoption.py	(original)
+++ pypy/branch/32ptr-on-64bit/pypy/config/translationoption.py	Tue Oct  5 19:10:46 2010
@@ -197,7 +197,8 @@
                default=False, cmdline="--compressptr",
                requires=[("translation.type_system", "lltype"),
                          ("translation.taggedpointers", False),
-                         ("translation.gc", "minimark")]    # for now
+                         ("translation.gc", "minimark"),    # for now
+                         ("translation.gcrootfinder", "shadowstack")]  # xxx
                + [("compressptr (64-bit only)", True)]*(not IS_64_BITS)),
 
     # options for ootype

Modified: pypy/branch/32ptr-on-64bit/pypy/rpython/memory/gctransform/framework.py
==============================================================================
--- pypy/branch/32ptr-on-64bit/pypy/rpython/memory/gctransform/framework.py	(original)
+++ pypy/branch/32ptr-on-64bit/pypy/rpython/memory/gctransform/framework.py	Tue Oct  5 19:10:46 2010
@@ -1166,6 +1166,9 @@
                 c_k = rmodel.inputconst(lltype.Signed, k)
                 v_newaddr = hop.genop("raw_load", [base_addr, c_type, c_k],
                                       resulttype=llmemory.Address)
+                if var.concretetype == llmemory.HiddenGcRef32:
+                    v_newaddr = gen_cast(hop.llops, llmemory.HiddenGcRef32,
+                                         v_newaddr)
                 hop.genop("gc_reload_possibly_moved", [v_newaddr, var])
 
     def compute_borrowed_vars(self, graph):

Modified: pypy/branch/32ptr-on-64bit/pypy/rpython/rbuiltin.py
==============================================================================
--- pypy/branch/32ptr-on-64bit/pypy/rpython/rbuiltin.py	(original)
+++ pypy/branch/32ptr-on-64bit/pypy/rpython/rbuiltin.py	Tue Oct  5 19:10:46 2010
@@ -464,12 +464,20 @@
             else:
                 return llops.genop('cast_pointer', [v_value], resulttype = TGT)
         elif ORIG == llmemory.Address:
-            return llops.genop('cast_adr_to_ptr', [v_value], resulttype = TGT)
+            if TGT == llmemory.HiddenGcRef32:
+                return llops.genop('hide_into_ptr32', [v_value],
+                                   resulttype = TGT)
+            else:
+                return llops.genop('cast_adr_to_ptr', [v_value],
+                                   resulttype = TGT)
         elif isinstance(ORIG, lltype.Primitive):
             v_value = gen_cast(llops, lltype.Signed, v_value)            
             return llops.genop('cast_int_to_ptr', [v_value], resulttype=TGT)
     elif TGT == llmemory.Address and isinstance(ORIG, lltype.Ptr):
-        return llops.genop('cast_ptr_to_adr', [v_value], resulttype = TGT)
+        if ORIG == llmemory.HiddenGcRef32:
+            return llops.genop('show_from_ptr32', [v_value], resulttype = TGT)
+        else:
+            return llops.genop('cast_ptr_to_adr', [v_value], resulttype = TGT)
     elif isinstance(TGT, lltype.Primitive):
         if isinstance(ORIG, lltype.Ptr):
             v_value = llops.genop('cast_ptr_to_int', [v_value],



More information about the Pypy-commit mailing list