Hi;

Todd L. Miller wrote:
>         Anyway, I'm now looking at tackling java throws.  Throws generated
> by the java code itself should be relatively easy to handle.  Throws
> generated by the VM in runOpCode() should be somewhat more difficult, but
> nonetheless straightforward.  The problem will be in handling exceptions
> generated by functions called from w/in runOpcode() and their sundry and
> various sub-functions.  I am loathe to put the exception is some global
> area and put a check in at the end of runOpcode(); it's not terribly
> elegant and will die a horribly screaming death if we ever have multiple
> native processes.  JM, I know you've got the hood open, so to speak, right
> now?  Do you, or does anyone else, have any suggestions, aside from rather
> gruntingly brute-force "rewrite everything to return an exception pointer"
> approach?

Based upon a whole 5 seconds of thought, I think you can handle both the "code
itself" and "functions called from w/in runOpcode" cases the same way.  Since
they're (just about) frame methods, you can call a frame/java_thread method to
pop the appropriate stack frames in the classical fashion.  Right?

>         Note that access to a classloader might be problematic as well --
> the JVM needs to generate java_objects to point to for these exceptions,
> though this might be done by some other code than the originator at some
> later point in time.  [A global 'enviroment' table with the
> JVM-generatable exception classes in it?  (which each carry their own
> classloader)]

Based upon another whole 5 seconds of thought, the only nasty problem I can
think of is (if there is?) an "out of memory" exception (it would Truly Suck to
be out of memory and then have to allocate an "out of memory" exception to
throw).  One might want to have a preallocated exception allocated for that
case.

-jm

-- 
==== John Morrison            ==== MaK Technologies, Inc.
==== Chief Technology Officer ==== 185 Alewife Brook Pkwy, Cambridge, MA 02138
==== [EMAIL PROTECTED]               ==== http://www.mak.com/welcome.html
==== vox:617-876-8085 x115    ==== fax:617-876-9208

_______________________________________________
Kernel maillist  -  [EMAIL PROTECTED]
http://jos.org/mailman/listinfo/kernel

Reply via email to