|Control Flow Analysis for Languages with Exceptions (e.g. Java) firstname.lastname@example.org (Oliver Wong) (2006-11-04)|
|Re: Control Flow Analysis for Languages with Exceptions (e.g. Java) DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-11-05)|
|Re: Control Flow Analysis for Languages with Exceptions (e.g. Java) email@example.com (Arthur J. O'Dwyer) (2006-11-05)|
|Re: Control Flow Analysis for Languages with Exceptions (e.g. Java) firstname.lastname@example.org (Wolfram Fenske) (2006-11-05)|
|Re: Control Flow Analysis for Languages with Exceptions (e.g. Java) email@example.com (Michael Klemm) (2006-11-15)|
|From:||Michael Klemm <firstname.lastname@example.org>|
|Date:||15 Nov 2006 15:23:01 -0500|
|Posted-Date:||15 Nov 2006 15:23:01 EST|
Oliver Wong wrote:
> In the case of Java (and probably other languages with exception,
> though I don't have experience with any of them), every instruction
> would be its own basic block, because an exception could potentially
> be thrown at any point, thus guaranteeing that there does not exist
> any pair of points such that you could be certain that the second
> instruction would execute, given that the first was executed.
If an exception may happen at any place of the source, then a compiler
has to create minimal basic block, i.e. blocks that only contain a
single byte-code/assembly instruction. Each block then receives an
additional edge that leads to the catch block or the functions end.
The additional edge models the exceptional case.
However, there's a paper about Factored Control Flow Graphs (FCFG) 
that rearranges the CFG such that it becomes sort of minimal again by
factoring out the exceptional edge. However, this comes at the expense
that the FCFG has to be handled by every subsequent DFA/CFA.
 J.-D. Choi, D. Grove, M. Hind, V. Sarkar. Efficient and Precise
Modeling of Exceptions for the Analysis of Java Programs. Proc. of the
1999 ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools
and Engineering, Toulouse, France, 1999, pp. 21-31.
Return to the
Search the comp.compilers archives again.