Re: Control Flow Analysis for Languages with Exceptions (e.g. Java)

Michael Klemm <usenet@gmx.info>
15 Nov 2006 15:23:01 -0500

          From comp.compilers

Related articles
Control Flow Analysis for Languages with Exceptions (e.g. Java) owong@castortech.com (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) ajonospam@andrew.cmu.edu (Arthur J. O'Dwyer) (2006-11-05)
Re: Control Flow Analysis for Languages with Exceptions (e.g. Java) int2k@gmx.net (Wolfram Fenske) (2006-11-05)
Re: Control Flow Analysis for Languages with Exceptions (e.g. Java) usenet@gmx.info (Michael Klemm) (2006-11-15)
| List of all articles for this month |
From: Michael Klemm <usenet@gmx.info>
Newsgroups: comp.compilers
Date: 15 Nov 2006 15:23:01 -0500
Organization: Compilers Central
References: 06-11-017
Keywords: analysis
Posted-Date: 15 Nov 2006 15:23:01 EST

Hi,


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) [1]
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.


Regards
-michael


[1] 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.



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.