Jimple 1992504 188005638 2008-01-30T21:34:36Z CmdrObot 1079367 sp: a SSA→an SSA {{Orphan|date=October 2006}} '''Jimple''' is an intermediate representation of a [[Java (programming language)|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 (computer science)|Soot Java optimization framework]]. The main task for Jimple is to convert stack-based bytecode into [[Three-address code|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. <pre> 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 </pre> The above can be thought of the following 3-address code. <pre> stack1 = x1 // iload 1 stack2 = x2 // iload 2 stack1 = stack1 + stack2 // iadd x1 = stack1 // istore 1 </pre> In general the resulting code does not have [[static single assignment form]]. ==See 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] {{compu-lang-stub}} [[Category:Java platform]]