-
Enhancement
-
Resolution: Fixed
-
P4
-
repo-valhalla
Support for primitive classes should be refactored as an experimental feature, off by default and activated with -XX:+EnablePrimitiveClasses
When the flag is off:
- ACC_PRIMITIVE classes should fail to load with a CFE
- Q descriptors (including those appearing in Class constants) should be treated as malformed
Of course, a number of tests depend on this functionality so will need to be updated to use the flag.
Use of -XX:+EnablePrimitiveClasses should probably depend on -XX:+EnableValhalla, which eventually will be off by default and activated with --enable-preview.
Optionally, internals that exist only to support primitive classes could be called out or separated. Looking forward, we will want to be prepared to entirely exclude code dealing with primitive classes if the Value Objects JEP is delivered independently. (This will be hard to do for many internals, though, and we may end up applying features like heap flattening to value class types as well.)
When the flag is off:
- ACC_PRIMITIVE classes should fail to load with a CFE
- Q descriptors (including those appearing in Class constants) should be treated as malformed
Of course, a number of tests depend on this functionality so will need to be updated to use the flag.
Use of -XX:+EnablePrimitiveClasses should probably depend on -XX:+EnableValhalla, which eventually will be off by default and activated with --enable-preview.
Optionally, internals that exist only to support primitive classes could be called out or separated. Looking forward, we will want to be prepared to entirely exclude code dealing with primitive classes if the Value Objects JEP is delivered independently. (This will be hard to do for many internals, though, and we may end up applying features like heap flattening to value class types as well.)
- relates to
-
JDK-8288131 [lworld] Implement javac flag -XDenablePrimitiveClasses
-
- Resolved
-