This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

Re: Libjava failures status


>>>>> "Chris" == Chris Lattner <sabre@nondot.org> writes:

>> Every _reachable_?  Insane, I'm sure Sun specified this to make really
>> sure, that no highly optimizing compiler for java is implementable :/

Chris> No, it would be perfectly reasonable to represent this (safely)
Chris> with explicit checks, which would not break any
Chris> optimizations... Why does GCC have the notion of a trapping and
Chris> nontrapping instruction?  Perhaps it is not the best approach
Chris> for GCJ?

gcj has a flag which will cause it to generate explicit checks.

However, if you assume that the checks usually pass, and you care more
about the performance of the normal case, and not so much about the
performance of generating the exception, and your platform has support
for it, then it is better to omit the tests and let the trap be
converted into an exception by the runtime.

For instance, this is the case on Linux, which is an import platform.
Rather than generating lots of null pointer checks, we just let the OS
generate a SEGV which we turn into a NullPointerException.

Tom


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