Relates :
|
Currently, C2 has its own constant folding for final fields in primitive boxes and String in LoadNode::Value. But for quite some time now, we have a shared infra in CI that communicates what final fields in JDK can be trusted by compilers. As the cleanup, we'd want to remove the C2-specific handling, and instead spell out these special cases in shared code. The side benefit would be C1 picking up optimizations too.