Why does GCJ generate so many explicit checks for null pointers?

Andrew Haley aph@redhat.com
Tue Jul 29 10:46:00 GMT 2003


Jeff Sturm writes:
 > On Mon, 28 Jul 2003, David Daney wrote:
 > > Why check before the constructor call?  Is it ever possible for
 > > _Jv_AllocObjectNoFinalizer to return null?
 > 
 > No, but the backend optimizers don't know that, or else DCE would
 > eliminate the test.

 > Currently only a few java-specific optimizations are done by gcj.

Null pointer check elimination isn't really Java specific.  

The plan is to do this optimization in tree-SSA.  With that framework
it isn't very difficult.

Andrew.



More information about the Java mailing list