Brian Jones wrote:
> Btw, there are entirely too many bytecode libraries out there... Jode,
> gnu.bytecode, Apache's version of the same, and on and on... anyone
> know what the best GPL and BSD compatible ones are?
It depends what you're trying to do. gnu.bytecode is optimized for
low-overhead code generation, plus basic slurping of the contents of
.class files, and it is less suited (at least in its
current incarnation) for heavy-duty instruction analysis,
peephole optimization, etc. Most similar libraries seem to use one
object for each instruction, which is flexible, but expensive.
gnu.bytecode just appends instructions into a byte array, using
a large set of convenience methods that pick the correct instructions.
(Simplified of course. For example, you can reference undefined
"labels", so you have to be able to back-patch the array. And
there is limited support for re-ordering code.) (I would like
change it to use "basic blocks" as the fundamental unit, using the
algorithms I wrote for gcc/java/jcf-write.c, but I haven't had time.)
gnu.bytecode is compatible with the GPL.
--
--Per Bothner
[EMAIL PROTECTED] http://www.bothner.com/per/
_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath