Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need idea for a compiler project

57 views
Skip to first unread message

Raphael Ernani Rodrigues

unread,
Apr 19, 2012, 11:01:07 AM4/19/12
to
Dear all,

I am a MsC student, and I want to do research in code optimization
and generation. I am taking an advanced course on algorithms, and the
course project asks to develop a graph-related algorithm that deals
with some actual application. There are a lot of compiler back-end
algorithms that deal with graphs: register allocation, partial
redundancy elimination, instruction scheduling, etc. So, I would like
to see if any of you could give me an idea of a good graph-related
algorithm that I could implement, and experiment with, in this course
project. The idea does not have to be new or visionary. It would be
good if there is a nice graph-related algorithm underlying it. One
last thing: this idea should be something that an experienced
programmer with a good compiler background should be able to implement
in nine weeks.

Regards to all,

Raphael

Donald Strong

unread,
May 18, 2012, 3:35:20 AM5/18/12
to
Hi Rapheal,

I am developing a code generator called ClassMaker.
https://sourceforge.net/apps/trac/classmaker/wiki

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.

http://bcel.sourceforge.net/downloads/paper.pdf
Section 2.8

I use a class called ClassFileWriter, which is pulled directly out of
Mozilla Rhino Javascript compiler, to generate the bytecode.
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.

Regards Donald.

0 new messages