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

tverwaes at codespeak.net tverwaes at codespeak.net
Sun Feb 24 23:13:51 CET 2008


Author: tverwaes
Date: Sun Feb 24 23:13:51 2008
New Revision: 51839

Modified:
   pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/objtable.py
   pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/utility.py
Log:
always use pointersobject for chartable (even when homebrewed)


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	Sun Feb 24 23:13:51 2008
@@ -12,7 +12,10 @@
         w_cinst.store(constants.CHARACTER_VALUE_INDEX,
                       model.W_SmallInteger(i))
         return w_cinst
-    CharacterTable = [bld_char(i) for i in range(256)]
+    CharacterTable = model.W_PointersObject(classtable.classtable['w_Array'], 256)
+    for i in range(256):
+        CharacterTable.atput0(i, bld_char(i))
+
 wrap_char_table()
 
 w_true  = classtable.classtable['w_True'].as_class_get_shadow().new(store=False)

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	Sun Feb 24 23:13:51 2008
@@ -52,11 +52,7 @@
 
 def wrap_char(c):
     from pypy.lang.smalltalk.objtable import CharacterTable
-    try:
-        return CharacterTable.fetch(ord(c))
-    except Exception:
-        # XXX For now fall back to old version of charactertable
-        return CharacterTable[ord(c)]
+    return CharacterTable.fetch(ord(c))
 
 def wrap_bool(bool):
     from pypy.lang.smalltalk import objtable



More information about the Pypy-commit mailing list