[pypy-commit] pypy shadowstack-perf-2: Corner case fix (seems to occur only once, with

arigo pypy.commits at gmail.com
Tue May 17 04:49:23 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: shadowstack-perf-2
Changeset: r84505:0a9b5a916ce6
Date: 2016-05-17 10:43 +0200
http://bitbucket.org/pypy/pypy/changeset/0a9b5a916ce6/

Log:	Corner case fix (seems to occur only once, with
	semispace/generational/hybrid GCs)

diff --git a/rpython/memory/gctransform/shadowcolor.py b/rpython/memory/gctransform/shadowcolor.py
--- a/rpython/memory/gctransform/shadowcolor.py
+++ b/rpython/memory/gctransform/shadowcolor.py
@@ -629,3 +629,4 @@
     add_enter_roots_frame(graph, regalloc, c_gcdata)
     checkgraph(graph)
     postprocess_double_check(graph)
+    return (regalloc is not None)
diff --git a/rpython/memory/gctransform/shadowstack.py b/rpython/memory/gctransform/shadowstack.py
--- a/rpython/memory/gctransform/shadowstack.py
+++ b/rpython/memory/gctransform/shadowstack.py
@@ -10,6 +10,7 @@
 from rpython.memory.gctransform.framework import (
      BaseFrameworkGCTransformer, BaseRootWalker, sizeofaddr)
 from rpython.rtyper.rbuiltin import gen_cast
+from rpython.memory.gctransform.log import log
 
 
 class ShadowStackFrameworkGCTransformer(BaseFrameworkGCTransformer):
@@ -219,7 +220,11 @@
 
     def postprocess_graph(self, gct, graph):
         from rpython.memory.gctransform import shadowcolor
-        shadowcolor.postprocess_graph(graph, gct.c_const_gcdata)
+        use_push_pop = shadowcolor.postprocess_graph(graph, gct.c_const_gcdata)
+        if use_push_pop and graph in gct.graphs_to_inline:
+            log.WARNING("%r is marked for later inlining, "
+                        "but is using push/pop roots.  Disabled" % (graph,))
+            del gct.graphs_to_inline[graph]
 
 # ____________________________________________________________
 


More information about the pypy-commit mailing list