[pypy-commit] lang-smalltalk default: added remaining other functions

lwassermann noreply at buildbot.pypy.org
Mon Jun 10 19:00:46 CEST 2013


Author: Lars Wassermann <lars.wassermann at gmail.com>
Branch: 
Changeset: r443:2a52dc328e17
Date: 2013-06-10 18:58 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/2a52dc328e17/

Log:	added remaining other functions

diff --git a/spyvm/interpreter_proxy.py b/spyvm/interpreter_proxy.py
--- a/spyvm/interpreter_proxy.py
+++ b/spyvm/interpreter_proxy.py
@@ -491,10 +491,30 @@
 
 #     /* InterpreterProxy methodsFor: 'other' */
 
-#     sqInt (*becomewith)(sqInt array1, sqInt array2);
-#     sqInt (*byteSwapped)(sqInt w);
-#     sqInt (*failed)(void);
-#     sqInt (*fullDisplayUpdate)(void);
+ at expose_on_virtual_machine_proxy([list, list], int)
+def becomewith(w_array1, w_array2):
+    # XXX: stub, until used
+    print "InterpreterProxy >> becomewith(list, list)"
+    return 0
+
+ at expose_on_virtual_machine_proxy([int], int)
+def byteSwapped(w):
+    from rpython.rlib.rarithmetic import intmask
+    return (w >> 24) & 0xFF + (w >> 8) & 0xFF00 + (w << 8) & 0xFF0000 + (w << 24) & -16777216
+
+ at expose_on_virtual_machine_proxy([], bool)
+def failed():
+    return not IProxy.fail_reason == 0
+
+ at expose_on_virtual_machine_proxy([], int)
+def fullDisplayUpdate():
+    w_display = IProxy.space.objtable['w_display']
+    if isinstance(w_display, model.W_DisplayBitmap):
+        w_display.flush_to_screen()
+        return 0
+    else:
+        raise ProxyFunctionFailed
+
 @expose_on_virtual_machine_proxy([], int)
 def fullGC():
     # XXX: how to invoke gc?


More information about the pypy-commit mailing list