[FIX][BUG] ExceptionTester>>simpleOuterTest fails

Tim Rowledge tim at sumeru.stanford.edu
Fri May 28 04:32:26 UTC 2004


Anthony Hannan <ajhannan at yahoo.com> wrote:

> Tim Rowledge <tim at sumeru.stanford.edu> wrote:
> > Whilst digging around I was also startled by the current implementation
> > of #aboutToReturn:through: which really doesn't look as if it could
> > possibly work. I'm reasonably convinced that it
> > shouldn't involve #terminateTo: until after the unwinding is completed
> > but I could be wrong. Can anyone explain the comment in
> > ContextPart>return: ? If nothing else it's a bit strange to not make
> > use of the VM provided initial context.
> 
> In senders of #terminateTo:, like #return: and #restart, unwinding is done
> while terminating. They find the next ensure:/ifCurtailed: (unwind) sender,
> terminate to it, execute its unwind block, then repeat until the target home
> context is found.
Yeah, ok I'll buy that. The older implementation didn't bother to do
explicit terminations since it simply reset the sender ivar and left
cleanup to the GC.

> 
> #aboutToReturn:through: simply calls #return: which performs the unwind loop
> described above. The supplied first unwind sender is redundant. To use it would
> require starting in the middle of the unwind loop, requiring another interface
> to the return method. I would rather keep a single simple #return: interface
> and pay the extra primitive call to find the first unwind sender again.
> Non-local returns through an unwind context are probably rare, so I don't think
> its worth adding the extra return interface to save this one primitive call. Of
> course, others may disagree.
Probably a toss up. One could replace return: with return:from: and
pass in either thisContext or the VM supplied first-unwind as needed. 

tim
--
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- He's not a complete idiot -- some parts are missing.



More information about the Squeak-dev mailing list