[pypy-svn] r48157 - in pypy/dist/pypy/lang/smalltalk: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Oct 29 15:56:42 CET 2007


Author: cfbolz
Date: Mon Oct 29 15:56:37 2007
New Revision: 48157

Modified:
   pypy/dist/pypy/lang/smalltalk/interpreter.py
   pypy/dist/pypy/lang/smalltalk/objtable.py
   pypy/dist/pypy/lang/smalltalk/primitives.py
   pypy/dist/pypy/lang/smalltalk/test/test_miniimage.py
   pypy/dist/pypy/lang/smalltalk/test/test_primitives.py
Log:
w_mone -> w_minus_one


Modified: pypy/dist/pypy/lang/smalltalk/interpreter.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/interpreter.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/interpreter.py	Mon Oct 29 15:56:37 2007
@@ -20,7 +20,7 @@
     TRUE = objtable.w_true
     FALSE = objtable.w_false
     NIL = objtable.w_nil
-    MONE = objtable.w_mone
+    MINUS_ONE = objtable.w_minus_one
     ZERO = objtable.w_zero
     ONE = objtable.w_one
     TWO = objtable.w_two
@@ -123,7 +123,7 @@
         self.push(interp.NIL)
 
     def pushConstantMinusOneBytecode(self, interp):
-        self.push(interp.MONE)
+        self.push(interp.MINUS_ONE)
 
     def pushConstantZeroBytecode(self, interp):
         self.push(interp.ZERO)

Modified: pypy/dist/pypy/lang/smalltalk/objtable.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/objtable.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/objtable.py	Mon Oct 29 15:56:37 2007
@@ -53,17 +53,18 @@
     global CharacterTable
     def bld_char(i):
         w_cinst = classtable.w_Character.as_class_get_shadow().new()
-        w_cinst.store(constants.CHARACTER_VALUE_INDEX, wrap_int(i))
+        w_cinst.store(constants.CHARACTER_VALUE_INDEX,
+                      model.W_SmallInteger(i))
         return w_cinst
     CharacterTable = [bld_char(i) for i in range(256)]
 wrap_char_table()
 
 w_true  = classtable.classtable['w_True'].as_class_get_shadow().new()
 w_false = classtable.classtable['w_False'].as_class_get_shadow().new()
-w_mone = wrap_int(-1)
-w_zero = wrap_int(0)
-w_one = wrap_int(1)
-w_two = wrap_int(2)
+w_minus_one = model.W_SmallInteger(-1)
+w_zero = model.W_SmallInteger(0)
+w_one = model.W_SmallInteger(1)
+w_two = model.W_SmallInteger(2)
 
 # Very special nil hack: in order to allow W_PointersObject's to
 # initialize their fields to nil, we have to create it in the model

Modified: pypy/dist/pypy/lang/smalltalk/primitives.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/primitives.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/primitives.py	Mon Oct 29 15:56:37 2007
@@ -625,7 +625,7 @@
     (PUSH_TRUE, objtable.w_true),
     (PUSH_FALSE, objtable.w_false),
     (PUSH_NIL, objtable.w_nil),
-    (PUSH_MINUS_ONE, objtable.w_mone),
+    (PUSH_MINUS_ONE, objtable.w_minus_one),
     (PUSH_ZERO, objtable.w_zero),
     (PUSH_ONE, objtable.w_one),
     (PUSH_TWO, objtable.w_two),

Modified: pypy/dist/pypy/lang/smalltalk/test/test_miniimage.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/test/test_miniimage.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/test/test_miniimage.py	Mon Oct 29 15:56:37 2007
@@ -147,7 +147,7 @@
     w_doesnot = image.special(constants.SO_DOES_NOT_UNDERSTAND)
     assert repr(w_doesnot.shadow_of_my_class()) == "<ClassShadow Symbol>"
     assert repr(objtable.w_nil.shadow_of_my_class()) == "<ClassShadow UndefinedObject>"
-    assert repr(objtable.w_mone.shadow_of_my_class()) == "<ClassShadow SmallInteger>"
+    assert repr(objtable.w_minus_one.shadow_of_my_class()) == "<ClassShadow SmallInteger>"
     assert repr(objtable.w_zero.shadow_of_my_class()) == "<ClassShadow SmallInteger>"
     assert repr(objtable.w_one.shadow_of_my_class()) == "<ClassShadow SmallInteger>"
     assert repr(objtable.w_two.shadow_of_my_class()) == "<ClassShadow SmallInteger>"

Modified: pypy/dist/pypy/lang/smalltalk/test/test_primitives.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/test/test_primitives.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/test/test_primitives.py	Mon Oct 29 15:56:37 2007
@@ -291,7 +291,7 @@
         (primitives.PUSH_TRUE, objtable.w_true),
         (primitives.PUSH_FALSE, objtable.w_false),
         (primitives.PUSH_NIL, objtable.w_nil),
-        (primitives.PUSH_MINUS_ONE, objtable.w_mone),
+        (primitives.PUSH_MINUS_ONE, objtable.w_minus_one),
         (primitives.PUSH_ZERO, objtable.w_zero),
         (primitives.PUSH_ONE, objtable.w_one),
         (primitives.PUSH_TWO, objtable.w_two),



More information about the Pypy-commit mailing list