Integrated: 8286190: Add test to verify constant folding for Enum fields

Aleksey Shipilev shade at openjdk.java.net
Fri May 6 16:34:56 UTC 2022


On Thu, 5 May 2022 13:35:37 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> There is the [JDK-8161245](https://bugs.openjdk.java.net/browse/JDK-8161245) to make compilers trust Enum final fields. It was implicitly implemented by [JDK-8234049](https://bugs.openjdk.java.net/browse/JDK-8234049), which added the wildcard trust for everything in java/lang:
>   https://github.com/openjdk/jdk/blob/c5a0687f80367a3a284dfd56781c371826264d3b/src/hotspot/share/ci/ciField.cpp#L230
> 
> It would be better to have the explicit test that verifies the constant folding of Enum fields indeed happens.
> 
> Additional testing:
>  - [x] Linux x86_64 fastdebug, new test passes
>  - [x] Linux x86_64 release, new test passes
>  - [x] Linux x86_32 fastdebug, new test passes

This pull request has now been integrated.

Changeset: 080f3c5d
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/080f3c5d8a2f7b2d13baf98c594d4ace67608fc4
Stats:     70 lines in 1 file changed: 70 ins; 0 del; 0 mod

8286190: Add test to verify constant folding for Enum fields

Reviewed-by: kvn, thartmann

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

PR: https://git.openjdk.java.net/jdk/pull/8551


More information about the hotspot-compiler-dev mailing list