Commits

Armin Rigo  committed 98ad343

Adapt the _immutable_ and _immutable_fields_ hints left and right.
I think this branch is now ready to be merged, if it passes all
tests.

  • Participants
  • Parent commits d83d8fd
  • Branches out-of-line-guards-2

Comments (0)

Files changed (5)

File pypy/interpreter/pyopcode.py

 
 
 class FrameBlock(object):
-
     """Abstract base class for frame blocks from the blockstack,
     used by the SETUP_XXX and POP_BLOCK opcodes."""
 
+    _immutable_ = True
+
     def __init__(self, frame, handlerposition):
         self.handlerposition = handlerposition
         self.valuestackdepth = frame.valuestackdepth
 class LoopBlock(FrameBlock):
     """A loop block.  Stores the end-of-loop pointer in case of 'break'."""
 
+    _immutable_ = True
     _opname = 'SETUP_LOOP'
     handling_mask = SBreakLoop.kind | SContinueLoop.kind
 
 class ExceptBlock(FrameBlock):
     """An try:except: block.  Stores the position of the exception handler."""
 
+    _immutable_ = True
     _opname = 'SETUP_EXCEPT'
     handling_mask = SApplicationException.kind
 
 class FinallyBlock(FrameBlock):
     """A try:finally: block.  Stores the position of the exception handler."""
 
+    _immutable_ = True
     _opname = 'SETUP_FINALLY'
     handling_mask = -1     # handles every kind of SuspendedUnroller
 
 
 class WithBlock(FinallyBlock):
 
+    _immutable_ = True
+
     def really_handle(self, frame, unroller):
         if (frame.space.full_exceptions and
             isinstance(unroller, SApplicationException)):

File pypy/interpreter/special.py

 from pypy.interpreter.baseobjspace import Wrappable
 
 class Ellipsis(Wrappable):
-    _immutable_ = True
     def __init__(self, space):
         self.space = space 
     def descr__repr__(self):
         return self.space.wrap('Ellipsis')
 
 class NotImplemented(Wrappable): 
-    _immutable_ = True
     def __init__(self, space):
         self.space = space 
     def descr__repr__(self):

File pypy/objspace/std/boolobject.py

 
 class W_BoolObject(W_Object):
     from pypy.objspace.std.booltype import bool_typedef as typedef
-
-    _immutable_ = True
+    _immutable_fields_ = ['boolval']
 
     def __init__(w_self, boolval):
         w_self.boolval = not not boolval

File pypy/objspace/std/noneobject.py

 
 class W_NoneObject(W_Object):
     from pypy.objspace.std.nonetype import none_typedef as typedef
-    _immutable_ = True
 
     def unwrap(w_self, space):
         return None

File pypy/objspace/std/typeobject.py

 
     _immutable_fields_ = ["flag_heaptype",
                           "flag_cpytype",
-                          #  flag_abstract is not immutable
+                          "flag_abstract?",
                           'needsdel',
                           'weakrefable',
                           'hasdict',