RFR: 8315771: [JVMCI] Resolution of bootstrap methods with int[] static arguments [v7]

Doug Simon dnsimon at openjdk.org
Wed Sep 13 13:57:41 UTC 2023


On Wed, 13 Sep 2023 13:36:27 GMT, Sacha Coppey <duke at openjdk.org> wrote:

>> src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotConstantPool.java line 558:
>> 
>>> 556:          * @param index index of the element to return
>>> 557:          * @return A {@link PrimitiveConstant} representing an unresolved constant pool entry
>>> 558:          * or a {@link JavaConstant} representing the static argument requested
>> 
>> `or a {@link JavaConstant}`
>> a PrimitiveConstant is a JavaConstant isn't it?
>
>> a PrimitiveConstant is a JavaConstant isn't it?
> 
> Yes, it is, but since the primitives are returned in their boxed form, a PrimitiveConstant can only be a constant pool index, so I think it is better to specify the difference.

My point is that a PrimitiveConstant is a subtype of JavaConstant so the "or" does not make sense. It's like saying "an int or a number".

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15588#discussion_r1324555178


More information about the hotspot-compiler-dev mailing list