RFR: JDK-8282798 java.lang.runtime.Carrier [v5]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri Mar 11 15:56:47 UTC 2022


On Fri, 11 Mar 2022 15:48:37 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Jim Laskey has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Use long array for primitives
>>  - Use long arrays for primitives
>
> src/java.base/share/classes/java/lang/runtime/Carrier.java line 380:
> 
>> 378:                 }
>> 379: 
>> 380:                 return Unsafe.ARRAY_LONG_BASE_OFFSET +
> 
> Shouldn't you add the offset of the first `int` value in the array to the resulting expression? E.g. I'm assuming we're storing `long`s first and `int`s after? If so, `int` values will be located at an offset from the start of the array.

Ah ok - I see - the constructor method handle binds the correct offset, adding the required constant offset (for all the long values). So my comment it's mostly stylistic.

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

PR: https://git.openjdk.java.net/jdk/pull/7744


More information about the core-libs-dev mailing list