A DESCRIPTION OF THE PROBLEM :
Currently, all references to `<primitive>.class` get compiled to `getstatic java/lang/<Wrapper>.TYPE`, e.g.: `int.class` → `Integer.TYPE`.
I propose to compile them to a CONSTANT_Dynamic which uses `java.lang.invoke.ConstantBootstraps::primitiveClass` instead.
However, just like with JEP 280, it will be necessary to keep compiling `java.base` with the old method (and/or do a search‑and‑replace) to avoid circularities in the JDK.
## See also:
- https://bugs.openjdk.java.net/browse/JDK-8085796 (JEP 280)
- https://bugs.openjdk.java.net/browse/JDK-8187742
Currently, all references to `<primitive>.class` get compiled to `getstatic java/lang/<Wrapper>.TYPE`, e.g.: `int.class` → `Integer.TYPE`.
I propose to compile them to a CONSTANT_Dynamic which uses `java.lang.invoke.ConstantBootstraps::primitiveClass` instead.
However, just like with JEP 280, it will be necessary to keep compiling `java.base` with the old method (and/or do a search‑and‑replace) to avoid circularities in the JDK.
## See also:
- https://bugs.openjdk.java.net/browse/JDK-8085796 (JEP 280)
- https://bugs.openjdk.java.net/browse/JDK-8187742
- relates to
-
JDK-8187742 Minimal set of bootstrap methods for dynamic constants
-
- Resolved
-
-
JDK-8085796 JEP 280: Indify String Concatenation
-
- Closed
-