harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Volosyuk" <ivan.volos...@gmail.com>
Subject Re: [classlib] Exception throwing compatibility
Date Fri, 12 May 2006 09:27:39 GMT
I have different opinion there.
This exception is quite rare in this function, isn't it? If so, we can
optimize common pass by removing explicit checks. It could be
performance beneficial.

There other point here, internal exception can be lazy exception or
even be optimized out. On DRLVM IMHO if using here arraycopy the
exception will be created with lazy stack, which should be much faster
then normal exception.

If we would had no arraycopy (native function) there, but some other
(pure java) function, it could be even possible for JIT to inline and
optimize out creation of internal exception.

In other words it is not so obvious from performance perspective to
have one solution or another. I would personaly prefer implicit check
here.
--
Ivan

2006/5/12, Mikhail Fursov <mike.fursov@gmail.com>:
> Note that this is not only "beautiful" but also performance oriented way ->
> do not create extra rethrows if it's possible
>
> On 5/12/06, Semukhina, Elena V <elena.v.semukhina@intel.com> wrote:
> >
> > To have a "beautiful" fix, why don't you just write
> >
> >
> >
> > System.arraycopy(data, start, value, 0, count);
> >
> >
> >
> > without trying to catch any exception and rethrow another one?
> > ArrayIndexOutOfBoundsException, if happened, would be thrown by
> > System.arraycopy().
> >
> >
> >
> >
>
>
> --
> Mikhail Fursov
>
>


-- 
Ivan
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message