Author: Tim Felgentreff <[email protected]>
Branch: rbitblt
Changeset: r562:151ff8db1a76
Date: 2014-01-09 16:22 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/151ff8db1a76/

Log:    add WITH_ARGS_EXECUTE_METHOD prim, as it doesn't work in Smalltalk

diff --git a/spyvm/primitives.py b/spyvm/primitives.py
--- a/spyvm/primitives.py
+++ b/spyvm/primitives.py
@@ -1230,6 +1230,7 @@
 RESUME = 87
 SUSPEND = 88
 FLUSH_CACHE = 89
+WITH_ARGS_EXECUTE_METHOD = 188
 
 @expose_primitive(BLOCK_COPY, unwrap_spec=[object, int])
 def func(interp, s_frame, w_context, argcnt):
@@ -1341,6 +1342,20 @@
     s_frame.pop()
     return interp.stack_frame(s_new_frame)
 
+@expose_primitive(WITH_ARGS_EXECUTE_METHOD, unwrap_spec=[object, list, 
object], no_result=True)
+def func(interp, s_frame, w_rcvr, args_w, w_cm):
+    if not isinstance(w_cm, model.W_CompiledMethod):
+        raise PrimitiveFailedError()
+
+    s_method = w_cm.as_compiledmethod_get_shadow(interp.space)
+    code = s_method.primitive()
+    if code:
+        raise PrimitiveFailedError("withArgs:executeMethod: not support with 
primitive method")
+    s_new_frame = s_method.create_frame(interp.space, w_rcvr, args_w, s_frame)
+    if interp.trace:
+        print interp.padding() + s_new_frame.short_str()
+    return interp.stack_frame(s_new_frame)
+
 @expose_primitive(SIGNAL, unwrap_spec=[object], clean_stack=False, 
no_result=True)
 def func(interp, s_frame, w_rcvr):
     # XXX we might want to disable this check
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to