Author: Lars Wassermann <[email protected]>
Branch: 
Changeset: r441:ca33279eb6d4
Date: 2013-06-10 18:56 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/ca33279eb6d4/

Log:    added storing into object to interpreter proxy

diff --git a/spyvm/interpreter_proxy.py b/spyvm/interpreter_proxy.py
--- a/spyvm/interpreter_proxy.py
+++ b/spyvm/interpreter_proxy.py
@@ -280,8 +280,23 @@
 def stSizeOf(w_object):
     return w_object.primsize(IProxy.space)
 
-#     sqInt  (*storeIntegerofObjectwithValue)(sqInt fieldIndex, sqInt oop, 
sqInt integer);
-#     sqInt  (*storePointerofObjectwithValue)(sqInt fieldIndex, sqInt oop, 
sqInt valuePointer);
+@expose_on_virtual_machine_proxy([int, oop, int], oop)
+def storeIntegerofObjectwithValue(n0, w_object, a):
+    if w_object.size() > n0:
+        space = IProxy.space
+        w_object.store(space, n0, space.wrap_int(a))
+        return space.wrap_int(a)
+    else:
+        raise ProxyFunctionFailed
+
+@expose_on_virtual_machine_proxy([int, oop, oop], oop)
+def storePointerofObjectwithValue(n0, w_object, w_value):
+    if w_object.size() > n0:
+        w_object.store(IProxy.space, n0, w_value)
+        return w_value
+    else:
+        IProxy.failed()
+        return w_value
 
 #     /* InterpreterProxy methodsFor: 'testing' */
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to