[pypy-commit] pypy callfamily: kill one crazy callback

rlamy noreply at buildbot.pypy.org
Wed Apr 15 16:31:49 CEST 2015


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: callfamily
Changeset: r76797:da3f97e3f9ab
Date: 2015-04-15 15:32 +0100
http://bitbucket.org/pypy/pypy/changeset/da3f97e3f9ab/

Log:	kill one crazy callback

diff --git a/rpython/annotator/bookkeeper.py b/rpython/annotator/bookkeeper.py
--- a/rpython/annotator/bookkeeper.py
+++ b/rpython/annotator/bookkeeper.py
@@ -498,12 +498,9 @@
             op = None
             s_previous_result = s_ImpossibleValue
 
-        def schedule(graph, inputcells):
-            return self.annotator.recursivecall(graph, whence, inputcells)
-
         results = []
         for desc in pbc.descriptions:
-            results.append(desc.pycall(schedule, args, s_previous_result, op))
+            results.append(desc.pycall(whence, args, s_previous_result, op))
         s_result = unionof(*results)
         return s_result
 
diff --git a/rpython/annotator/description.py b/rpython/annotator/description.py
--- a/rpython/annotator/description.py
+++ b/rpython/annotator/description.py
@@ -295,22 +295,23 @@
         else:
             return self.specializer(self, inputcells)
 
-    def pycall(self, schedule, args, s_previous_result, op=None):
+    def pycall(self, whence, args, s_previous_result, op=None):
         inputcells = self.parse_arguments(args)
         result = self.specialize(inputcells, op)
         if isinstance(result, FunctionGraph):
             graph = result         # common case
+            annotator = self.bookkeeper.annotator
             # if that graph has a different signature, we need to re-parse
             # the arguments.
             # recreate the args object because inputcells may have been changed
             new_args = args.unmatch_signature(self.signature, inputcells)
             inputcells = self.parse_arguments(new_args, graph)
-            result = schedule(graph, inputcells)
+            result = annotator.recursivecall(graph, whence, inputcells)
             signature = getattr(self.pyobj, '_signature_', None)
             if signature:
                 sigresult = enforce_signature_return(self, signature[1], result)
                 if sigresult is not None:
-                    self.bookkeeper.annotator.addpendingblock(
+                    annotator.addpendingblock(
                         graph, graph.returnblock, [sigresult])
                     result = sigresult
         # Some specializations may break the invariant of returning
@@ -627,7 +628,7 @@
                             "specialization" % (self.name,))
         return self.getclassdef(None)
 
-    def pycall(self, schedule, args, s_previous_result, op=None):
+    def pycall(self, whence, args, s_previous_result, op=None):
         from rpython.annotator.model import SomeInstance, SomeImpossibleValue
         if self.specialize:
             if self.specialize == 'specialize:ctr_location':
@@ -902,9 +903,9 @@
         s_instance = SomeInstance(self.selfclassdef, flags=self.flags)
         return args.prepend(s_instance)
 
-    def pycall(self, schedule, args, s_previous_result, op=None):
+    def pycall(self, whence, args, s_previous_result, op=None):
         func_args = self.func_args(args)
-        return self.funcdesc.pycall(schedule, func_args, s_previous_result, op)
+        return self.funcdesc.pycall(whence, func_args, s_previous_result, op)
 
     def get_graph(self, args, op):
         func_args = self.func_args(args)
@@ -1082,9 +1083,9 @@
         s_self = SomePBC([self.frozendesc])
         return args.prepend(s_self)
 
-    def pycall(self, schedule, args, s_previous_result, op=None):
+    def pycall(self, whence, args, s_previous_result, op=None):
         func_args = self.func_args(args)
-        return self.funcdesc.pycall(schedule, func_args, s_previous_result, op)
+        return self.funcdesc.pycall(whence, func_args, s_previous_result, op)
 
     def get_graph(self, args, op):
         func_args = self.func_args(args)


More information about the pypy-commit mailing list