This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Re: Patch: Standard comformant arithmetic
>>>>> "Andrew" == Andrew Haley <aph@pasanda.cygnus.co.uk> writes:
>> For systems without memory management support, when -Os is used, it
>> might make the most sense to put the check inside the callee and
>> not the caller. Of course, this would mean that you'd have to
>> build your entire application the same way in order to get
>> consistent null pointer checks. Does this sound reasonable?
Andrew> What exactly do you mean by "the callee and not the caller?" I can
Andrew> think of several different ways that the check could be done.
Instead of checking at each call site whether this==null, we would put
code to do the check just after the prologue of each function. This
would make a smaller executable at the cost of speed (since presumably
the provably-not-null optimization would win in many cases).
This doesn't suffice for field accesses. But field accesses from
other objects ought to be rare compared to method calls.
Tom