Jimple

Jimple

Jimple is an intermediate representation of a Java program and language for it, designed as an alternative to the stack-based bytecode. It is typed and has a form of conventional three address code, thus the designer believes it is more suitable for optimization. On the one hand this is because Jimple consists of only 15 different possible operations. Hence, in any flow analysis only those 15 different cases need to be handled. Java bytecode on the other hand supports more than 200 different operations. Also, Jimple is fully typed, i.e. even local (and stack) variables have a type and hence are by construction type safe, a property which also does not hold for local variables in Java bytecode. There, type safety has to be assured by the Jave bytecode verification mechanism.

Shimple is an SSA (static single assignment) form variant and Grimp is an aggregated version of Jimple. Those three representations are part of Soot Java optimization framework.

The main task for Jimple is to convert stack-based bytecode into 3-address code. The task, in context of Jimple, is called "Jimplifying", the term punning on "simplifying". [http://www.sable.mcgill.ca/publications/techreports/#report1] The idea behind the conversion, first investigated by Clark Verbrugge, is to see each position in the stack has a corresponding variable, and pushing a value is thus to assign a value to the variable. Put in another way, every operation has to be done on stack variables after values are loaded to them.

Consider the following bytecode, which is from the paper.

iload 1 // load variable x1, and push it onto the stackiload 2 // load variable x2, and push it onto the stackiadd // pop two values, and push the sum of the two onto the stackistore 1 // pop a value from the stack, and push it onto the stack

The above can be thought of the following 3-address code.

stack1 = x1 // iload 1stack2 = x2 // iload 2stack1 = stack1 + stack2 // iaddx1 = stack1 // istore 1

In general the resulting code does not have static single assignment form.

ee also

* Optimization (computer science)

Publications

* Raja Vallee-Rai and Laurie J. Hendren. Jimple: Simplifying Java Bytecode for Analyses and Transformations. 1998. [http://www.sable.mcgill.ca/publications/techreports/#report4] .
* Raja Vallee-Rai The Jimple Framework. 1998. [http://www.sable.mcgill.ca/publications/techreports/#report1]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Soot (computer science) — In computer science, Soot is a language manipulation and optimization framework consisting of intermediate languages for Java. It has been developed by the Sable Research Group at McGill University known for its Sable VM, a Java virtual machine… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”