[pypy-svn] r32597 - pypy/dist/pypy/rpython/lltypesystem

arigo at codespeak.net arigo at codespeak.net
Fri Sep 22 19:50:27 CEST 2006


Author: arigo
Date: Fri Sep 22 19:50:26 2006
New Revision: 32597

Modified:
   pypy/dist/pypy/rpython/lltypesystem/rpbc.py
   pypy/dist/pypy/rpython/lltypesystem/rrange.py
   pypy/dist/pypy/rpython/lltypesystem/rslice.py
Log:
Some more {'hints': 'immutable'}.


Modified: pypy/dist/pypy/rpython/lltypesystem/rpbc.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/rpbc.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/rpbc.py	Fri Sep 22 19:50:26 2006
@@ -44,7 +44,8 @@
 
     def _setup_repr(self):
         llfields = self._setup_repr_fields()
-        self.pbc_type.become(Struct('pbc', *llfields))
+        kwds = {'hints': {'immutable': True}}
+        self.pbc_type.become(Struct('pbc', *llfields, **kwds))
 
     def create_instance(self):
         return malloc(self.pbc_type, immortal=True)
@@ -64,7 +65,7 @@
     with no common access set."""
 
     lowleveltype = llmemory.Address
-    EMPTY = Struct('pbc')
+    EMPTY = Struct('pbc', hints={'immutable': True})
 
     def convert_pbc(self, pbcptr):
         return llmemory.fakeaddress(pbcptr)
@@ -103,7 +104,8 @@
         fields = []
         for row in self.uniquerows:
             fields.append((row.attrname, row.fntype))
-        return Ptr(Struct('specfunc', *fields))
+        kwds = {'hints': {'immutable': True}}
+        return Ptr(Struct('specfunc', *fields, **kwds))
         
     def create_specfunc(self):
         return malloc(self.lowleveltype.TO, immortal=True)

Modified: pypy/dist/pypy/rpython/lltypesystem/rrange.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/rrange.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/rrange.py	Fri Sep 22 19:50:26 2006
@@ -35,7 +35,8 @@
                     adtmeths = {
                         "ll_length":ll_length,
                         "ll_getitem_fast":ll_getitem_fast,
-                    })
+                    },
+                    hints = {'immutable': True})
 RANGESTITER = GcStruct("range", ("next", Signed), ("stop", Signed), ("step", Signed))
 
 class RangeRepr(AbstractRangeRepr):
@@ -51,7 +52,8 @@
                     "ll_length":ll_length,
                     "ll_getitem_fast":ll_getitem_fast,
                     "step":step,
-                }))
+                },
+                hints = {'immutable': True}))
         self.RANGEITER = Ptr(GcStruct("range", ("next", Signed), ("stop", Signed)))
         AbstractRangeRepr.__init__(self, step, *args)
         self.ll_newrange = ll_newrange

Modified: pypy/dist/pypy/rpython/lltypesystem/rslice.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/rslice.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/rslice.py	Fri Sep 22 19:50:26 2006
@@ -18,8 +18,8 @@
 #          //     step is always 1
 #      }
 
-SLICE = GcStruct("slice", ("start", Signed), ("stop", Signed))
-
+SLICE = GcStruct("slice", ("start", Signed), ("stop", Signed),
+                 hints = {'immutable': True})
 
 class SliceRepr(AbstractSliceRepr):
     pass



More information about the Pypy-commit mailing list