[pypy-commit] lang-smalltalk default: fixed (?) the semaphore errors by informing the primitive-generation that the stack should remain untouched and removing the return value pushes (self)

lwassermann noreply at buildbot.pypy.org
Tue Apr 16 16:25:46 CEST 2013


Author: Lars Wassermann <lars.wassermann at gmail.com>
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))
 
- at expose_primitive(SIGNAL, unwrap_spec=[object])
+ at 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())
 
- at expose_primitive(WAIT, unwrap_spec=[object])
+ at 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())
 
- at expose_primitive(RESUME, unwrap_spec=[object], result_is_new_frame=True)
+ at 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)
 
- at expose_primitive(SUSPEND, unwrap_spec=[object], result_is_new_frame=True)
+ at 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)


More information about the pypy-commit mailing list