[pypy-svn] r13597 - in pypy/dist/pypy: annotation rpython

arigo at codespeak.net arigo at codespeak.net
Sun Jun 19 12:50:55 CEST 2005


Author: arigo
Date: Sun Jun 19 12:50:53 2005
New Revision: 13597

Modified:
   pypy/dist/pypy/annotation/bookkeeper.py
   pypy/dist/pypy/rpython/rlist.py
Log:
Details.


Modified: pypy/dist/pypy/annotation/bookkeeper.py
==============================================================================
--- pypy/dist/pypy/annotation/bookkeeper.py	(original)
+++ pypy/dist/pypy/annotation/bookkeeper.py	Sun Jun 19 12:50:53 2005
@@ -273,8 +273,8 @@
         elif tp is float:
             result = SomeFloat()
         elif tp is list:
+            key = Constant(x)
             try:
-                key = Constant(x)
                 return self.immutable_cache[key]
             except KeyError:
                 result = SomeList(ListDef(self, SomeImpossibleValue()))
@@ -282,8 +282,8 @@
                 for e in x:
                     result.listdef.generalize(self.immutablevalue(e))
         elif tp is dict:   # exactly a dict
+            key = Constant(x)
             try:
-                key = Constant(x)
                 return self.immutable_cache[key]
             except KeyError:
                 result = SomeDict(DictDef(self, 

Modified: pypy/dist/pypy/rpython/rlist.py
==============================================================================
--- pypy/dist/pypy/rpython/rlist.py	(original)
+++ pypy/dist/pypy/rpython/rlist.py	Sun Jun 19 12:50:53 2005
@@ -60,11 +60,11 @@
             raise TyperError("expected a list: %r" % (listobj,))
         try:
             key = Constant(listobj)
-            return self.list_cache[key][1]
+            return self.list_cache[key]
         except KeyError:
             self.setup()
             result = malloc(self.LIST, immortal=True)
-            self.list_cache[key] = listobj, result
+            self.list_cache[key] = result
             result.items = malloc(self.LIST.items.TO, len(listobj))
             r_item = self.item_repr
             for i in range(len(listobj)):



More information about the Pypy-commit mailing list