-
Enhancement
-
Resolution: Unresolved
-
P2
-
None
-
Fix Understood
The VM cannot trust the fields in `String` are never changed as they are not `@Stable` annotated. Making the fields trustworthy would improve performance in many situations.
Example
static final Map<String, VarHandle> MAP = Map.of(....);
MAP.get("malloc").invokeExact(42L); // This could constant fold
Example
static final Map<String, VarHandle> MAP = Map.of(....);
MAP.get("malloc").invokeExact(42L); // This could constant fold
- relates to
-
JDK-8354777 Strings with hash = 0 are not constant foldable
-
- Open
-
- links to
-
Review(master) openjdk/jdk/24625