RFR: 8283740: C1: Convert flag TwoOperandLIRForm to a constant on all platforms

Christian Hagedorn chagedorn at openjdk.org
Fri Dec 16 09:38:14 UTC 2022


On Wed, 14 Dec 2022 12:51:58 GMT, Damon Fenacci <duke at openjdk.org> wrote:

> The  _TwoOperandLIRForm_ flag (LIR requires src1 and dst to match in binary LIR ops) can be set at runtime but each platform defines a default value that is the only one accepted. Although some platform could theoretically support both, there is no realistic scenario for this.
> The flag is removed in favour of a constant. This is defined as enum and its assigned value is defined in the platform-specific def.

That looks good to me!

> That looks good to me but I think all these platform dependent constants should be converted to `static const` declarations at some point. From what I understand, enums are used here only [for historical reasons](https://stackoverflow.com/questions/899917/why-do-people-use-enums-in-c-as-constants-while-they-can-use-const). Could you file a follow-up RFE to investigate?

That's a good idea to clean this up as well at some point. But probably too much for this PR. So, I agree to file a separate RFE for it.

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

Marked as reviewed by chagedorn (Reviewer).

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


More information about the hotspot-dev mailing list