[pypy-svn] r37561 - in pypy/dist/pypy: jit/timeshifter translator/tool

ac at codespeak.net ac at codespeak.net
Mon Jan 29 19:56:48 CET 2007


Author: ac
Date: Mon Jan 29 19:56:45 2007
New Revision: 37561

Modified:
   pypy/dist/pypy/jit/timeshifter/hrtyper.py
   pypy/dist/pypy/translator/tool/graphpage.py
   pypy/dist/pypy/translator/tool/make_dot.py
Log:
(pedronis, arre) Whack at the portal, portal_entry and portal_reentry graphs
to make them be in the graph lists properly, allso sort graphs on tag when
viewing them.



Modified: pypy/dist/pypy/jit/timeshifter/hrtyper.py
==============================================================================
--- pypy/dist/pypy/jit/timeshifter/hrtyper.py	(original)
+++ pypy/dist/pypy/jit/timeshifter/hrtyper.py	Mon Jan 29 19:56:45 2007
@@ -280,6 +280,9 @@
         tsportalgraph = portalgraph
         # patch the shared portal pointer
         portalgraph = flowmodel.copygraph(tsportalgraph, shallow=True)
+        portalgraph.tag = 'portal'
+        self.annotator.translator.graphs.append(portalgraph)
+
         portal_fnptr = self.naked_tsfnptr(self.portalgraph)
         portal_fnptr._obj.graph = portalgraph
         
@@ -381,7 +384,8 @@
         s_result = annmodel.lltype_to_annotation(
                     origportalgraph.getreturnvar().concretetype)
         portalentrygraph = annhelper.getgraph(portalentry, args_s, s_result)
-        portalentrygraph.tag = "portal_entry"
+        x = self.annotator.base_translator.graphs.pop()
+        assert portalentrygraph is x
 
         s_funcptr = annmodel.SomePtr(lltype.Ptr(FUNC))
         self.readportalgraph = annhelper.getgraph(readportal, args_s,
@@ -451,17 +455,22 @@
 
         portalreentrygraph = annhelper.getgraph(portalreentry,
                 [self.s_JITState] + portal_args_s, self.s_JITState)
-        portalreentrygraph.tag = "portal_reentry"
+        x = self.annotator.base_translator.graphs.pop()
+        assert portalreentrygraph is x
 
         annhelper.finish()
 
         origportalgraph.startblock = portalentrygraph.startblock
         origportalgraph.returnblock = portalentrygraph.returnblock
         origportalgraph.exceptblock = portalentrygraph.exceptblock
+        origportalgraph.tag = "PortalEntry"
+        origportalgraph.name += '_portal_entry'
 
         tsportalgraph.startblock = portalreentrygraph.startblock
         tsportalgraph.returnblock = portalreentrygraph.returnblock
         tsportalgraph.exceptblock = portalreentrygraph.exceptblock
+        tsportalgraph.tag = "PortalReentry"
+        tsportalgraph.name += '_portal_reentry'        
         
 
     def transform_graph(self, graph, is_portal=False):

Modified: pypy/dist/pypy/translator/tool/graphpage.py
==============================================================================
--- pypy/dist/pypy/translator/tool/graphpage.py	(original)
+++ pypy/dist/pypy/translator/tool/graphpage.py	Mon Jan 29 19:56:45 2007
@@ -121,6 +121,7 @@
                 graphs = list(graphs)
                 graphs += graphsof(translator, translator.entrypoint)
         gs = [(graph.name, graph) for graph in graphs]
+        gs.sort(lambda (_, g), (__ ,h): cmp(g.tag, h.tag))
         if self.annotator and self.annotator.blocked_graphs:
             for block, was_annotated in self.annotator.annotated.items():
                 if not was_annotated:

Modified: pypy/dist/pypy/translator/tool/make_dot.py
==============================================================================
--- pypy/dist/pypy/translator/tool/make_dot.py	(original)
+++ pypy/dist/pypy/translator/tool/make_dot.py	Mon Jan 29 19:56:45 2007
@@ -77,8 +77,9 @@
 
 TAG_TO_COLORS = {
     "timeshifted":  "#cfa5f0",
-    "portal_entry": "#84abf0",
-    "portal_reentry": "#f084c2",
+    "portal":       "#cfa5f0",
+    "PortalEntry": "#84abf0",
+    "PortalReentry": "#f084c2",
 }
 DEFAULT_TAG_COLOR = "#a5e6f0"
 RETURN_COLOR = "green"



More information about the Pypy-commit mailing list