Author: Maciej Fijalkowski <fij...@gmail.com>
Branch: optresult-unroll
Changeset: r79358:74406ff51f52
Date: 2015-09-01 17:30 +0200
http://bitbucket.org/pypy/pypy/changeset/74406ff51f52/

Log:    merge

diff --git a/rpython/jit/metainterp/compile.py 
b/rpython/jit/metainterp/compile.py
--- a/rpython/jit/metainterp/compile.py
+++ b/rpython/jit/metainterp/compile.py
@@ -789,6 +789,7 @@
         new_loop.original_jitcell_token = 
metainterp.resumekey_original_loop_token
         inputargs = new_loop.inputargs
         if not we_are_translated():
+            self._debug_subinputargs = new_loop.inputargs
             self._debug_suboperations = new_loop.operations
         propagate_original_jitcell_token(new_loop)
         send_bridge_to_backend(metainterp.jitdriver_sd, metainterp.staticdata,
diff --git a/rpython/jit/metainterp/graphpage.py 
b/rpython/jit/metainterp/graphpage.py
--- a/rpython/jit/metainterp/graphpage.py
+++ b/rpython/jit/metainterp/graphpage.py
@@ -4,11 +4,21 @@
 from rpython.jit.metainterp.resoperation import rop
 
 class SubGraph:
-    def __init__(self, suboperations):
-        self.suboperations = suboperations
+    def __init__(self, op):
+        self.failargs = op.getfailargs()
+        self.subinputargs = op.getdescr()._debug_subinputargs
+        self.suboperations = op.getdescr()._debug_suboperations
     def get_operations(self):
         return self.suboperations
-    def get_display_text(self):
+    def get_display_text(self, memo):
+        # copy the display of variables in this subgraph (a bridge)
+        # so that they match variables in the parent graph across the
+        # guard failure
+        for failarg, inputarg in zip(self.failargs, self.subinputargs):
+            try:
+                memo[inputarg] = memo[failarg]
+            except KeyError:
+                pass
         return None
 
 def display_procedures(procedures, errmsg=None, highlight_procedures={}, 
metainterp_sd=None):
@@ -17,8 +27,7 @@
     for graph, highlight in graphs:
         for op in graph.get_operations():
             if is_interesting_guard(op):
-                graphs.append((SubGraph(op.getdescr()._debug_suboperations),
-                               highlight))
+                graphs.append((SubGraph(op), highlight))
     graphpage = ResOpGraphPage(graphs, errmsg, metainterp_sd)
     graphpage.display()
 
@@ -126,7 +135,7 @@
         graphname = self.getgraphname(graphindex)
         if self.CLUSTERING:
             self.dotgen.emit('subgraph cluster%d {' % graphindex)
-        label = graph.get_display_text()
+        label = graph.get_display_text(self.memo)
         if label is not None:
             colorindex = self.highlight_graphs.get(graph, 0)
             if colorindex == 1:
@@ -200,9 +209,10 @@
         for op in self.all_operations:
             args = op.getarglist() + [op]
             for box in args:
-                if getattr(box, 'is_box', False):
-                    boxes[box] = True
+                s = box.repr_short(self.memo)
+                if len(s) > 1 and s[0] in 'irf' and s[1:].isdigit():
+                    boxes[box] = s
         links = {}
-        for box in boxes:
-            links[str(box)] = repr(box), self.BOX_COLOR
+        for box, s in boxes.items():
+            links.setdefault(s, (box.repr(self.memo), self.BOX_COLOR))
         return links
diff --git a/rpython/jit/metainterp/history.py 
b/rpython/jit/metainterp/history.py
--- a/rpython/jit/metainterp/history.py
+++ b/rpython/jit/metainterp/history.py
@@ -506,8 +506,10 @@
     def get_operations(self):
         return self.operations
 
-    def get_display_text(self):    # for graphpage.py
-        return self.name + '\n' + repr(self.inputargs)
+    def get_display_text(self, memo):    # for graphpage.py
+        return '%s\n[%s]' % (
+            self.name,
+            ', '.join([box.repr(memo) for box in self.inputargs]))
 
     def show(self, errmsg=None):
         "NOT_RPYTHON"
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to