2. • Hindley-Milner style polymorphic type
inference: low cost of inference by
unification to model intra-procedural
dependencies of values
• the flow of values between functions
characterized by instantiations of
polymorphic types
• polymorphic version of Steensgaard’s algo.
• flow-insensitive, context-sensitive
2010 1 8
5. • 2: type constraint
• 3: constraint resolution algorithm
• 4: Computing global flow information
• by type instantiation graph
• 5: Experiments
2010 1 8
6. Flow-Query
• each sub-expression is annotated by a label l
• “Do values arising at label l in the program
1
flow to a program point lablled l2?”
• by tracing path on the type instantiation graph
2010 1 8
7. 2010
1
8
Normalized dereference set size
0
20
40
60
80
100
co
m
18
pr
e ss
li
m
88
ks
im
ijp
eg
Monomorphic
go
Benchmark
pe
r l
Polymorphic
vo
rte
x
gc
c
Analysis time (us per node)
co
0
500
1000
1500
2000
m
pr
e ss
li
m
88
Monomorphic
ks
im
ijp
eg
go
Benchmark
Instantiation overhead
pe
r l
vo
rte
x
gc
c
Flow step overhead
8. 2010
1
8
Multiple of #Nodes
Monomorphic
co
0
6
12
m
pr 18
e ss
li
m
88
ks
im
ijp
eg
#Nodes: Polymorphic
Benchmark go
pe
r l
vo
rte
x
#Instantiation edges
gc
c