This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Null pointer check elimination
On Sunday 13 November 2005 01:47, Tom Tromey wrote:
> >>>>> "Chris" == Chris Gray <chris.gray@kiffer.be> writes:
>
> Chris> Another way to look at functions which return 'this' (and there
> Chris> are plenty of those in the core Java libraries) is that
> Chris> [...]
> [...]
> I wouldn't want this idea to hold up Anthony's patch though. I think
> they are separable and, as this one is harder to implement, it is
> reasonable to go with something easy first.
In the general case it's not easy, but in the context of special-casing
intensively used parts of the core API (cf. memcpy) it looks attractive (and
it can maybe save a lot of code, not just the null pojnter check but the
whole dup - push - invoke jazz). The non-null return type is of course more
general, and applies also to randomly ingested code, so the two ideas are
indeed separable.
--
Chris Gray /k/ Embedded Java Solutions BE0503765045
Embedded & Mobile Java, OSGi http://www.kiffer.be/k/
chris.gray@kiffer.be +32 3 216 0369