Commits

Brian Kearns committed f32e46e

mark XRangeStepOneIterator.stop as an immutable field

Comments (0)

Files changed (2)

pypy/module/__builtin__/functional.py

 )
 W_XRange.typedef.acceptable_as_base_class = False
 
+
 class W_XRangeIterator(W_Root):
     def __init__(self, space, current, remaining, step):
         self.space = space
 )
 W_XRangeIterator.typedef.acceptable_as_base_class = False
 
+
 class W_XRangeStepOneIterator(W_XRangeIterator):
+    _immutable_fields_ = ['stop']
+
     def __init__(self, space, start, stop):
         self.space = space
         self.current = start

pypy/module/pypyjit/test_pypy_c/test_weakref.py

         loop, = log.loops_by_filename(self.filepath)
         assert loop.match("""
         i58 = getfield_gc(p18, descr=<FieldS pypy.module.__builtin__.functional.W_XRangeIterator.inst_current .>)
-        i59 = getfield_gc(p18, descr=<FieldS pypy.module.__builtin__.functional.W_XRangeStepOneIterator.inst_stop \d+>)
-        i60 = int_lt(i58, i59)
+        i60 = int_lt(i58, i31)
         guard_true(i60, descr=...)
         i61 = int_add(i58, 1)
         p62 = getfield_gc(ConstPtr(ptr37), descr=<FieldP pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_strategy \d+>)