harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Egor Pasko <egor.pa...@gmail.com>
Subject Re: [general] GSoC 2008 Refactor Java Bytecode Translator
Date Thu, 20 Mar 2008 13:10:48 GMT
On the 0x40D day of Apache Harmony Okonechnikov Konstantin wrote:
> Hello everyone!

Hello, Konstantin! Thank you for your interest in the project!

> Currently I am solving a problem of  optimizing callee-saved register
> spilling in JiT opt codegenerator.

hm, and how is it going? :)

seriously, what is your experience with the code?

> I find Apache Harmony project very perspective and I am intrested in
> the idea "Refactor Java Bytecode Translator in Harmony JIT".

good!

> The goal is to move all optimizations to HL optimizer or there's
> something else? What data structures need to be simplified?

the idea is to replace the code that parses java bytecode (converts it
from stack-based to register-like based IR) with a completely new
implementation.

Namely, there is a JavaLabelPrepass class that namely should only mark
boundaries of basic blocks. But it does a lot more, for example,
inferring types of variables. It is very complicated, makes
unpredictable number of traversals through the bytecode, not easy to
support.

So, the steps of marking basic blocks and type inference should be
separated.

Then JavaByteCodeTranslator makes a single-pass through each basic
block, invoking IRBuilder, that invokes Simplifier. That was done long
time ago, when we did not have a fast compiler, now we have JET, we
need this code to be cleaned. I.e. do not perform simplification
on-the-fly, much better solution is to invoke it afterwards, when we
have HIR. IRBuilder separation necessity is reported as HARMONY-5500.

A good example of clean code that does similar things is Jitrino.JET
compiler, but I did not investigate if it could be reused. Maybe you
can first try to build IR by extending Jitrino.JET.

Feel free to ask more questions on this.

> And one more question: do I have to insert wiki into
> http://wiki.apache.org/general/SummerOfCode2008 or an appliacation woud be
> enough to present my ideas?

no. you do not need to update the page.

-- 
Egor Pasko


Mime
View raw message