[Soot-list] How can i turn off forced optimization in soot

60 views
Skip to first unread message

cl0und

unread,
Oct 23, 2020, 9:23:00 AM10/23/20
to soot...@cs.mcgill.ca
Hi, I found when exec `PackManager.v().runPacks()`, the soot.PackManager#runBodyPacks(soot.SootClass) method will be called and the code in this method
```code
CopyPropagator.v().transform(body);
ConditionalBranchFolder.v().transform(body);
UnreachableCodeEliminator.v().transform(body);
DeadAssignmentEliminator.v().transform(body);
UnusedLocalEliminator.v().transform(body);
```
will be forced to optimize jimple body, and I cannot bypass it. So, how can I turn off the forced optimization in soot?

By the way, the following configuration does not work when I set before exec `PackManager.v().runPacks()`
Options.v().setPhaseOption("jj.cp", "enabled:false"); // Copy propagator
Options.v().setPhaseOption("jj.cbf", "enabled:false"); // Conditional Branch Folder
Options.v().setPhaseOption("jj.uce", "enabled:false"); // Unreachable Code Eliminator
Options.v().setPhaseOption("jj.dae", "enabled:false"); // Dead Assignment Eliminator
Options.v().setPhaseOption("jb.cp", "enabled:false"); // Copy propagator
Options.v().setPhaseOption("jb.cbf", "enabled:false"); // Conditional Branch Folder
Options.v().setPhaseOption("jb.uce", "enabled:false"); // Unreachable Code Eliminator
Options.v().setPhaseOption("jb.dae", "enabled:false"); // Dead Assignment Eliminator

Thank you for taking the time.



Sent with ProtonMail Secure Email.

Patrick Lam

unread,
Oct 23, 2020, 7:41:30 PM10/23/20
to cl0und, soot...@cs.mcgill.ca
Hi,

The basic issue is that because of the conversion from stack code to three-address code and back, the original code doesn't exist anymore, and if you don't optimize it, you get very verbose bytecode. JVMs might do OK with it these days, I don't know. But it's going to be way larger than the original code. You can look at the CC'00 paper for details about that translation.

pat

_______________________________________________
Soot-list mailing list
Soot...@CS.McGill.CA
https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
Reply all
Reply to author
Forward
0 new messages