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.
            
- relates to
- 
                    JDK-8369993 Redundant separate 'String' check in 'trust_final_non_static_fields' ciField.cpp -           
- Open
 
-         
- 
                    JDK-8161245 Enums should be fully optimized -           
- Closed
 
-