Jimple
From Wikipedia, the free encyclopedia
| This article is orphaned as few or no other articles link to it. Please help introduce links in articles on related topics. (October 2006) |
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". [1] 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 stack iload 2 // load variable x2, and push it onto the stack iadd // pop two values, and push the sum of the two onto the stack istore 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 1 stack2 = x2 // iload 2 stack1 = stack1 + stack2 // iadd x1 = stack1 // istore 1
In general the resulting code does not have static single assignment form.
[edit] See also
[edit] Publications
- Raja Vallee-Rai and Laurie J. Hendren. Jimple: Simplifying Java Bytecode for Analyses and Transformations. 1998. [2].
- Raja Vallee-Rai The Jimple Framework. 1998. [3]

