Since it's come up, I would like to correct a few ideas about the
current VM interface. It has been changed and simplified significantly
since the message Aaron referred to.
There is basically a set of classes like gnu.vm.Object, gnu.vm.Class,
etc., that the virtual machine is expected to provide. They will
contain static methods which the java.lang and other VM-dependent
classes will call. These methods will not necessarily be perfect
mirrors of the java.lang methods. They will include the minimum
functionality necessary to be provided by the VM.
For example, the code "myObject.wait()" will call Object.wait(),
which has this body:
public final void wait() throws InterruptedException {
gnu.vm.Object.wait(this);
}
In general, a decent optimizing linker will optimize this extra call
out.
The class gnu.vm.Object will be provided by the VM and probably look
like this (you can implement it any way you want, of course):
package gnu.vm;
public class Object {
...
public static native void wait(java.lang.Object this) throws
InterruptedException;
...
}
The native method implementations will presumably be provided in the
VM itself rather than a library, to avoid bootstrapping problems. Quite
possibly the only native method that would *have* to be hardcoded into
the VM would be gnu.vm.System.loadLibrary(). But I am not sure of that.
The gnu.vm methods will have to perform the appropriate security
checks as well, to avoid potential security hazards.
Status: I have created many of the interfaces now and when I own my
time again in a week or so, I will get down to porting to Japhar. I
will release the interfaces as soon as they are finished so that Ghost
and anyone else who wishes can begin the port. Be advised if you decide
to port right now that while the actual specs for the static methods are
unlikely to change, the names and packages of the classes they are in
may change to accomodate space efficiency and ease of porting. In other
words, it won't be a difficult change at all, just something to keep in
mind.
--John Keiser
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com