Remark: in the paper "Counting Immutable Beans" the concepts of
free and live variables coincide because the paper does not consider
join points. For example, consider the function body
let x := ctor_0; jmp block_1 x
in a context where we have the join point
block_1 defined as
block_1 (x : obj) : obj := let z := ctor_0 x y; ret z
y is live in the function body
B since it occurs in
block_1 which is "invoked" by
Remark: we don't need to track local join points because we assume there is no variable or join point shadowing in our IR.
Return true if
x is live in the function body
b in the context
Remark: the context only needs to contain all (free) join point declarations.
Recall that we say that a join point
j is free in
FnBody.jmp j ys and
j is not local.