Author: Ronan Lamy <[email protected]>
Branch: callfamily
Changeset: r76792:00452e09acc2
Date: 2015-03-29 15:08 +0100
http://bitbucket.org/pypy/pypy/changeset/00452e09acc2/

Log:    Don't bother analysing call families until they are needed

diff --git a/rpython/annotator/bookkeeper.py b/rpython/annotator/bookkeeper.py
--- a/rpython/annotator/bookkeeper.py
+++ b/rpython/annotator/bookkeeper.py
@@ -495,9 +495,6 @@
         annotations).
         """
         descs = list(pbc.descriptions)
-        first = descs[0]
-        first.mergecallfamilies(*descs[1:])
-
         if emulated is None:
             whence = self.position_key
             # fish the existing annotation for the result variable,
@@ -519,7 +516,7 @@
             return self.annotator.recursivecall(graph, whence, inputcells)
 
         results = []
-        for desc in descs:
+        for desc in pbc.descriptions:
             results.append(desc.pycall(schedule, 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
@@ -351,6 +351,7 @@
         row = FunctionDesc.row_to_consider(descs, args, op)
         family = descs[0].getcallfamily()
         family.calltable_add_row(shape, row)
+        descs[0].mergecallfamilies(*descs[1:])
 
     @staticmethod
     def variant_for_call_site(bookkeeper, family, descs, args, op):
@@ -777,6 +778,8 @@
 
     @staticmethod
     def consider_call_site(descs, args, s_result, op):
+        descs[0].getcallfamily()
+        descs[0].mergecallfamilies(*descs[1:])
         from rpython.annotator.model import SomeInstance, SomePBC, s_None
         if len(descs) == 1:
             # call to a single class, look at the result annotation
@@ -916,6 +919,7 @@
         row = FunctionDesc.row_to_consider(descs, args, op)
         family = descs[0].getcallfamily()
         family.calltable_add_row(shape, row)
+        descs[0].mergecallfamilies(*descs[1:])
 
     def rowkey(self):
         # we are computing call families and call tables that always contain
@@ -1077,6 +1081,7 @@
         row = FunctionDesc.row_to_consider(descs, args, op)
         family = descs[0].getcallfamily()
         family.calltable_add_row(shape, row)
+        descs[0].mergecallfamilies(*descs[1:])
 
     def rowkey(self):
         return self.funcdesc
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to