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

tverwaes at codespeak.net tverwaes at codespeak.net
Mon Mar 10 02:00:12 CET 2008


Author: tverwaes
Date: Mon Mar 10 02:00:12 2008
New Revision: 52353

Modified:
   pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/objtable.py
   pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/squeakimage.py
   pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/utility.py
Log:
making CharacterTable loading from image translatable while keeping stub
working for tests.


Modified: pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/objtable.py
==============================================================================
--- pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/objtable.py	(original)
+++ pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/objtable.py	Mon Mar 10 02:00:12 2008
@@ -6,22 +6,18 @@
 # Global Data
 
 def wrap_char_table():
-    global CharacterTable
+    global w_charactertable
     def bld_char(i):
         w_cinst = classtable.w_Character.as_class_get_shadow().new(store=False)
         w_cinst.store(constants.CHARACTER_VALUE_INDEX,
                       model.W_SmallInteger(i))
         return w_cinst
-    CharacterTable = model.W_PointersObject(classtable.classtable['w_Array'], 256)
+    w_charactertable = model.W_PointersObject(classtable.classtable['w_Array'], 256)
     for i in range(256):
-        CharacterTable.atput0(i, bld_char(i))
+        w_charactertable.atput0(i, bld_char(i))
 
 wrap_char_table()
 
-def init_chartable_from_objtable():
-    global CharacterTable
-    CharacterTable = objtable["w_charactertable"]
-
 w_true  = classtable.classtable['w_True'].as_class_get_shadow().new(store=False)
 w_false = classtable.classtable['w_False'].as_class_get_shadow().new(store=False)
 w_minus_one = model.W_SmallInteger(-1)

Modified: pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/squeakimage.py
==============================================================================
--- pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/squeakimage.py	(original)
+++ pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/squeakimage.py	Mon Mar 10 02:00:12 2008
@@ -209,8 +209,6 @@
         for name, idx in constants.objects_in_special_object_table.items():
             objtable.objtable["w_" + name] = self.special_objects[idx]
 
-        objtable.init_chartable_from_objtable()
-
     def special(self, index):
         return self.special_objects[index]
 

Modified: pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/utility.py
==============================================================================
--- pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/utility.py	(original)
+++ pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/utility.py	Mon Mar 10 02:00:12 2008
@@ -51,8 +51,8 @@
     return w_inst
 
 def wrap_char(c):
-    from pypy.lang.smalltalk.objtable import CharacterTable
-    return CharacterTable.fetch(ord(c))
+    from pypy.lang.smalltalk.objtable import w_charactertable
+    return w_charactertable.fetch(ord(c))
 
 def wrap_bool(bool):
     from pypy.lang.smalltalk import objtable



More information about the Pypy-commit mailing list