Java Bytecode Translator Refactoring


Okonechnikov Konstantin (


Currently Jitrino OPT compiler has some problems with Java bytecode translator. Translator has unobvious and complex structure that makes difficult further expansion and evolution.

Project details and success criteria

The translator should have flexible and comprehensive architecture. The first steps of development will be analysis & design. This process will allow me to define specifications, elaborate development scheme and work out project model.

To implement it I will use existing code. Some good approaches to the first step can be found in Jitrino JET. (For example, the first pass of JET determines basic blocks) To perform data analysis I will check with JavaLabelPrepass methods from current implementation of Java bytecode translator. To build Internal Representation, current translator invokes IRBuilder, which will be used in new implementation.



These are important milestones of project implementation, witch will represent the progress:

  1. Bytecode prepass
  2. Data flow analysis
  3. Bytecode mapping
  4. Add support for call instructions,lazy resolution, etc
  5. (!) HelloWorld runs successfully

  6. Add support for JSR/RET instructions (using current approach - CFG optimzer pass)
  7. Add support for inliner
  8. (!) All tests pass and Eclipse works in JIT opt mode

  9. Remaining features implementation, testing, debugging

Profit to Apache Harmony

Adding new functionality, expanding existing features are essential principles of successful development. The implementation of new translator will make it easier to maintain Harmony DRLVM; it will promote further development of Apache Harmony project.

WikiTranslatorRefactoringProposal (last edited 2009-09-20 23:35:13 by localhost)