Author: Lars Wassermann <[email protected]>
Branch: 
Changeset: r311:6ce27d176682
Date: 2013-04-22 14:04 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/6ce27d176682/

Log:    added store stackpointer primitive in later squeak versions, instead
        of having in alternative implementation in case of primitive-failure
        an error is raised.

diff --git a/spyvm/primitives.py b/spyvm/primitives.py
--- a/spyvm/primitives.py
+++ b/spyvm/primitives.py
@@ -458,11 +458,14 @@
         raise PrimitiveFailedError()
     return interp.space.wrap_int(w_rcvr.gethash())
 
-@expose_primitive(STORE_STACKP, unwrap_spec=[object, object])
-def func(interp, s_frame, w_obj1, w_obj2):
-    # This primitive seems to resize the stack.  I don't think this is
-    # really relevant in our implementation.
-    raise PrimitiveNotYetWrittenError()
+@expose_primitive(STORE_STACKP, unwrap_spec=[object, int])
+def func(interp, s_frame, w_frame, stackp):
+    assert stackp >= 0
+    if not isinstance(w_frame, model.W_PointersObject):
+        raise PrimitiveFailedError
+    s_frame = w_frame.as_context_get_shadow(interp.space)
+    s_frame.store_stackpointer(stackp)
+    return w_frame
 
 @expose_primitive(SOME_INSTANCE, unwrap_spec=[object])
 def func(interp, s_frame, w_class):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to