[FIX][ENH]Exception handling 'unwind' behaviour fixed

Tim Rowledge tim at sumeru.stanford.edu
Thu Sep 7 00:28:41 UTC 2000


For some time the behaviour of the system's unwind-on-non-local-return
has been broken. Stephen Pair submitted a neat little fix some time ago
but since it bounced _all_ non-local returns (i.e. [fooble doThis. ^barf
doThat]) back to the image to sort out the performance was a bit of an
issue.

Starting from that work, Paul McDonough improved the unwind behaviour
(as used in #ensure: etc) so that all the ExceptionTester class tests
worked correctly, along with all the CampSmalltalk SUnit tests.

I have been able to rework the Interpreter>returnValue:to: routine to
check properly for a non-local return through a marked method context
and to behave properly with no noticable performance hit. Some extra
prims to help with cleaning up afterwards make a simple package that
restores the system to full functionality without an unpleasnt
perforance hit.

As trivial examples, on my P3/600 liGNUx box:-
+ the plain vm records about 2800 % Dorado, but cannot successfully
handle the #ensure: message.
+ a VM built from Stephen/Paul's code records about 2400 % but can do
#ensure: correctly.
+ a VM built with this changeset records about 2750% and still passes al
the tests.

Although the primitives for scanning the stack might seem a little
pointless (stacks are usually short, and the scan does little work,
after all), they should be of considerable use to the upcoming jitter
vm. When you are caching contexts for performance, you really don't want
to have to realise them as a part of a non-local return unless
absolutely neccessary. By extending #returnValue:to: and using prims for
subsequent scanning, you can handle (nearly) all the tracing in the VM
without disturbing the context cache, saving mondo cycles.

The code is completely platform agnostic, very simple, and images with
it filed in will work on your old VM just the same. Generate and build
a new VM and it will run old images quite happily. With a new VM and
image you will be able to rely on #ensure: working the wait it is
supposed to.

If you want to try this you can:-
+ grab http://sumeru.stanford.edu/tim/pooters/SqFiles/Exceptions-3.4.cs
and roll your own.
+ grab
http://sumeru.stanford.edu/tim/pooters/SqFiles/SqueakUnwind.sit.bin for
your (PPC)Macs
+ grab  http://sumeru.stanford.edu/tim/pooters/SqFiles/SqueakUnwind.tgz
for your x86 liGNUx machines
+ wait and hope somebody sends me a suitable Windows VM to package.

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Computer Science: solving today's problems tomorrow.





More information about the Squeak-dev mailing list