[armedbear-devel] Some thoughts on classloaders, ...

Don Cohen don-sourceforge-xxz at isis.cs3-inc.com
Tue Sep 22 05:58:25 UTC 2009


Matthew D. Swank writes:

 > If you are compiling code to the JVM where would the code go but in a
 > method?  If you are defining a method, where would you put it but
 > in a class.
I don't know what you mean by compiling code "to the jvm".
Code is anything that can be interpreted by some interpreter and comes
in many forms.  There are even many different forms of byte code.
I'd expect byte code to be represented in byte vectors.  Suppose we
don't want it to be jvm byte code, but some other sort, maybe clisp
byte code.  We can then write one single java function (in a method of
a class) that can interpret any vector of our (clisp) byte code.  We 
then declare a single class
    class compiledFunction{
        byte[] code;
        compiledFunction(byte[] codevector){
            code = codevector;
        }
    }
    compiledFunction f = new compiledFunction(vector);
We then interpret that by calling 
 interpret(f).

In this case the compiled code is in a byte vector, or perhaps you
would say it's in a compiledFunction object.  I don't think you'd say
it's in a class. 

If you can do that with clisp byte codes then why not with jvm byte
codes?  The only obvious difference is that the interpret function 
for jvm byte code vectors is already in the jvm so you don't even 
have to write it.





More information about the armedbear-devel mailing list