[pypy-commit] lang-smalltalk default: (cfbolz, timfel) _shadow as class-level default, and clear on become

timfel noreply at buildbot.pypy.org
Mon Feb 18 18:23:29 CET 2013


Author: Tim Felgentreff <timfelgentreff at gmail.com>
Branch: 
Changeset: r44:2152a48cecb5
Date: 2013-02-18 16:41 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/2152a48cecb5/

Log:	(cfbolz, timfel) _shadow as class-level default, and clear on become

diff --git a/spyvm/model.py b/spyvm/model.py
--- a/spyvm/model.py
+++ b/spyvm/model.py
@@ -461,10 +461,11 @@
 ###    variables.  The number of bytes used for this purpose is the value of
 ###    the last byte in the method.
 
+    _shadow = None
+
     def __init__(self, bytecount=0, header=0):
         self.setheader(header)
         self.bytes = ["\x00"] * bytecount
-        self._shadow = None
 
     def become(self, w_other):
         if not isinstance(w_other, W_CompiledMethod):
@@ -478,6 +479,7 @@
         self.literalsize, w_other.literalsize = w_other.literalsize, self.literalsize
         self.w_compiledin, w_other.w_compiledin = w_other.w_compiledin, self.w_compiledin
         self.islarge, w_other.islarge = w_other.islarge, self.islarge
+        self._shadow = w_other._shadow = None
         W_AbstractObjectWithIdentityHash._become(self, w_other)
         return True
 


More information about the pypy-commit mailing list