JDK-8357737 : Avoid name overhead for Parameter access
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 24
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-05-26
  • Updated: 2025-07-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
Parameters are created to correct many inconsistencies with formal parameters, such as mandated or synthetic parameters that disrupt mapping of generic types/parameter annotations to the parameter indices. In addition, they are the only way to access the access flags or modifiers on parameters.

Currently, when parameters are requested, all parameter names are computed eagerly. In large applications, this causes a significant overhead, observed in the form as synthesized parameter names getting allocated repeatedly for Java programs compiled without -parameters flag. (Worse, this code is in runtime, so most likely C2 cannot optimize those allocations when they are unused).

We should consider an extra level of laziness for parameter name access - they are often time not in users' interest, yet they are consistently created and punish users who just want to get annotation or generic type offsets right. We might update parameter initialization into two passes - one for modifiers, and another for names.
Comments
In addition, we can avoid repeated VM downcall fetching of MethodParameters by performing fetching for the root Executable object.
30-05-2025