[pypy-svn] r22961 - in pypy/dist/pypy: annotation jit

pedronis at codespeak.net pedronis at codespeak.net
Thu Feb 2 18:04:14 CET 2006


Author: pedronis
Date: Thu Feb  2 18:04:13 2006
New Revision: 22961

Modified:
   pypy/dist/pypy/annotation/annrpython.py
   pypy/dist/pypy/jit/hintannotator.py
Log:
fix XXX. Later we should really extract a base class from RPythonAnnotator, will become apparent when
we have to deal with RPythonAnnotator code handling exceptions :-)



Modified: pypy/dist/pypy/annotation/annrpython.py
==============================================================================
--- pypy/dist/pypy/annotation/annrpython.py	(original)
+++ pypy/dist/pypy/annotation/annrpython.py	Thu Feb  2 18:04:13 2006
@@ -20,7 +20,7 @@
     """Block annotator for RPython.
     See description in doc/translation.txt."""
 
-    def __init__(self, translator=None, policy = None):
+    def __init__(self, translator=None, policy=None, bookkeeper=None):
         if translator is None:
             # interface for tests
             from pypy.translator.translator import TranslationContext
@@ -49,7 +49,9 @@
         self.reflowcounter = {}
         self.return_bindings = {} # map return Variables to their graphs
         # --- end of debugging information ---
-        self.bookkeeper = Bookkeeper(self)
+        if bookkeeper is None:
+            bookkeeper = Bookkeeper(self)
+        self.bookkeeper = bookkeeper
         self.frozen = False
         # user-supplied annotation logic for functions we don't want to flow into
         if policy is None:

Modified: pypy/dist/pypy/jit/hintannotator.py
==============================================================================
--- pypy/dist/pypy/jit/hintannotator.py	(original)
+++ pypy/dist/pypy/jit/hintannotator.py	Thu Feb  2 18:04:13 2006
@@ -6,8 +6,9 @@
 class HintAnnotator(RPythonAnnotator):
 
     def __init__(self, translator=None, policy=None):
-        RPythonAnnotator.__init__(self, translator, policy=policy)
-        self.bookkeeper = HintBookkeeper(self) # XXX
+        bookkeeper = HintBookkeeper(self)
+        RPythonAnnotator.__init__(self, translator, policy=policy,
+                                  bookkeeper=bookkeeper)
 
     def build_types(self, origgraph, input_args_hs):
         desc = self.bookkeeper.getdesc(origgraph)



More information about the Pypy-commit mailing list