[pypy-svn] r52354 - pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk
tverwaes at codespeak.net
tverwaes at codespeak.net
Mon Mar 10 02:48:12 CET 2008
Author: tverwaes
Date: Mon Mar 10 02:48:10 2008
New Revision: 52354
Modified:
pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/interpreter.py
pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/model.py
pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/shadow.py
Log:
making code translatable
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 Mon Mar 10 02:48:10 2008
@@ -129,6 +129,7 @@
# named var (the value).
index = self.currentBytecode & 31
w_association = self.w_method().getliteral(index)
+ assert isinstance(w_association, model.W_PointersObject)
s_association = w_association.as_association_get_shadow()
self.push(s_association.value())
@@ -269,6 +270,7 @@
self.push(self.w_method().getliteral(variableIndex))
elif variableType == 3:
w_association = self.w_method().getliteral(variableIndex)
+ assert isinstance(w_association, model.W_PointersObject)
s_association = w_association.as_association_get_shadow()
self.push(s_association.value())
else:
@@ -284,6 +286,7 @@
raise IllegalStoreError
elif variableType == 3:
w_association = self.w_method().getliteral(variableIndex)
+ assert isinstance(w_association, model.W_PointersObject)
s_association = w_association.as_association_get_shadow()
s_association.store_value(self.top())
@@ -321,6 +324,7 @@
elif opType == 4:
# pushLiteralVariable
w_association = self.w_method().getliteral(third)
+ assert isinstance(w_association, model.W_PointersObject)
s_association = w_association.as_association_get_shadow()
self.push(s_association.value())
elif opType == 5:
@@ -329,6 +333,7 @@
self.w_receiver().store(third, self.pop())
elif opType == 7:
w_association = self.w_method().getliteral(third)
+ assert isinstance(w_association, model.W_PointersObject)
s_association = w_association.as_association_get_shadow()
s_association.store_value(self.top())
Modified: pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/model.py
==============================================================================
--- pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/model.py (original)
+++ pypy/branch/smalltalk-shadow-changes/pypy/lang/smalltalk/model.py Mon Mar 10 02:48:10 2008
@@ -373,6 +373,7 @@
# Last of the literals is an association with compiledin
# as a class
w_association = self.literals[-1]
+ assert isinstance(w_association, W_PointersObject)
s_association = w_association.as_association_get_shadow()
self.w_compiledin = s_association.value()
return self.w_compiledin
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 Mon Mar 10 02:48:10 2008
@@ -329,6 +329,7 @@
s_scheduler = self.s_scheduler()
w_process_lists = s_scheduler.process_lists()
w_process_list = w_process_lists._vars[priority]
+ assert isinstance(w_process_list, model.W_PointersObject)
w_process_list.as_linkedlist_get_shadow().add_last_link(s_process.w_self())
s_process.store_my_list(w_process_list)
@@ -345,6 +346,8 @@
def s_scheduler(self):
from pypy.lang.smalltalk import objtable
w_association = objtable.objtable["w_schedulerassociationpointer"]
+ assert w_association is not None
+ assert isinstance(w_association, model.W_PointersObject)
w_scheduler = w_association.as_association_get_shadow().value()
return w_scheduler.as_scheduler_get_shadow()
More information about the Pypy-commit
mailing list