[GR-50385] Include all reflection queries for registered classes #9043
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR uses the work done in #8369 and #8271 to automatically register all elements of a class registered for reflection with the newly-introduced
"type"
keyword. The methods, constructors and fields included only have the metadata required to create the correspondingMethod
,Field
orConstructor
object without invocation or access capabilities. This change has therefore no influence on reachability.The image size impact of this change is documented in #7753. Including all the metadata incurs a less than 2% image size increase in all evaluated workloads, with an average around 1%.
This PR includes the following changes:
ConfigurationType
. This is not user-facing, but is necessary to be able to register all fields in a class for reflection without affecting reachability.ReflectionConfigurationParser
to register the metadata when"type"
is used. This part required some modification to the previous work done when introducing"type"
: the whole processing is now contained in the parser, and theConfigurationType
is now unaware of whether it was created from a"type"
or"name"
entry.FrequencyEncoder
is modified to enable a check when adding a new element. This is used to make debugging easier in cases where a class that was omitted from the static analysis is added to the encoder.