[RFC/RFT] Patch (java): Switch to new verifier

Tom Tromey tromey@redhat.com
Mon Mar 21 21:50:00 GMT 2005

Andrew> for (blah)
Andrew> baz += a.b;
Andrew> because we'll fetch a.b from memory every time around the loop.

This case would be helped if we could peel (is that the right term?)
the first iteration off the loop.  Then we would see:

  baz += a.b;
  for (...)
    baz += a.b;

Then we could mark the reference via "a" in the loop as non-volatile,
as it would be dominated by a possibly-trapping reference.  (Maybe we
could accomplish this by adding an ASSERT_EXPR<a != null> after a
dereference via 'a', then let VRP remove them... this would let us
easily catch the case where a dereference of a 'new' object cannot

Peeling the first iteration may help java code in other cases, due to
class initialization.

rth>   baz += a.b + a.c

This would also be handled by the same machinery.


More information about the Java-patches mailing list