[pypy-svn] r52289 - pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk

tverwaes at codespeak.net tverwaes at codespeak.net
Sat Mar 8 06:01:37 CET 2008


Author: tverwaes
Date: Sat Mar  8 06:01:35 2008
New Revision: 52289

Modified:
   pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/interpreter.py
   pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/shadow.py
Log:
making sure interpreter gets invalidated. 6.8s -> 6.6s (vs 5.8)


Modified: pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/interpreter.py
==============================================================================
--- pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/interpreter.py	(original)
+++ pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/interpreter.py	Sat Mar  8 06:01:35 2008
@@ -36,8 +36,10 @@
         return self._w_active_context
 
     def store_w_active_context(self, w_context):
+        if self._s_active_context is not None:
+            self._s_active_context.unnotify(self)
+            self.invalidate()
         self._w_active_context = w_context
-        self._s_active_context = None
 
     def invalidate(self):
         self._s_active_context = None
@@ -45,6 +47,7 @@
     def s_active_context(self):
         if self._s_active_context is None:
             self._s_active_context = self.w_active_context().as_context_get_shadow()
+            self._s_active_context.invalidnotify(self)
         return self._s_active_context
 
     def interpret(self):

Modified: pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/shadow.py
==============================================================================
--- pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/shadow.py	(original)
+++ pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/shadow.py	Sat Mar  8 06:01:35 2008
@@ -19,6 +19,10 @@
         if other not in self._invalidnotify:
             self._invalidnotify += [other]
 
+    def unnotify(self, other):
+        if other in self._invalidnotify:
+            self._invalidnotify.remove(other)
+
     def getname(self):
         return repr(self)
 



More information about the Pypy-commit mailing list