[pypy-svn] r4269 - pypy/branch/typeinference/pypy/translator

arigo at codespeak.net arigo at codespeak.net
Tue May 4 11:12:12 CEST 2004


Author: arigo
Date: Tue May  4 11:12:09 2004
New Revision: 4269

Modified:
   pypy/branch/typeinference/pypy/translator/annrpython.py
Log:
We don't seem to need the delayedblocks list any more, after all.


Modified: pypy/branch/typeinference/pypy/translator/annrpython.py
==============================================================================
--- pypy/branch/typeinference/pypy/translator/annrpython.py	(original)
+++ pypy/branch/typeinference/pypy/translator/annrpython.py	Tue May  4 11:12:09 2004
@@ -19,7 +19,6 @@
 
     def __init__(self, translator=None):
         self.pendingblocks = []  # list of (block, list-of-SomeValues-args)
-        self.delayedblocks = []  # list of blocked blocks
         self.bindings = {}       # map Variables to SomeValues
         self.annotated = {}      # set of blocks already seen
         self.creationpoints = {} # map positions-in-blocks to Factories
@@ -71,16 +70,10 @@
             # XXX don't know if it is better to pop from the head or the tail.
             # but suspect from the tail is better in the new Factory model.
             block, cells = self.pendingblocks.pop()
-            if self.processblock(block, cells):
-                # When flowin succeeds, i.e. when the analysis progress,
-                # we can tentatively re-schedule the delayed blocks.
-                delay = [(block, None) for block in self.delayedblocks]
-                delay.reverse()
-                self.pendingblocks[:0] = delay
-                del self.delayedblocks[:]
-        if self.delayedblocks:
-            raise AnnotatorError('%d block(s) are still blocked' %
-                                 len(delayedblocks))
+            self.processblock(block, cells)
+        if False in self.annotated.values():
+            raise AnnotatorError('%d blocks are still blocked' %
+                                 len(self.annotated.values().count(False)))
 
     def binding(self, arg):
         "Gives the SomeValue corresponding to the given Variable or Constant."
@@ -157,7 +150,6 @@
                 self.flowin(block)
             except BlockedInference, e:
                 self.annotated[block] = False   # failed, hopefully temporarily
-                self.delayedblocks.append(block)
                 for factory in e.invalidatefactories:
                     self.reflowpendingblock(factory.block)
             else:


More information about the Pypy-commit mailing list