[pypy-commit] lang-smalltalk storage: Small improvements and compiler-fix.

anton_gulenko noreply at buildbot.pypy.org
Wed Apr 2 09:44:36 CEST 2014


Author: Anton Gulenko <anton.gulenko at googlemail.com>
Branch: storage
Changeset: r737:1522dcd48891
Date: 2014-04-02 09:34 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/1522dcd48891/

Log:	Small improvements and compiler-fix.

diff --git a/spyvm/model.py b/spyvm/model.py
--- a/spyvm/model.py
+++ b/spyvm/model.py
@@ -817,7 +817,7 @@
         return self._size
 
     def str_content(self):
-        return self.as_string()
+        return "'%s'" % self.as_string()
 
     def as_string(self):
         if self.bytes is not None:
@@ -1301,7 +1301,7 @@
                         if w_candidate.is_class(space):
                             w_compiledin = w_candidate
             self.w_compiledin = w_compiledin
-        assert isinstance(w_compiledin, W_PointersObject)
+        assert w_compiledin is None or isinstance(w_compiledin, W_PointersObject)
         return w_compiledin
     
     # === Object Access ===
diff --git a/spyvm/shadow.py b/spyvm/shadow.py
--- a/spyvm/shadow.py
+++ b/spyvm/shadow.py
@@ -476,6 +476,8 @@
         while look_in_shadow is not None:
             w_method = look_in_shadow.s_methoddict().find_selector(w_selector)
             if w_method is not None:
+                # Old images don't store compiledin-info in literals.
+                w_method.w_compiledin = look_in_shadow.w_self()
                 return w_method
             look_in_shadow = look_in_shadow._s_superclass
         raise MethodNotFound(self, w_selector)


More information about the pypy-commit mailing list