Re: JavaMemoryModel: What's "control dependence" mean?

From: Bill Pugh (pugh@cs.umd.edu)
Date: Thu Sep 13 2001 - 10:23:38 EDT


At 6:38 PM -0400 9/12/01, Jan-Willem Maessen wrote:
>
>2) A write may be reordered across a control flow boundary iff it can
> be shown that the particular write will occur in any execution,
> regardless of the existence or behavior of other threads in the
> system.

OK, a very important point regarding control dependences:

*** Any operation is control dependent upon all preceding operations
   that could throw an exception.

So your rule (2) makes illegal any analysis that uses non-local
information to determine that an operation cannot throw an exception.

For example:

* Analysis to determine that a heap variable is always non-null, and thus
   dereferencing the value loaded from that variable never throws a null-pointer
   exception.

* Non-local analysis to determine that an array reference is in bounds. For
   example,

        "Related Field Analysis", Aneesh Aggarwal and Keith H. Randall, 2001
        ACM SIGPLAN Conference on Programming Language Design and
Implementation
        (PLDI'01) Snowbird, Utah, June 20 - 22, 2001.

* Analysis that proves that a checked check never throws an exception. For
   example, people have talked about being able to prove that the checked casts
   inserted by GJ are safe and removing them.

Now of course, there are lots of hurdles to deal with as regards
these kinds of analysis, such as how do you deal with reflection.
However, I am rather uneasy about declaring these kinds of analysis
to be fundamentally illegal.

        Bill
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:34 EDT