Author: Lars Wassermann <[email protected]>
Branch: 
Changeset: r453:6740391af94e
Date: 2013-06-14 16:45 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/6740391af94e/

Log:    added static tracing for called interpreter_proxy functions and
        fixed bool-return type

diff --git a/spyvm/interpreter_proxy.py b/spyvm/interpreter_proxy.py
--- a/spyvm/interpreter_proxy.py
+++ b/spyvm/interpreter_proxy.py
@@ -51,6 +51,7 @@
         def wrapped(*c_arguments):
             assert len_unwrap_spec == len(c_arguments)
             args = ()
+            print "Called InterpreterProxy >> %s" % func.func_name
             try:
                 for i, spec in unrolling_unwrap_spec:
                     c_arg = c_arguments[i]
@@ -65,9 +66,15 @@
                 elif result_type is list:
                     assert isinstance(result, list)
                     return IProxy.list_to_carray(result)
-                elif result_type in (int, float, bool):
+                elif result_type in (int, float):
                     assert isinstance(result, result_type)
                     return result
+                elif result_type is bool:
+                    assert isinstance(result, bool)
+                    if result:
+                        return 1
+                    else:
+                        return 0
                 else:
                     return result
             except error.PrimitiveFailedError:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to