soot for dummies
DESCRIPTION
Introduction to Soot, a Framework for analysing, transforming and optimising Java programs.TRANSCRIPT
![Page 1: Soot for dummies](https://reader033.vdocuments.us/reader033/viewer/2022052204/558966a0d8b42ab9738b4619/html5/thumbnails/1.jpg)
![Page 2: Soot for dummies](https://reader033.vdocuments.us/reader033/viewer/2022052204/558966a0d8b42ab9738b4619/html5/thumbnails/2.jpg)
Soot
I Framework for analysis, transformation and optimization ofJava programs
I Support for both intra-procedural and inter-procedural
I Many built-in analyses and optimizations are available
I Provides intermediate representations of Java codeI Jimple, Shimple, Baf, Grimp
1 / 7
![Page 3: Soot for dummies](https://reader033.vdocuments.us/reader033/viewer/2022052204/558966a0d8b42ab9738b4619/html5/thumbnails/3.jpg)
Jimple
Main intermediate representation used in Soot.
Key characteristics:
I Stackless, typed 3-address code
I Simplified set of instructions
I Suitable for analysis and optimization
2 / 7
![Page 4: Soot for dummies](https://reader033.vdocuments.us/reader033/viewer/2022052204/558966a0d8b42ab9738b4619/html5/thumbnails/4.jpg)
From Java to Jimple: Example
3 / 7
![Page 5: Soot for dummies](https://reader033.vdocuments.us/reader033/viewer/2022052204/558966a0d8b42ab9738b4619/html5/thumbnails/5.jpg)
Processing of Java classes via Soot
1. Parsing Java sources or class files into Jimple IR2. Processing of various IRs in several phases
Figura : Intra-procedural execution flow
4 / 7
![Page 6: Soot for dummies](https://reader033.vdocuments.us/reader033/viewer/2022052204/558966a0d8b42ab9738b4619/html5/thumbnails/6.jpg)
Using data-flow framework
A checklist of your obligations:
1. Subclass*FlowAnalysisI ForwardFlowAnalysisI BackwardFlowAnalysisI ForwardBranchedFlowAnalysis
2. Implement abstraction: merge(), copy()
3. Implement flow function: flowThrough()
4. Implement initial values: newInitialFlow() andentryInitialFlow()
5. Implement constructor (it must call doAnalysis())
5 / 7
![Page 7: Soot for dummies](https://reader033.vdocuments.us/reader033/viewer/2022052204/558966a0d8b42ab9738b4619/html5/thumbnails/7.jpg)
Using data-flow framework:TrulyLiveVariables
6 / 7
![Page 8: Soot for dummies](https://reader033.vdocuments.us/reader033/viewer/2022052204/558966a0d8b42ab9738b4619/html5/thumbnails/8.jpg)
Soot for dummies
Leandro Lera Romero
1Departamento de ComputacionFacultad de Ciencias Exactas y Naturales
Universidad de Buenos Aires
5 de agosto de 2013