Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #581 > unrolled thread

Need idea for a compiler project

Started byRaphael Ernani Rodrigues <raphaelernani@gmail.com>
First post2012-04-19 08:01 -0700
Last post2012-05-18 00:35 -0700
Articles 2 — 2 participants

Back to article view | Back to comp.compilers


Contents

  Need idea for a compiler project Raphael Ernani Rodrigues <raphaelernani@gmail.com> - 2012-04-19 08:01 -0700
    Re: Need idea for a compiler project Donald Strong <donald.s.strong@gmail.com> - 2012-05-18 00:35 -0700

#581 — Need idea for a compiler project

FromRaphael Ernani Rodrigues <raphaelernani@gmail.com>
Date2012-04-19 08:01 -0700
SubjectNeed idea for a compiler project
Message-ID<12-04-038@comp.compilers>
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

[toc] | [next] | [standalone]


#639

FromDonald Strong <donald.s.strong@gmail.com>
Date2012-05-18 00:35 -0700
Message-ID<12-05-010@comp.compilers>
In reply to#581
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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.compilers


csiph-web