Calling methods from primitives

Stephen Pair spair at
Thu Apr 29 17:20:35 UTC 1999

What if you altered the instruction pointer (IP) and stack pointer (SP; to
push any parameters) and then called interpret?  Would that work?  Also,
would the debugger be able to handle having the primitive context on the

It seems to me if that would work, it should then be trivial to implement a
macro for doing message sends from the VM (or pluggable prims).

- Stephen

> -----Original Message-----
> From: stp at [mailto:stp at]On Behalf Of Stephen Pope
> Sent: Thursday, April 29, 1999 12:08 PM
> To: squeak at
> Subject: Re: Calling methods from primitives
> Stephen Pair wrote:
> >
> > Does anyone how to invoke a method on an object from within a
> primitive?  Is
> > there a way?
> There's no direct and simple way to handle arbitrary "call-backs"
> from the VM
> into Smalltalk. I do it via Semaphores. You can easily register a
> semaphore as
> an external object, then signal it from a primitive. If you have
> a Smalltalk
> process waiting on the semaphore, it can do whatever it wants --
> send a message,
> call another primitive, etc.
> --
> stp
>   Stephen Travis Pope
>   stp at

More information about the Squeak-dev mailing list