Changes in Tril

This post describes my fall 2019 internship in the Eclipse OpenJ9 team. After 4-months study term at school, I was excited to return to the team. I joined the OMR team and got the chance to work on Tril (the Testarossa Intermediate Language). Tril is a Domain Specific Language (DSL) for generating the Testarossa Intermediate Language (IL), and the main implementation is a small library with a parser and IL generator. During my term, my work was divided into 3 major parts.

The first main part was to implement the new parser for Tril. Previously, the parser was written in YACC and LEX, which does not always work properly in AIX, Window, etc. Also, the new parser avoids adding LEX & YACC as a dependency in OpenJ9. Therefore, the new parser is implemented as a scanner and lexer, which keeps reading in Tril input and returns the root of the corresponding built AST. Since the behavior was not stable locally, it took some time for me to debug segmentation faults, however, this was an opportunity to learn multiple debugging tools and technologies (i.e. running on fyre machine).

The second part was to integrate Tril into OpenJ9. Though this part is yet to be completed, it has already identified problems that were previously unknown. The first try was to build Tril inside OMR then import it as a library for OpenJ9. However, this will cause extensible class problems. Another possible method is to add Tril source files to build with j9jit, but this will cause more problems, of which one is that the TR::ResolvedMethod called in Tril is not used in OpenJ9. It is possible that this is fixed in the third change in Tril.

The third part was using an extensible class for IL generation step in Tril. The previous IL generation called TR::ResolvedMethod which is not used in OpenJ9. Therefore, it needed two classes to refactor the IL generation. One could be used by OpenJ9 directly, and OpenJ9 would need to extend more classes to achieve the rest of IL generation.

In these four months, I am so thankful to the whole OpenJ9 team. I especially appreciate my mentor (Leonardo) for guiding me throughout the whole term. It would not be possible for me to complete these tasks without his great ideas and explanations.

Leave a Reply