This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


I am running gcj 3.3 on a i386-linux platform.

I have noticed that in the code the GCJ generates, most (if not all) places that a reference (or is that a pointer) is dereferenced, an explicit check for null is done. If a null value is found an explicit call to _Jv_ThrowNullPointerException is done.

I have also noticed that the runtime (in prims.cc) is trying to handle SIGSEGV by throwing NullPointerException.


Would someone be kind enough to explain to me why GCJ doesn't generate code without the null checks and let the SIGSEGV handler handle null pointer problems.


It seems that the generated code would run much faster without all those checks (something that I am concerned about in my current project).

Am I missing something here?


Thanks in advance.


David Daney.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]