RFR: 8294982: Implementation of Classfile API [v15]

Paul Sandoz psandoz at openjdk.org
Thu Mar 2 20:19:58 UTC 2023


On Wed, 15 Feb 2023 14:12:21 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/classfile/instruction/ConstantInstruction.java line 63:
>> 
>>> 61:      * aload_0}).
>>> 62:      */
>>> 63:     sealed interface IntrinsicConstantInstruction extends ConstantInstruction
>> 
>> I'm not super sure of the fine-grained distinction here. The constant pool variant is interesting (as you can ask for the associated constant entry) - but the distinction between intrinsics vs. argument seems rather weak.
>
> They significantly differ in instruction formats and instruction format distinction is critical for some use cases.

I think this distinction is appropriate for the level of modeling. CodeBuilder::constantInstruction(ConstantDesc value) is very useful in selecting the most appropriate specific constant instruction.

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

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



More information about the build-dev mailing list