--- Andrew Haley <aph@xxxxxxxxxx> wrote: > John M. Gabriele writes: > > > > > > --- Bryce McKinlay <mckinlay@xxxxxxxxxx> wrote: > > > > > John M. Gabriele wrote: > > > > > > >Thanks for the reply Bryce. I used much of it to update the > > > >beginning of: > > > >http://gcc.gnu.org/wiki/How%20to%20BC%20compile%20with%20GCJ > > > > > > > > > > > > > > Great, thanks for doing this. > > > > NP. :) I'm updating it as we go. > > > > > > > > >It sounds like, to be able to mix interpreted and natively > > > >compiled code at runtime, you need to have compiled your .jars > > > >with the -findirect-dispatch option, right? > > > > > > > > > > > > > > If you want to be able to call interpreted code from native code, yes. > > > > So, we're talking about my natively compiled binary loading and > > using some regular old .jar file full of .class files... > > > > I don't get it. As I'm understanding it, if the natively compiled code > > makes use of ClassLoader.defineClass(), it should just work right off the > > bat without the native code having been built with -findirect-dispatch, > > since when it tries to read a bytecode stream from the jar, it'll > > find it there. No fuss, no muss, right? > > Right, that's true. And that will work. However, if your compiled > program does something like > > foo.bar(); > > where foo *only* exists in bytecode -- has never been gcj-compiled -- > then that will *not* work. *Only* exists in bytecode (if I'm understanding what you mean) is just fine -- since that's what ClassLoader.defineClass() expects, correct? My native code still knows how to deal with bytecode... Hmm. Maybe I'm not understanding what you mean by only existing in bytecode... Is foo an instance of a class defined in the mystuff.jar file? > But if your compiled program has been > compiled with -findirect-dispatch, then it will find the jar in the > classpath and load it. ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs