On Tue, 24 Jan 2006 21:41:20 +0100, "E. Naubauer"
<> wrote, quoted or indirectly quoted someone who
said :
>Interesting, but do aot compilers tend to remove language specific
>issues like array bounds check etc.?
They are clever. They figure out when the bounds checks are not
necessary or promote them out of loops. I'm not sure if you can still
do this, but at one time here was an option to have jet turn off
bounds checking altogether.
see
http://mindprod.com/jgloss/jet.html
Optimising compilers do quite will with array processing. They can
avoid redoing the address calculations for each access. They
potentially can avoid the array store type check.
In Java, array indexing access does not require a multiply, just a
shift because anything you can put in an array is always a power of
two bytes long. Bit arrays are the possible exception if you pack 8
bits per byte.
In other languages you have arrays of structures that can be any size,
and hence access requires a multiply. There clever optimisers convert
multiplys to additions.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.