Java Intermediate Language

From Wikipedia, the free encyclopedia

For information on the Alloy Wheel Casting mark JIL see JIL standard.

In computer science, Java Intermediate Language is an intermediate language (which is a subset of XML and SGML) representing the type structure of a Java program. The language was proposed by the team of SableVM in McGill University in January 2002 to aid the analysis of a Java program with the goals of scalability and good performance.

The language has not seen much adoptation outside the Sable team.

[edit] Example

Consider the following piece of Java code.

public MyClass implements MyInterface extends MySupperClass {
  int MyField;

  void MyMethod (double x, double y) {
    double z;
    z = x + y;
    this.MyField = z
  }
}

This piece can be expressed in the language, as follows:

<jil>
<class name="MyClass" extends="MySupperClass">
  <modifiers><modifier name="public" /></modifiers>
  <interfaces><interface name="myinterface" /></interfaces>
    
  <fields>
    <field name="MyField" type="int" />
  </fields>

  <methods>
    <method name="MyMethod" returntype="void">
    <parameters>
      <parameter name="x" type="double" />
      <parameter name="y" type="double" />
    </parameters>
    <locals>
      <local name="z" type="double" />
    </locals>
    <statements>
      <!-- Each statement is expressed by some intermediate format for
           code generator like three address code. In the below
           a language called baf is used. -->
      <baf>
        <![CDATA[
          $r2 = $r0 + $r1;
          this.MyField = (double) $r2;
        ]]>
        <!-- Here, we are assuming x is expressed as $r0, y $r1 and z $r2.
      </baf>  
    </statements>
    </method>
  </methods>
</class>
</jil>

[edit] External links