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


Groups > comp.compilers > #639

Re: Need idea for a compiler project

From Donald Strong <donald.s.strong@gmail.com>
Newsgroups comp.compilers
Subject Re: Need idea for a compiler project
Date 2012-05-18 00:35 -0700
Organization Compilers Central
Message-ID <12-05-010@comp.compilers> (permalink)
References <12-04-038@comp.compilers>

Show all headers | View raw


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.

Back to comp.compilers | Previous | NextPrevious in thread | Find similar


Thread

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

csiph-web