On Thu, 6 Apr 2023 20:42:26 GMT, Glavo <d...@openjdk.org> wrote:

>> There is no benefit to preemptively defining a full set of architectures; we 
>> only need those that are used in the OpenJDK runtime selection of options or 
>> parameters.
>> The other and unknown cases can be handled in code using switch as `default` 
>> or for `if (xx) {} else {...}` in the else clause.
>> Ports not supported the OpenJDK can add enum values and the corresponding 
>> static `isXXX()` methods if needed.
>> 
>> The template file used in the implementation could be renamed to be more 
>> agnostic to OS or arch.
>
> I understand that there is no need to define enum entries for all 
> architectures now, but the `current` method seems to cause crashes on other 
> platforms. 
> 
> Even worse, `OperatingSystemProps` seems to be unable to compile on other 
> architectures at all:
> 
> https://github.com/openjdk/jdk/blob/52ca4a70fc3de9e285964f9545ea8cd54e2d9924/src/java.base/share/classes/jdk/internal/util/OperatingSystemProps.java.template#L40
> 
> Does `Architecture` really need to be implemented as an enum? The value of 
> this enum has never been used in this PR except for testing. I think perhaps 
> just providing the isXXX methods is enough.

The point of Architecture is reflect the architecture as supported by the build 
and the runtime mutually and to reflect dependencies on the target hardware. 

What did you use as the example that would not compile on the other 
architecture?
Did you make the other changes to the build that would be needed for a new 
architecture?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13357#discussion_r1160252604

Reply via email to