[pypy-svn] r52060 - in pypy/branch/jit-refactoring/pypy: jit/rainbow jit/rainbow/test translator

arigo at codespeak.net arigo at codespeak.net
Sun Mar 2 18:42:49 CET 2008


Author: arigo
Date: Sun Mar  2 18:42:46 2008
New Revision: 52060

Modified:
   pypy/branch/jit-refactoring/pypy/jit/rainbow/portal.py
   pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_portal.py
   pypy/branch/jit-refactoring/pypy/translator/translator.py
Log:
Improve the --view for test_llinterp.py.  Now we should
be able to follow the call graph inside the JIT support code.


Modified: pypy/branch/jit-refactoring/pypy/jit/rainbow/portal.py
==============================================================================
--- pypy/branch/jit-refactoring/pypy/jit/rainbow/portal.py	(original)
+++ pypy/branch/jit-refactoring/pypy/jit/rainbow/portal.py	Sun Mar  2 18:42:46 2008
@@ -82,8 +82,10 @@
             FUNC = self.PORTAL_FUNCTYPE
             args_s = [annmodel.lltype_to_annotation(ARG) for ARG in FUNC.ARGS]
             s_result = annmodel.lltype_to_annotation(FUNC.RESULT)
-            portal_entry_graph_ptr = annhelper.delayedfunction(
+            self.portal_entry_graph = annhelper.getgraph(
                 self.portal_entry, args_s, s_result)
+            portal_entry_graph_ptr = annhelper.graph2delayed(
+                self.portal_entry_graph, FUNC)
             annhelper.finish()
 
         # the following gives a pdb prompt when portal_entry raises an exception

Modified: pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_portal.py
==============================================================================
--- pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_portal.py	(original)
+++ pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_portal.py	Sun Mar  2 18:42:46 2008
@@ -40,7 +40,11 @@
                         backendoptimize=backendoptimize)
 
         if conftest.option.view and self.small:
-            self.rtyper.annotator.translator.view()
+            if self.translate_support_code:
+                startgraph = self.rewriter.portal_entry_graph
+                self.rtyper.annotator.translator.viewcg(startgraph)
+            else:
+                self.rtyper.annotator.translator.view()
 
         # Populate the cache
         if len(self._cache_order) >= 3:

Modified: pypy/branch/jit-refactoring/pypy/translator/translator.py
==============================================================================
--- pypy/branch/jit-refactoring/pypy/translator/translator.py	(original)
+++ pypy/branch/jit-refactoring/pypy/translator/translator.py	Sun Mar  2 18:42:46 2008
@@ -142,18 +142,25 @@
         raise TypeError, "don't know about %r" % x
 
 
-    def view(self):
+    def view(self, graph=None):
         """Shows the control flow graph with annotations if computed.
         Requires 'dot' and pygame."""
         from pypy.translator.tool.graphpage import FlowGraphPage
-        FlowGraphPage(self).display()
+        if graph is None:
+            functions = None
+        else:
+            functions = [graph]
+        FlowGraphPage(self, functions).display()
 
-    def viewcg(self):
+    def viewcg(self, startgraph=None):
         """Shows the whole call graph and the class hierarchy, based on
         the computed annotations."""
-        from pypy.translator.tool.graphpage import TranslatorPage
-        TranslatorPage(self).display()
-
+        if startgraph is None:
+            from pypy.translator.tool.graphpage import TranslatorPage
+            TranslatorPage(self).display()
+        else:
+            from pypy.translator.tool.graphpage import LocalizedCallGraphPage
+            LocalizedCallGraphPage(self, [startgraph]).display()
 
 
 # _______________________________________________________________


More information about the pypy-svn mailing list