Dynamic Architecture Extraction: Cormac Flanagan Stephen Freund
Dynamic Architecture Extraction: Cormac Flanagan Stephen Freund
Ownership
– Aldrich / Boyapati / Noble and others
Confined types
– [Vitek-Bokowski, 01]
Shape analysis
– [Sagiv-Reps-Wilhelm, 98]
Aliasing patterns
– [Hackett-Aiken, 06]
Model Extraction
– [Jackson-Waingold, 99]
Our Work
TypeDecl
Aardvark
Class files Instrumenter
Instrumented JVM
Class files
Log of all
- object allocations
- field writes
Aardvark Analysis Architecture
Log of all
- object allocations
Heap
- field writes Rebuilder
Object Model
Reconstructor
Main
Iterator HashMap
Key *
Entry Value
Aardvark Analysis (for one heap)
Abstract Graph
Concrete Heap Object Model (aka Object Model)
Reconstruction Main
- Project
- Close Iterator HashMap
- Abstraction
Key *
Entry Value
- Subtyping
- Multiplicities
- Uniqueness
- Ownership
- Containment
Heap Projections
Much of heap is irrelevant to software
engineering task at hand
– so we remove it
ClassDecl
ClassDecl
ClassDecl
ClassDecl
Abstract Graph
ClassDecl
TypeDeclElem
α Abstract Graph
ClassDecl
TypeDecl
α Abstract Graph
ClassDecl
γ
TypeDecl
α Abstract Graph
Main
γ
Iterator HashMap
Key *
Entry Value
T Node T Node
T Node
Node Node Node
Node Node
T Node T Node
T Node
Node Node Node
Node Node
T Node
T Node
Node
Node Node
Node
Node Node Node Node
Node
Multiplicities
Main LinkedList
Pt Elem
?
Controlled Sharing: Uniqueness is not Enough
Pt
Main LinkedList
Pt Elem
?
Ownership for Controlled Sharing
Main LinkedList
Pt Elem
?
Beyond Ownership
Main
Iterator HashMap
Main
Key
*
Entry Value
Iterator Iterator Iterator
Iterator HashMap
Main
Key
*
Entry Value
Iterator Iterator Iterator
Main
Iterator HashMap
Main
Key
*
Entry Value
Iterator Iterator Iterator
- Project
- Close Iterator HashMap
- Abstraction Key *
Entry Value
- Subtyping
- Multiplicities
- Uniqueness
- Ownership
- Containment
Aardvark Analysis (for Heap Sequence)
Heap Sequence Abstract Graph Seq.
Object Model
Main
Reconstruction Main
Main
Main
- Project Iterator
Iterator
HashMap
HashMap
- Close Iterator
Iterator
HashMap
Key Entry HashMap
* Value
Key Entry* Value
- Abstraction Key
Key
Entry *
Entry *
Value
Value
- Subtyping
- Multiplicities
- Uniqueness Merge
- Ownership (least upper bound)
- Containment
Main
Iterator HashMap
Key *
Entry Value
Implementation
Aardvark
Class files Instrumented
Instrumenter Class files
Log of all
- object allocations
Heap - field writes JVM
Rebuilder
Main