On Wed, 15 Feb 2023 14:12:21 GMT, Adam Sotona <asot...@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

Reply via email to