[armedbear-devel] AASTORE Removal - Bounds checking

Alessio Stalla alessiostalla at gmail.com
Thu Dec 3 20:32:11 UTC 2009


On Thu, Dec 3, 2009 at 9:24 PM,  <logicmoo at gmail.com> wrote:
> With  the execute(...) functions in Primitive.java
>
> @Override
>    public LispObject execute(LispObject first, LispObject second,
>                              LispObject third)
>
>    {
>        LispObject[] args = new LispObject[3];
>        args[0] = first;
>        args[1] = second;
>        args[2] = third;
>        return execute(args);
>    }
>
> Should probably be transformed to
>
> @Override
>    public LispObject execute(LispObject first, LispObject second,
>                              LispObject third)
>
>    {
>        return execute(new LispObject[]{first,second,third});
>    }
>
> To remove the redundant bounds checking of AASTORE

I believe that javac translates the second method to the exact same
code as the first. Bounds checking can't be eliminated in Java as far
as I know.

Alessio




More information about the armedbear-devel mailing list