RFR: 8296956: [JVMCI] HotSpotResolvedJavaFieldImpl.getIndex returns wrong value

Doug Simon dnsimon at openjdk.org
Tue Nov 15 10:56:35 UTC 2022


On Tue, 15 Nov 2022 10:50:29 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> This PR fixes a bug related to `HotSpotResolvedJavaFieldImpl.index`. Its value is passed into the `HotSpotResolvedJavaFieldImpl` constructor as an `int`, and is returned by `getIndex()` as an `int` but it was stored as a `short`. This meant that unsigned 16-bit values were not handled correctly.
>> 
>> Also included are some related JVMCI cleanups:
>> * added and fixed doc related to `ResolvedJavaField.getOffset()`
>> * replaced assertions with always-enabled checks
>
> src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java line 270:
> 
>> 268:                             opcode == Bytecodes.INVOKEVIRTUAL ||
>> 269:                             opcode == Bytecodes.INVOKESPECIAL ||
>> 270:                             opcode == Bytecodes.INVOKESTATIC) {
> 
> Indentation looks a bit off.

That's due to the Eclipse formatter enforced style adopted across JVMCI and Graal. I can add comments to explicitly disable it here if you want but I'm not sure it's worth it.

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

PR: https://git.openjdk.org/jdk/pull/11142


More information about the hotspot-dev mailing list