Re: Drawing the red line

Date view Thread view Subject view Author view

From: Alexandre Oliva (oliva@dcc.unicamp.br)
Date: Mon Nov 16 1998 - 02:25:34 EST


On Nov 16, 1998, Godmar Back <gback@cs.utah.edu> wrote:

> You raise several points here.

I hope I haven't raised points that have already been discussed. I
read the thread I found about this subject in the archives, but it was
a quite short one...

> ad 1), should it be extensible: I'd say there's no need for that.

Ok. I had just thought a pointer to a Throwable would have been
easier, but:

> ad 2), a Throwable would only work if it was preallocated and initialized.
> Otherwise, you would reenter functions below the red line: for instance,
> if a NoSuchMethodError is thrown in verifyBasicBlock, you would have to
> load, resolve, verify and execute the NoSuchMethodError class. This would
> require you to enter verifyBasicBlock, which of course doesn't work.

now I see another facet of the problem I hadn't noticed before.

> On the other hand, preallocating will be a good -- and the only possible ---
> alternative for tackling OutOfMemory exceptions.

Couldn't we just create an OutOfMemory object at VM start-up time, and
keep it at hand for whenever we need to throw such an object? Would
this violate any rule of the JVM Specification?

> ad 3), would storing it in JNIEnv work. I assume you mean the
> thread-specific data structure that JNIEnv points to

Actually, I was referring to whatever mechanism the current
implementation of JNI uses to store exceptions, so that the interface
would be completely uniform. But then, we'd have to create real
instances of the exception object, but you have already explained that
we can't do that in 2).

Anyway, I still don't like very much the idea of modifying the return
values of the functions. Can't we just rely on the fact that, if the
class name is NULL, no exception was thrown, otherwise the returned
value is meaningless?

-- 
Alexandre Oliva  http://www.dcc.unicamp.br/~oliva  aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org.au}
Universidade Estadual de Campinas, SP, Brasil


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:03 EDT