[code-reflection] RFR: 8324556: Not copy result-type when copying an op

Mourad Abbay mabbay at openjdk.org
Thu Jan 25 16:56:12 UTC 2024


On Tue, 23 Jan 2024 21:38:42 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> 8324556: Not copy result-type when copying an op
>
> src/java.base/share/classes/java/lang/reflect/code/op/CoreOps.java line 1891:
> 
>> 1889:         }
>> 1890: 
>> 1891:         VarOp(String varName, TypeDesc type, Value init) {
> 
> Used parameter `type`?

No, it can be removed.

> src/java.base/share/classes/java/lang/reflect/code/op/CoreOps.java line 2753:
> 
>> 2751:         public TypeDesc resultType() {
>> 2752:             return operands().get(0).type();
>> 2753:         }
> 
> Move to `UnaryOp`?

It can be moved, I just wasn't sure if the pattern will hold for every UnaryOp.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/6#discussion_r1466664092
PR Review Comment: https://git.openjdk.org/babylon/pull/6#discussion_r1466666863


More information about the babylon-dev mailing list