[pypy-svn] r35356 - pypy/branch/jit-real-world/pypy/jit/timeshifter

arigo at codespeak.net arigo at codespeak.net
Wed Dec 6 03:06:47 CET 2006


Author: arigo
Date: Wed Dec  6 03:06:36 2006
New Revision: 35356

Modified:
   pypy/branch/jit-real-world/pypy/jit/timeshifter/transform.py
Log:
(pedronis, arigo)
Fix the graph->tsgraph mapping, along the lines of "how could it ever work".


Modified: pypy/branch/jit-real-world/pypy/jit/timeshifter/transform.py
==============================================================================
--- pypy/branch/jit-real-world/pypy/jit/timeshifter/transform.py	(original)
+++ pypy/branch/jit-real-world/pypy/jit/timeshifter/transform.py	Wed Dec  6 03:06:36 2006
@@ -115,11 +115,15 @@
             c = 'red'
         return c
 
-    def timeshifted_graph_of(self, graph, args_v):
+    def timeshifted_graph_of(self, graph, args_v, v_result):
         bk = self.hannotator.bookkeeper
         args_hs = [self.hannotator.binding(v) for v in args_v]
-        # fixed is always false here
-        specialization_key = bk.specialization_key(False, args_hs)
+        hs_result = self.hannotator.binding(v_result)
+        if isinstance(hs_result, hintmodel.SomeLLAbstractConstant):
+            fixed = hs_result.is_fixed()
+        else:
+            fixed = False
+        specialization_key = bk.specialization_key(fixed, args_hs)
         tsgraph = bk.get_graph_by_key(graph, specialization_key)
         self.tsgraphs_seen.append(tsgraph)
         return tsgraph
@@ -451,7 +455,7 @@
         if not self.hannotator.policy.look_inside_graphs(graphs):
             return    # cannot follow this call
         for graph in graphs:
-            tsgraph = self.timeshifted_graph_of(graph, args_v)
+            tsgraph = self.timeshifted_graph_of(graph, args_v, spaceop.result)
             yield graph, tsgraph
 
     def guess_call_kind(self, spaceop):


More information about the pypy-svn mailing list