|Need idea for a compiler project email@example.com (Raphael Ernani Rodrigues) (2012-04-19)|
|Re: Need idea for a compiler project firstname.lastname@example.org (Donald Strong) (2012-05-18)|
|From:||Donald Strong <email@example.com>|
|Date:||Fri, 18 May 2012 00:35:20 -0700 (PDT)|
|Posted-Date:||18 May 2012 12:48:24 EDT|
I am developing a code generator called ClassMaker.
The objective of Classmaker is to make code generation easy and as a
consequence it is not particularly optimised.
I don't really care as I intend to use ClassMaker for generating
classes from within applications or as a back end for domain specific
languages, so efficiency is not my primary goal.
The JVM doesn't directly support boolean types in expressions. You
have to push ones and zeros onto the stack and then perform tests
based on these values. The result is lots of bloated bytecode around
branches and shortcut logic expressions.
One can use a peephole optimiser to optimise out all of this redundant
code, as described in this BCEL paper.
I use a class called ClassFileWriter, which is pulled directly out of
An optimiser that works on the methods (arrays of byte) that this
produces might meet your requirements and may help me as well.
This is not a high priority for me, but I saw your post and thought I
would throw it out there.
Return to the
Search the comp.compilers archives again.