[pypy-commit] lang-smalltalk default: added storing into object to interpreter proxy
lwassermann
noreply at buildbot.pypy.org
Mon Jun 10 19:00:43 CEST 2013
Author: Lars Wassermann <lars.wassermann at gmail.com>
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);
+ at 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
+
+ at 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' */
More information about the pypy-commit
mailing list