Subj : Re: GCJ + Rhino To : Andy Madigan From : Igor Bukanov Date : Wed Aug 25 2004 10:18 am Andy Madigan wrote: > I've been trying to use GCJ to compile Rhino natively (so that, for > instance, a natively compiled app could expose Java APIs to a script, > which would be useful for many purposes.) I've had a few problems thus > far: > 1: org.mozilla.javascript.classfile.ClassFileWriter cannot be compiled, > however, I was able to compile a shared object anyway by removing any > classes that referenced to ClassFileWriter directly. What is exactly the problem there? Does GCJ crash? AFAIK gcc was able to compile Rhino as is. > 2: GCJ-compiled apps cannot dynamically load any classes compiled by > jsc with optlevel > 0, workaround is to use optlevel 0. Again, what is the problem? > > While I'm fairly sure these are both problems with GCJ, I was wondering > if anyone had found a better workaround for either problem. The current advise is simple: use pure interpretation, optimization mode == -1, with GCJ or compile your scripts with jsc and then use GCC to compile JVM bytecode to native code. GCJ runtime interprets JVM bytecode rather slowly and dynamically loaded classes generated by Rhino can actually run slower then Rhino interpreter which would be natively compiled. Regards, Igor .