Author: Lars Wassermann <[email protected]>
Branch: 
Changeset: r287:9f1e3a4bd300
Date: 2013-04-16 16:21 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/9f1e3a4bd300/

Log:    fixed (?) the semaphore errors by informing the primitive-generation
        that the stack should remain untouched and removing the return value
        pushes (self)

diff --git a/spyvm/primitives.py b/spyvm/primitives.py
--- a/spyvm/primitives.py
+++ b/spyvm/primitives.py
@@ -1143,42 +1143,38 @@
     s_frame._sendSelector(w_selector, argcount, interp,
                       w_rcvr, w_rcvr.shadow_of_my_class(interp.space))
 
-@expose_primitive(SIGNAL, unwrap_spec=[object])
+@expose_primitive(SIGNAL, unwrap_spec=[object], clean_stack=False)
 def func(interp, s_frame, w_rcvr):
     # XXX we might want to disable this check
     if not w_rcvr.getclass(interp.space).is_same_object(
         interp.space.w_Semaphore):
         raise PrimitiveFailedError()
-    s_frame.push(w_rcvr) # w_rcvr is the result in the old frame
     return wrapper.SemaphoreWrapper(interp.space, 
w_rcvr).signal(s_frame.w_self())
 
-@expose_primitive(WAIT, unwrap_spec=[object])
+@expose_primitive(WAIT, unwrap_spec=[object], clean_stack=False)
 def func(interp, s_frame, w_rcvr):
     # XXX we might want to disable this check
     if not w_rcvr.getclass(interp.space).is_same_object(
         interp.space.w_Semaphore):
         raise PrimitiveFailedError()
-    # s_frame.push(w_rcvr) # w_rcvr is the result in the old frame
     return wrapper.SemaphoreWrapper(interp.space, 
w_rcvr).wait(s_frame.w_self())
 
-@expose_primitive(RESUME, unwrap_spec=[object], result_is_new_frame=True)
+@expose_primitive(RESUME, unwrap_spec=[object], result_is_new_frame=True, 
clean_stack=False)
 def func(interp, s_frame, w_rcvr):
     # XXX we might want to disable this check
     if not w_rcvr.getclass(interp.space).is_same_object(
         interp.space.w_Process):
         raise PrimitiveFailedError()
-    s_frame.push(w_rcvr) # w_rcvr is the result in the old frame
     w_frame = wrapper.ProcessWrapper(interp.space, 
w_rcvr).resume(s_frame.w_self())
     w_frame = interp.space.unwrap_pointersobject(w_frame)
     return w_frame.as_context_get_shadow(interp.space)
 
-@expose_primitive(SUSPEND, unwrap_spec=[object], result_is_new_frame=True)
+@expose_primitive(SUSPEND, unwrap_spec=[object], result_is_new_frame=True, 
clean_stack=False)
 def func(interp, s_frame, w_rcvr):
     # XXX we might want to disable this check
     if not w_rcvr.getclass(interp.space).is_same_object(
         interp.space.w_Process):
         raise PrimitiveFailedError()
-    s_frame.push(w_rcvr) # w_rcvr is the result in the old frame
     w_frame = wrapper.ProcessWrapper(interp.space, 
w_rcvr).suspend(s_frame.w_self())
     w_frame = interp.space.unwrap_pointersobject(w_frame)
     return w_frame.as_context_get_shadow(interp.space)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to