[Soot-list] registers in Jimple

Kihong Heo kheo at seas.upenn.edu
Sun Aug 20 22:15:11 EDT 2017


Hi Soot users,

Is there any way to optimize the number of registers when translating to Jimple?
I run Soot on the Ashes(http://www.sable.mcgill.ca/ashes/ <http://www.sable.mcgill.ca/ashes/>) benchmarks. 
One constructor of a class (symjpack-t/classes/z12.class, I attached) has thousands of registers
in Jimple (actually bytecode -> Jimple is not a big problem, only 3 seconds).
Consequently it takes very long time (5 minutes) when I transform the Jimple file into Shimple. 
The bottle neck is the constructor of z12.

I disassembled the constructor (because I couldn’t find the java source file of the class), it looks like:

/* disassembled JAVA code */
public z12() {
    z7[] arrayOfz7 = new z7[1500];
    arrayOfz7[0] = new z7("0", 14, null, null, this.z0);
    arrayOfz7[1] = new z7(null, 9, arrayOfz7[0], arrayOfz7[0], this.z0);
    …
    arrayOfz7[1499] = new z7(...);
}

This code is translated to 
/* Jimple  */
public z12() {
    r1 = newarray (z7)[1500];    //  z7[] arrayOfz7 = new z7[1500];
    ….
    specialinvoke $r6.<init>("0", 14, null, null, $r7);  //  new z7();
    r1[0] = $r6;                                                          // arrayOfz7[0] = ...
    $r8 = new z7;
    $r10 = r1[0];
    $r11 = r1[0];
    $r9 = r0.z0;
    specialinvoke $r8.<init>(null, 9, $r10, $r11, $r9);
    r1[1] = $r8;                                                          // arrayOfz7[1] = ...
    $r12 = new z7;
    $r15 = r1[1];
    $r13 = r1[0];
    $r14 = r0.z0;
    ….
    r1[1499] = …
    $r6919 = …
}

As you can see, the Jimple file is almost in the form of SSA as it is,
so it seems to take a long time because of the large number of registers.

I used the latest Soot with the following command:
java -cp soot-trunk.jar soot.Main -cp symjpack-t/classes -pp -f j z12   #for jimple
java -cp soot-trunk.jar soot.Main -cp symjpack-t/classes -pp -f j z12   #for shimple


Best,
- Kihong Heo




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20170820/e8170e9e/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: z12.class
Type: application/octet-stream
Size: 56267 bytes
Desc: not available
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20170820/e8170e9e/attachment-0001.class>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20170820/e8170e9e/attachment-0003.html>


More information about the Soot-list mailing list