[pypy-svn] rev 2142 - pypy/trunk/doc/translation
arigo at codespeak.net
arigo at codespeak.net
Fri Oct 31 17:30:11 CET 2003
Author: arigo
Date: Fri Oct 31 17:30:10 2003
New Revision: 2142
Modified:
pypy/trunk/doc/translation/annotation.txt
Log:
A short paragraph about intersections between mutable objects.
Modified: pypy/trunk/doc/translation/annotation.txt
==============================================================================
--- pypy/trunk/doc/translation/annotation.txt (original)
+++ pypy/trunk/doc/translation/annotation.txt Fri Oct 31 17:30:10 2003
@@ -152,7 +152,7 @@
Whole-program analysis
----------------------
-A program of more than once function is analysed in exactly the same way,
+A program of more than one function is analysed in exactly the same way,
starting from an entry point and following calls. We have a cache of all
the blocks that the flow objspace produced, and a list of pending blocks
that we have to type-analyse. When the analysis of a block temporarily
@@ -223,3 +223,16 @@
getitem(X1,?)=X5
and now we know that we have a list of integers.
+
+Note that during this whole process the same list is represented by ``X1``.
+This is important, so that any code anywhere that could modify the list
+can kill invalid annotations about it. Intersection must be clever about
+mutable objects: we have seen above an example where ``retval`` could map
+to ``X10`` or ``X11``, and the intersection said it was fine because they
+had the same annotations. It would not be fine if ``X10`` and ``X11``
+could be of a mutable type. In this case we must force ``X10==X11`` for
+the whole program. In other words the representation choosen for a list
+depends on all the places where this list could go, and these places
+themselves use a representation that depends on all the lists that could
+come at this point. All these places and lists will use a common,
+most general representation.
More information about the Pypy-commit
mailing list