RFR: 8177673: [JVMCI] missing checks in HotSpotMemoryAccessProviderImpl can cause VM assertions to fail

Doug Simon doug.simon at oracle.com
Fri Mar 31 22:46:36 UTC 2017


I've had to rework this patch after talking to the Truffle team. Truffle doesn't always read in compliance with field layout. For example, Truffle can perform a short read from an int field or a long read from an int array or pair of adjacent int fields. Since we only care about not making the VM crash or halt due to a VM assertion, the checks performed by JVMCI should allow the above kinds of access. As such, I've relaxed the checking to only ensure that a read is within the bounds of an object or array. Only in the case of an object read do we now check that the displacement of the read corresponds to a field (which must be of kind JavaKind.Object).

Please re-review this patch in light of the above.

-Doug

> On 31 Mar 2017, at 00:30, Doug Simon <doug.simon at oracle.com> wrote:
> 
> Please review this patch to fix a VM-level assertion failure due to missing sanity checks in HotSpotMemoryAccessProviderImpl. The sanity checking has been enhanced to map an object+displacement back to a field before performing a read. If the mapping fails, an IllegalArgumentException is thrown.
> 
> Tested on Graal.
> 
> -Doug
> 
> http://cr.openjdk.java.net/~dnsimon/8177673/webrev/
> https://bugs.openjdk.java.net/browse/JDK-8177673



More information about the hotspot-compiler-dev mailing list