简体   繁体   English

在类上运行 Soot Jimple Optimizer

[英]Running the Soot Jimple Optimizer on a class

Is it possible to run the JOP optimizer on a SootClass ?是否可以在SootClass上运行 JOP 优化器? I'd like to optimize a class that I've generated manually with Jimple statements through the Java API.我想优化我通过 Java API 使用 Jimple 语句手动生成的类。 As far as I understand, the optimizer is only run at resolve-time, so not every time after Jimple bodies have been manipulated.据我了解,优化器仅在解析时运行,因此并非每次在操纵 Jimple 主体后都运行。 Is it possible to rerun this optimalization manually, from within Java?是否可以从 Java 内部手动重新运行此优化?

I found the right function calls, after some searching!经过一番搜索,我找到了正确的函数调用!

PhaseOptions.v().setPhaseOption("jop", "enabled:true")
PackManager.v().getPack("jop").apply(jimpleBody)

Run this on every method body of the class you want to optimize (with jimpleBody being replaced by that method body), and it will run the JOP optimizer on the Jimple code.在您想要优化的类的每个方法体上运行它(用该方法体替换 jimpleBody),它将在 Jimple 代码上运行 JOP 优化器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM