pascal-lab/Tai-e

Is it possible to cache the analysis results of classes in jdk?

struce2 opened this issue · 3 comments

Tai-e is resident in memory as a service, so as to avoid repeated analysis of public classes in jdk.

By default, Tai-e dose not delete analysis results after running analyses (unless you specify option --keep-result to only keep results of some specific analyses). So if you write another program that calls pascal.taie.Main.main(args), then after Main.main(args) finishes, the analysis results still stay in memory, and you can obtain them via World.get().get....

I have 2 programs A and B, after analyzing A, if I want to analyze B, I need to call initSoot, in initSoot, internalTransform calls builder.build, in builder.build, it will reset theWorld to null.

These two programs seem to analyze the classes in jdk when analyzing, like this case, can we share the analysis result of jdk? So that we don't have to analyze the jdk 2 times? I don't know if this is possible.

It is impossible in current architecture. Tai-e (relies on Soot) builds closed world via a reference analysis, and A and B may reference different classes in JDK, so they cannot directly share JDK classes. We would try to reuse abstraction of JDK (e.g., IR, JClass, etc.) in the future.