2

Today I read a very interesting article about escape analysis in Java called Escape Analysis for Object Oriented Languages: Application to Java

I think I have some grasp on how escape analysis works and how it is implemented, but I don't understand how the above algorithm works at all. I have also read two other papers on escape analysis in Java, Escape analysis for Java and Compositional pointer and escape analysis for Java programs. The algorithms in those papers are very similar and I understand on a high-level how they work.

But Blanchet's escape analysis algorithm appears to be completely different and I do not understand it at all. So the question is if someone can explain how his algorithm works? How is it different from "normal" escape analysis algorithms?

(this question comes from Stack Overflow)

Edit: I think I have finally figured out one big difference in Blanchet's algoritm vs the others. He does not build a tree at all and instead just uses forward and backward propagation. Consider this example:

Object foo() {
    ...
    a = c;
    a = b.f;
    return a;
}

The backward propagation starts at return a; and sees that a is returned, so a escapes. It then goes to line a = b.f; and sees that a is assigned b.f. Since a escapes, b.f also escapes. Next, it looks at a = c; and like before a escapes so c escapes. And so on. This appears to be a big flaw in his algorithm, it overestimates the number of escapees. Because he is not building a reference graph like the other algorithms he cannot see that c doesn't escape at all because of the a = b.f; on the next line. So the algorithm is likely very fast (doesn't build a graph) but not precise enough.

0 Answers0