[squeak-dev] Three questions

Eliot Miranda eliot.miranda at gmail.com
Fri Aug 3 18:42:21 UTC 2012


On Sun, Jul 29, 2012 at 7:56 AM, Mateusz Grotek <unoduetre at poczta.onet.pl>wrote:

> Hi
> I have the following 3 questions:
> 1. Why there is ContextPart>>releaseTo: ? What will happen if I don't
> use it?
>

releaseTo: simulates the effect of doing a method return from a block, i.e.
when a return exits more than the top context.  It sends singleRelease to
each context exited, which sets the pc and sender to nil (and nils the
stack, but this is excess to requirements).  releaseTo: is actually used
when a method return from a block encounters an unwind-protect and control
passes up to the image to run the unwind.  You don't need to use it.  It is
used automatically as part of running unwinds.  In what situation do you
think you do need to use it?


2. Is there a bytecode editor for Squeak?
>

See Marcus Denker's Opal compiler.  This contains an assembler.


> 3. Are there any issues concerning bytecode editing, contexts, closures
> and compiled methods I should be aware of, which may break the
> image/create uncollectable garbage?
>

Invalid methods can easily crash the image, so one has to be careful to
create valid methods.  Both the Interpreter, and especially Cog, cache
information related to methods to optimize execution.  One must be careful
to flush the VM caches appropriately when changing methods that are in use.



-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20120803/51462f2b/attachment.htm


More information about the Squeak-dev mailing list