Commit ee8d971b authored by Mark Mendell's avatar Mark Mendell
Browse files

X86: Use memory to do array range checks



Currently, an HBoundsCheck is fed by an HArrayLength, causing a load of
the array length, followed by a register compare.

Avoid the load when we can by comparing directly with the array length
in memory.  Implement this by marking the HArrayLength as 'emitted at
use site', and then generating the code in the HBoundsCheck.

Only do this replacement when we are the only user of the ArrayLength
and it isn't visible to the environment.

Handle the special case where the array is 'null' and where an implicit
null check can't be eliminated.

This code moves the load of the length to the slow code for the failed
check, which is what we want.

Test: 609-checker-x86-bounds-check

Change-Id: I9cdb183301e048234bb0ffeda940eedcf4a655bd
Signed-off-by: default avatarMark Mendell <mark.p.mendell@intel.com>
parent dedde3f1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment