add some array bounds check optimizations
Merge pull request #3620 from WalterBright/bounds

add some array bounds check optimizations