[foreign-memaccess+abi] RFR: Prevent maxAlign virtual calls for polluted accesses [v2]

Radoslaw Smogura duke at openjdk.org
Mon Aug 8 17:30:33 UTC 2022


On Mon, 8 Aug 2022 17:22:30 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> I just checked it with vector operations only, there's check in `ScopedMemoryAccess` `loadFromMemorySegment` which checks max align in case of polluted access this will create polymorphic call.
>> 
>> - However when I look right now I think there's second option. Instead of changing `maxAlign`, the check in `loadFromMemorySegment`, could be replaced by checking if segment instance is native or `Bytes`.?
>
> is this the affected code?
> 
> // @@@ Smarter alignment checking if accessing heap segment backing non-byte[] array
>         if (msp.maxAlignMask() > 1) {
>             throw new IllegalArgumentException();
>         }
>  ```

Exactly!

-------------

PR: https://git.openjdk.org/panama-foreign/pull/700


More information about the panama-dev mailing list