This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Exception Handling
Chris Gray writes:
>
> > > The number of stack frames which have to be unwound is probably
> > > also of interest: my guess would be that many throws are caught in
> > > the same stack frame, but a substantial number will propagate a
> > > long way up the stack.
> > >
> > > I think the measurements will have to be done by instrumenting the
> > > compiler - it's not easy for a runtime such as IKVM (or Wonka) to
> > > know that a try{} block is being entered. IOW I'm not volunteering
> > > to make the measurements, just suggesting that Somebody should do
> > > something. :)
> >
> > Well, I can do it easily, but then I have to have a corpus of code to
> > measure. And some reason to do the study at all: unless there is a
> > realistic prospect of defining a new unwinder mechanism, there will be
> > little point.
>
> Yes of course there has to be an a priori case to answer, and some
> likelihood that if the try/throw ratio proves to be low then some
> effort to define a new unwinding mechanism will be made. That's
> optimisation for you: guess, measure, experiment, repeat.
Yeah, but we can't change the mechanism used by gcj because we use the
same mechanism as C++, and this is defined by the ABI of the platforms
we run on. It may be that the ratio of try/throw is different in Java
programs and C++ programs, of course, so we may suffer because we use
the same mechanism.
Andrew.