John Keiser wrote:
>
> 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.
Someone in another thread posted a question about security issues with
this interface, and this got me to thinking. With the interface as
described here, the gnu.vm.* methods *do* have to be public, as they are
being called by classes that are not in gnu.vm. I'm not sure how much of
a security risk this does entail; however, at first glance there is a
way that it would be possible to cut this risk down to nil.
Instead of putting these classes in gnu.vm, why not make them
package-private classes VMObject, VMClass, VMSystem, etc. in java.lang,
with package-private methods? Since there is no spec restriction on
package-private classes, this does not break our conformance. Some of
the methods would have to go in other packages, I believe - I'm not
aware of precisely which methods are required. But since they would all
start with "VM" it would be pretty easy for a vm implementor to locate
them all. Since java.* is presumably going to be Sealed anyway, the
security problem goes away.
If this has been discussed already and found to not be a problem, I
apologise - I bow to everyone else's superior expertise ;)
Another question, related to the same broad theme though: does anyone
know how immediate it will be to port these interfaces to Kaffe? It must
already have most of the code in there, as it has its own
implementations of the classes that call the interfaces. What licensing
issues would there be on implementations (eg, would implementing them
restrict the whole resultant platform to the GPL and still prohibit
running non-free code on it?) I suspect that porting to kaffe would also
increase interest in our project, as I believe kaffe is still better
known than japhar as well as being currently more mature.
Just some thoughts,
Stuart.